From 4515028a2d024f71f2f30161549d3107f404ebc4 Mon Sep 17 00:00:00 2001 From: Tan Gao Date: Wed, 25 Aug 2010 12:51:07 -0700 Subject: [PATCH] Issue 5871: support user-specified output image name in mod_image_for_recovery.sh Change-Id: Ibd1990747d20b3f11a8bf9d5b558405067589d0e BUG=chromium-os:5871 TEST=manually ran the script with and without --output flag and verified output image took default name and user-specified name, respectively Review URL: http://codereview.chromium.org/3155042 --- mod_image_for_recovery.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mod_image_for_recovery.sh b/mod_image_for_recovery.sh index 4305f38e0a..6acf46daa8 100755 --- a/mod_image_for_recovery.sh +++ b/mod_image_for_recovery.sh @@ -16,8 +16,12 @@ restart_in_chroot_if_needed $* get_default_board +RECOVERY_IMAGE="recovery_image.bin" + DEFINE_string board "$DEFAULT_BOARD" "Board for which the image was built" DEFINE_string image "" "Location of the rootfs raw image file" +DEFINE_string output "${RECOVERY_IMAGE}" \ + "(optional) output image name. Default: ${RECOVERY_IMAGE}" # Parse command line FLAGS "$@" || exit 1 @@ -50,7 +54,6 @@ set -e # Constants IMAGE_DIR="$(dirname "$FLAGS_image")" IMAGE_NAME="$(basename "$FLAGS_image")" -RECOVERY_IMAGE="recovery_image.bin" # loop device utility methods mostly duplicated from # src/platform/installer/chromeos-install @@ -112,7 +115,7 @@ update_recovery_packages() { # Main -DST_PATH="${IMAGE_DIR}/${RECOVERY_IMAGE}" +DST_PATH="${IMAGE_DIR}/${FLAGS_output}" echo "Making a copy of original image ${FLAGS_image}" cp $FLAGS_image $DST_PATH update_recovery_packages $DST_PATH