From 0cc06c9c5ca2017ee096ed29ca2b33bb1c423cd6 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Sat, 30 Aug 2014 16:39:05 -0700 Subject: [PATCH] build_image_util: pass the disk image through to configure_bootloaders Required so that configure_bootloaders can now handle installing the bootloaders as well. --- build_library/build_image_util.sh | 10 +++++++--- build_library/configure_bootloaders.sh | 1 + build_library/dev_image_util.sh | 2 +- build_library/prod_image_util.sh | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/build_library/build_image_util.sh b/build_library/build_image_util.sh index 85d4076843..c275fc6ceb 100755 --- a/build_library/build_image_util.sh +++ b/build_library/build_image_util.sh @@ -186,9 +186,12 @@ start_image() { } finish_image() { - local disk_layout="$1" - local root_fs_dir="$2" - local image_contents="$3" + local image_name="$1" + local disk_layout="$2" + local root_fs_dir="$3" + local image_contents="$4" + + local disk_img="${BUILD_DIR}/${image_name}" # Record directories installed to the state partition. # Explicitly ignore entries covered by existing configs. @@ -206,6 +209,7 @@ finish_image() { ${BUILD_LIBRARY_DIR}/configure_bootloaders.sh \ --arch=${ARCH} \ --disk_layout="${disk_layout}" \ + --disk_image="${disk_img}" \ --boot_dir="${root_fs_dir}"/usr/boot \ --esp_dir="${root_fs_dir}"/boot \ --boot_args="${FLAGS_boot_args}" diff --git a/build_library/configure_bootloaders.sh b/build_library/configure_bootloaders.sh index 77d5b05758..f3f5bf35dc 100755 --- a/build_library/configure_bootloaders.sh +++ b/build_library/configure_bootloaders.sh @@ -24,6 +24,7 @@ DEFINE_string boot_args "" \ "Additional boot arguments to pass to the commandline (Default: '')" DEFINE_string disk_layout "base" \ "The disk layout type to use for this image." +DEFINE_string disk_image "" "The disk image." # Parse flags FLAGS "$@" || exit 1 diff --git a/build_library/dev_image_util.sh b/build_library/dev_image_util.sh index 84fd5e6b0a..daf2b4a0fc 100755 --- a/build_library/dev_image_util.sh +++ b/build_library/dev_image_util.sh @@ -112,7 +112,7 @@ EOF # The remount services are provided by coreos-base/coreos-init systemd_enable "${root_fs_dir}" "multi-user.target" "remount-usr.service" - finish_image "${disk_layout}" "${root_fs_dir}" "${image_contents}" + finish_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${image_contents}" upload_image -d "${BUILD_DIR}/${image_name}.bz2.DIGESTS" \ "${BUILD_DIR}/${image_contents}" \ "${BUILD_DIR}/${image_packages}" \ diff --git a/build_library/prod_image_util.sh b/build_library/prod_image_util.sh index 331236afff..dca9f503d2 100755 --- a/build_library/prod_image_util.sh +++ b/build_library/prod_image_util.sh @@ -81,7 +81,7 @@ EOF disable_read_write=${FLAGS_FALSE} fi - finish_image "${disk_layout}" "${root_fs_dir}" "${image_contents}" + finish_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${image_contents}" # Make the filesystem un-mountable as read-write. if [[ ${disable_read_write} -eq ${FLAGS_TRUE} ]]; then