diff --git a/build_image b/build_image index 2779fc064d..c6319b94db 100755 --- a/build_image +++ b/build_image @@ -20,6 +20,7 @@ DEFINE_string boot_args "noinitrd" \ "Additional boot arguments to pass to the commandline" DEFINE_boolean enable_rootfs_verification ${FLAGS_TRUE} \ "Default all bootloaders to use kernel-based root fs integrity checking." +DEFINE_boolean full "${FLAGS_FALSE}" "Build full image with all partitions." DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \ "Directory in which to place image result directories (named by version)" DEFINE_integer rootfs_hash_pad 8 \ diff --git a/build_library/base_image_util.sh b/build_library/base_image_util.sh index a259b69f3b..b2fd6cd3ac 100755 --- a/build_library/base_image_util.sh +++ b/build_library/base_image_util.sh @@ -221,6 +221,10 @@ create_base_image() { loopback_cleanup trap delete_prompt EXIT + if [[ ${FLAGS_full} -eq ${FLAGS_TRUE} ]]; then + dd if=/dev/zero of="${BUILD_DIR}/${image_name}" bs=1M count=3584 + fi + # Create the GPT-formatted image. build_gpt "${BUILD_DIR}/${image_name}" \ "${ROOT_FS_IMG}" \ diff --git a/build_library/build_gpt.sh b/build_library/build_gpt.sh index 18b515bdb7..74285d376b 100755 --- a/build_library/build_gpt.sh +++ b/build_library/build_gpt.sh @@ -54,11 +54,14 @@ build_gpt() { return 1 fi + GPT_FULL="false" + [ "${FLAGS_full}" -eq "${FLAGS_TRUE}" ] && GPT_FULL="true" + # Create the GPT. This has the side-effect of setting some global vars # describing the partition table entries (see the comments in the source). install_gpt "$outdev" $(numsectors "$rootfs_img") \ $(numsectors "$stateful_img") $pmbr_img $(numsectors "$esp_img") \ - false $FLAGS_rootfs_partition_size + $GPT_FULL $FLAGS_rootfs_partition_size local sudo= if [ ! -w "$outdev" ] ; then