mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-11 15:06:58 +02:00
Support grabbing gpt-style images from buildbot
Review URL: http://codereview.chromium.org/1716003
This commit is contained in:
parent
6975c665d8
commit
565b11316a
@ -401,22 +401,6 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function check_rootfs_validity() {
|
|
||||||
echo "Checking rootfs validity"
|
|
||||||
local device=$(sudo losetup -f)
|
|
||||||
local invalid=0
|
|
||||||
sudo losetup "${device}" rootfs.image
|
|
||||||
sudo mount "${device}" rootfs
|
|
||||||
if [[ ! -e rootfs/boot/vmlinuz ]]; then
|
|
||||||
echo "This image has no kernel"
|
|
||||||
invalid=1
|
|
||||||
fi
|
|
||||||
sudo umount rootfs
|
|
||||||
sudo losetup -d "${device}"
|
|
||||||
return ${invalid}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Downloads a buildbot image
|
# Downloads a buildbot image
|
||||||
function grab_buildbot() {
|
function grab_buildbot() {
|
||||||
if [[ "${FLAGS_grab_buildbot}" == "LATEST" ]]; then
|
if [[ "${FLAGS_grab_buildbot}" == "LATEST" ]]; then
|
||||||
@ -433,18 +417,15 @@ function grab_buildbot() {
|
|||||||
-o "${dl_dir}/image.zip"
|
-o "${dl_dir}/image.zip"
|
||||||
cd "${dl_dir}"
|
cd "${dl_dir}"
|
||||||
unzip image.zip
|
unzip image.zip
|
||||||
check_rootfs_validity
|
|
||||||
local image_basename=$(basename $(dirname "${FLAGS_grab_buildbot}"))
|
local image_basename=$(basename $(dirname "${FLAGS_grab_buildbot}"))
|
||||||
local image_base_dir="${FLAGS_top}/src/build/images/${FLAGS_board}"
|
local image_base_dir="${FLAGS_top}/src/build/images/${FLAGS_board}"
|
||||||
local image_dir="${image_base_dir}/${image_basename}"
|
local image_dir="${image_base_dir}/${image_basename}"
|
||||||
echo "Copying in build image to ${image_dir}"
|
echo "Copying in build image to ${image_dir}"
|
||||||
rm -rf "${image_dir}"
|
rm -rf "${image_dir}"
|
||||||
mkdir -p "${image_dir}"
|
mkdir -p "${image_dir}"
|
||||||
# Note that if mbr.image does not exist, this image was not successful.
|
|
||||||
mv mbr.image rootfs.image "${image_dir}"
|
|
||||||
if [[ ${FLAGS_mod_image_for_test} -eq ${FLAGS_TRUE} ]]; then
|
if [[ ${FLAGS_mod_image_for_test} -eq ${FLAGS_TRUE} ]]; then
|
||||||
run_phase "Installing buildbot test modified image" \
|
run_phase "Installing buildbot test modified image" \
|
||||||
mv rootfs_test.image "${image_dir}/rootfs.image"
|
mv chromiumos_test_image.bin "${image_dir}/chromiumos_image.bin"
|
||||||
FLAGS_mod_image_for_test=${FLAGS_FALSE}
|
FLAGS_mod_image_for_test=${FLAGS_FALSE}
|
||||||
if [[ -e "autotest.tgz" || -e "autotest.tar.bz2" ]]; then
|
if [[ -e "autotest.tgz" || -e "autotest.tar.bz2" ]]; then
|
||||||
# pull in autotest
|
# pull in autotest
|
||||||
@ -463,6 +444,8 @@ function grab_buildbot() {
|
|||||||
run_phase "Installing buildbot autotest cross-compiled binaries" \
|
run_phase "Installing buildbot autotest cross-compiled binaries" \
|
||||||
sudo mv autotest ${dir}
|
sudo mv autotest ${dir}
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
mv chromiumos_image.bin "${image_dir}"
|
||||||
fi
|
fi
|
||||||
chdir_relative .
|
chdir_relative .
|
||||||
run_phase "Removing downloaded image" rm -rf "${dl_dir}"
|
run_phase "Removing downloaded image" rm -rf "${dl_dir}"
|
||||||
|
Loading…
Reference in New Issue
Block a user