Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(787)

Unified Diff: src/scripts/build_image

Issue 2440005: RootFS size customization params added (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: added check for rootfs size and its partition Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/scripts/build_gpt.sh ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scripts/build_image
diff --git a/src/scripts/build_image b/src/scripts/build_image
index 17afa28d2e5d5a33c13dc4e2430ec09d7e401de8..4d05786608181c5e2010e8b5b558341d39a7b7e5 100755
--- a/src/scripts/build_image
+++ b/src/scripts/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}"
« no previous file with comments | « src/scripts/build_gpt.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698