mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-10 06:26:57 +02:00
Add a flag to build_image that provisions both root partitions
BUG=none TEST=Run build_image with --full, verify two roots are provisioned Change-Id: I3a90cd18a7546519733bbf6ba51c9ad03e19e2ca Reviewed-on: https://gerrit.chromium.org/gerrit/27432 Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org> Tested-by: Liam McLoughlin <lmcloughlin@chromium.org> Commit-Ready: Liam McLoughlin <lmcloughlin@chromium.org>
This commit is contained in:
parent
0f21504982
commit
8afcdcd1a6
@ -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 \
|
||||
|
@ -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}" \
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user