From d1679ab8645b3d8a202d81ddb1a18bd5104f725e Mon Sep 17 00:00:00 2001 From: David James Date: Sun, 4 Sep 2011 16:15:12 -0700 Subject: [PATCH] Don't hardcode output directories in boot.desc. Right now, output directories are hardcoded in boot.desc. This means that cros_make_image_bootable will still write to the directories mentioned in build_image, even if it's working on a different directory. This can mess with the buildbot, because it can cause cros_make_image_bootable to mess with the files created for existing images. This change fixes flaky failures where the buildbot fails with warnings stating that vmlinuz_hd.vblock does not exist. See bug 19956. BUG=chromium-os:19956 TEST=Run full canary trybot run and verify cros_make_image_bootable uses files from the right directory now. Change-Id: Ib390aa84570b077cbc8b69b757998056acc091ea Reviewed-on: http://gerrit.chromium.org/gerrit/7282 Reviewed-by: Will Drewry Tested-by: David James --- bin/cros_make_image_bootable | 15 ++++++--------- build_library/build_image_util.sh | 5 ----- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/bin/cros_make_image_bootable b/bin/cros_make_image_bootable index 6c59f05d05..66703311b5 100755 --- a/bin/cros_make_image_bootable +++ b/bin/cros_make_image_bootable @@ -324,15 +324,12 @@ verify_image_rootfs() { command line parameters are correct" } -# Use default of current image location if the output dir doesn't exist. -if [ ! -d ${FLAGS_output_dir} ]; then - warn "Output dir not found, using ${IMAGE_DIR}." - FLAGS_output_dir="${IMAGE_DIR}" - FLAGS_rootfs_hash="${IMAGE_DIR}/rootfs.hash" - FLAGS_rootfs_mountpoint="${IMAGE_DIR}/rootfs_dir" - FLAGS_statefulfs_mountpoint="${IMAGE_DIR}/stateful_dir" - FLAGS_espfs_mountpoint="${IMAGE_DIR}/esp" -fi +# Store output and temporary files next to image. +FLAGS_output_dir="${IMAGE_DIR}" +FLAGS_rootfs_hash="${IMAGE_DIR}/rootfs.hash" +FLAGS_rootfs_mountpoint="${IMAGE_DIR}/rootfs_dir" +FLAGS_statefulfs_mountpoint="${IMAGE_DIR}/stateful_dir" +FLAGS_espfs_mountpoint="${IMAGE_DIR}/esp" # Create the directories if they don't exist. mkdir -p ${FLAGS_rootfs_mountpoint} diff --git a/build_library/build_image_util.sh b/build_library/build_image_util.sh index 48eb8f4c2d..5ac55ea625 100755 --- a/build_library/build_image_util.sh +++ b/build_library/build_image_util.sh @@ -43,14 +43,9 @@ create_boot_desc() { cat < ${OUTPUT_DIR}/boot.desc --arch="${ARCH}" - --output_dir="${OUTPUT_DIR}" --boot_args="${FLAGS_boot_args}" --rootfs_size="${FLAGS_rootfs_size}" --rootfs_hash_pad="${FLAGS_rootfs_hash_pad}" - --rootfs_hash="${OUTPUT_DIR}/rootfs.hash" - --rootfs_mountpoint="${ROOT_FS_DIR}" - --statefulfs_mountpoint="${STATEFUL_FS_DIR}" - --espfs_mountpoint="${ESP_FS_DIR}" --verity_error_behavior="${FLAGS_verity_error_behavior}" --verity_max_ios="${FLAGS_verity_max_ios}" --verity_algorithm="${FLAGS_verity_algorithm}"