mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-11 06:56:58 +02:00
RootFS size customization params added
Review URL: http://codereview.chromium.org/2440005
This commit is contained in:
parent
b227081ef5
commit
1d12c1a01d
@ -25,6 +25,8 @@ DEFINE_string arm_extra_bootargs "" \
|
||||
"Additional command line options to pass to the ARM kernel."
|
||||
DEFINE_boolean recovery $FLAGS_FALSE \
|
||||
"Build GPT for a recovery image. Default: False."
|
||||
DEFINE_integer rootfs_partition_size 1024 \
|
||||
"rootfs parition size in MBs."
|
||||
|
||||
# Usage.
|
||||
FLAGS_HELP=$(cat <<EOF
|
||||
@ -115,7 +117,7 @@ fi
|
||||
# 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 $ROOTFS_IMG $KERNEL_IMG $STATEFUL_IMG $PMBRCODE $ESP_IMG \
|
||||
false $FLAGS_recovery
|
||||
false $FLAGS_recovery $FLAGS_rootfs_partition_size
|
||||
|
||||
if [[ "$ARCH" = "arm" ]]; then
|
||||
# assume /dev/mmcblk1. we could not get this from ${OUTDEV}
|
||||
|
12
build_image
12
build_image
@ -46,6 +46,10 @@ DEFINE_string arm_extra_bootargs "" \
|
||||
"Additional command line options to pass to the ARM kernel."
|
||||
DEFINE_boolean recovery $FLAGS_FALSE \
|
||||
"Build a recovery image. Default: False."
|
||||
DEFINE_integer rootfs_partition_size 1024 \
|
||||
"rootfs parition size in MBs."
|
||||
DEFINE_integer rootfs_size 720 \
|
||||
"rootfs filesystem size in MBs."
|
||||
|
||||
# Parse command line.
|
||||
FLAGS "$@" || exit 1
|
||||
@ -60,6 +64,11 @@ if [ -z "$FLAGS_board" ] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$FLAGS_rootfs_size" -gt "$FLAGS_rootfs_partition_size" ] ; then
|
||||
error "rootfs (${FLAGS_rootfs_size} MB) is bigger than partition (${FLAGS_rootfs_partition_size} MB)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Determine build version.
|
||||
. "${SCRIPTS_DIR}/chromeos_version.sh"
|
||||
|
||||
@ -274,7 +283,7 @@ fi
|
||||
if [[ $FLAGS_factory_install -eq ${FLAGS_TRUE} ]] ; then
|
||||
ROOT_SIZE_BYTES=$((1024 * 1024 * 300))
|
||||
else
|
||||
ROOT_SIZE_BYTES=$((1024 * 1024 * 720))
|
||||
ROOT_SIZE_BYTES=$((1024 * 1024 * ${FLAGS_rootfs_size}))
|
||||
fi
|
||||
|
||||
dd if=/dev/zero of="$ROOT_FS_IMG" bs=1 count=1 seek=$((ROOT_SIZE_BYTES - 1))
|
||||
@ -497,6 +506,7 @@ ${SCRIPTS_DIR}/build_gpt.sh \
|
||||
--arch=${ARCH} \
|
||||
--board=${FLAGS_board} \
|
||||
--arm_extra_bootargs="${FLAGS_arm_extra_bootargs}" \
|
||||
--rootfs_partition_size=${FLAGS_rootfs_partition_size} \
|
||||
${RECOVERY} \
|
||||
"${OUTPUT_DIR}" \
|
||||
"${OUTPUT_IMG}"
|
||||
|
Loading…
Reference in New Issue
Block a user