mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-11 15:06: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."
|
"Additional command line options to pass to the ARM kernel."
|
||||||
DEFINE_boolean recovery $FLAGS_FALSE \
|
DEFINE_boolean recovery $FLAGS_FALSE \
|
||||||
"Build GPT for a recovery image. Default: False."
|
"Build GPT for a recovery image. Default: False."
|
||||||
|
DEFINE_integer rootfs_partition_size 1024 \
|
||||||
|
"rootfs parition size in MBs."
|
||||||
|
|
||||||
# Usage.
|
# Usage.
|
||||||
FLAGS_HELP=$(cat <<EOF
|
FLAGS_HELP=$(cat <<EOF
|
||||||
@ -115,7 +117,7 @@ fi
|
|||||||
# Create the GPT. This has the side-effect of setting some global vars
|
# Create the GPT. This has the side-effect of setting some global vars
|
||||||
# describing the partition table entries (see the comments in the source).
|
# describing the partition table entries (see the comments in the source).
|
||||||
install_gpt $OUTDEV $ROOTFS_IMG $KERNEL_IMG $STATEFUL_IMG $PMBRCODE $ESP_IMG \
|
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
|
if [[ "$ARCH" = "arm" ]]; then
|
||||||
# assume /dev/mmcblk1. we could not get this from ${OUTDEV}
|
# 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."
|
"Additional command line options to pass to the ARM kernel."
|
||||||
DEFINE_boolean recovery $FLAGS_FALSE \
|
DEFINE_boolean recovery $FLAGS_FALSE \
|
||||||
"Build a recovery image. Default: 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.
|
# Parse command line.
|
||||||
FLAGS "$@" || exit 1
|
FLAGS "$@" || exit 1
|
||||||
@ -60,6 +64,11 @@ if [ -z "$FLAGS_board" ] ; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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.
|
# Determine build version.
|
||||||
. "${SCRIPTS_DIR}/chromeos_version.sh"
|
. "${SCRIPTS_DIR}/chromeos_version.sh"
|
||||||
|
|
||||||
@ -274,7 +283,7 @@ fi
|
|||||||
if [[ $FLAGS_factory_install -eq ${FLAGS_TRUE} ]] ; then
|
if [[ $FLAGS_factory_install -eq ${FLAGS_TRUE} ]] ; then
|
||||||
ROOT_SIZE_BYTES=$((1024 * 1024 * 300))
|
ROOT_SIZE_BYTES=$((1024 * 1024 * 300))
|
||||||
else
|
else
|
||||||
ROOT_SIZE_BYTES=$((1024 * 1024 * 720))
|
ROOT_SIZE_BYTES=$((1024 * 1024 * ${FLAGS_rootfs_size}))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dd if=/dev/zero of="$ROOT_FS_IMG" bs=1 count=1 seek=$((ROOT_SIZE_BYTES - 1))
|
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} \
|
--arch=${ARCH} \
|
||||||
--board=${FLAGS_board} \
|
--board=${FLAGS_board} \
|
||||||
--arm_extra_bootargs="${FLAGS_arm_extra_bootargs}" \
|
--arm_extra_bootargs="${FLAGS_arm_extra_bootargs}" \
|
||||||
|
--rootfs_partition_size=${FLAGS_rootfs_partition_size} \
|
||||||
${RECOVERY} \
|
${RECOVERY} \
|
||||||
"${OUTPUT_DIR}" \
|
"${OUTPUT_DIR}" \
|
||||||
"${OUTPUT_IMG}"
|
"${OUTPUT_IMG}"
|
||||||
|
Loading…
Reference in New Issue
Block a user