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

Unified Diff: bin/cros_make_image_bootable

Issue 3189018: Clean up cros_make_image_bootable and image_to_vm (Closed) Base URL: http://src.chromium.org/git/crosutils.git
Patch Set: make sure unverified syslinux gets the root updated too Created 10 years, 4 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 | « no previous file | image_to_vm.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/cros_make_image_bootable
diff --git a/bin/cros_make_image_bootable b/bin/cros_make_image_bootable
index 6a471865d9cfcc84e9994ed5f1b8ba4ae3b10ea1..a3ff3b2c758f0b5fcf5c10247f03c86859bb5bfb 100755
--- a/bin/cros_make_image_bootable
+++ b/bin/cros_make_image_bootable
@@ -19,12 +19,20 @@ fi
set -e
. "$(dirname "$0")/../chromeos-common.sh" # for partoffset and partsize
+if [ $# -lt 2 ]; then
+ echo "Usage: ${0} /PATH/TO/IMAGE IMAGE.BIN [shflags overrides]"
+ exit 1
+fi
+
BOOT_DESC_FILE="${1}/boot.desc"
IMAGE="${1}/${2}"
+shift
+shift
+FLAG_OVERRIDES="${@}"
if [ ! -r "${BOOT_DESC_FILE}" ]; then
- warning "${BOOT_DESC_FILE} cannot be read!"
- warning "Falling back to command line parsing"
+ warn "${BOOT_DESC_FILE} cannot be read!"
+ warn "Falling back to command line parsing"
BOOT_DESC="${@}"
else
BOOT_DESC="$(cat ${BOOT_DESC_FILE} | tr -s '\n' ' ')"
@@ -92,12 +100,8 @@ DEFINE_string espfs_mountpoint "/tmp/espfs" \
DEFINE_boolean use_dev_keys ${FLAGS_FALSE} \
"Use developer keys for signing. (Default: false)"
-# Parse command-line flags present after positional args, if any. This needs
-# to happen before we parse boot.desc (otherwise the flags would be lost)
-FLAGS "${@}" || exit 1
-
-# Parse the boot.desc
-eval set -- "${BOOT_DESC}"
+# Parse the boot.desc and any overrides
+eval set -- "${BOOT_DESC} ${FLAG_OVERRIDES}"
FLAGS "${@}" || exit 1
# Only now can we die on error. shflags functions leak non-zero error codes,
« no previous file with comments | « no previous file | image_to_vm.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698