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

Unified Diff: image_to_usb.sh

Issue 6685101: Allow file in --from arg (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: comments Created 9 years, 9 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 | mount_gpt_image.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: image_to_usb.sh
diff --git a/image_to_usb.sh b/image_to_usb.sh
index e957e2f3724a03d3995640ba248fe8f981474ca4..e0c251e539fe277b6926a00c14c443170d11d9d5 100755
--- a/image_to_usb.sh
+++ b/image_to_usb.sh
@@ -40,7 +40,7 @@ get_default_board
# Flags
DEFINE_string board "${DEFAULT_BOARD}" "Board for which the image was built"
DEFINE_string from "" \
- "Directory containing ${CHROMEOS_IMAGE_NAME}"
+ "Directory containing ${CHROMEOS_IMAGE_NAME}, or filename"
DEFINE_string to "/dev/sdX" "${DEFAULT_TO_HELP}"
DEFINE_boolean yes ${FLAGS_FALSE} "Answer yes to all prompts" "y"
DEFINE_boolean force_copy ${FLAGS_FALSE} "Always rebuild test image"
@@ -72,6 +72,15 @@ if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ] ; then
fi
fi
+# Allow --from /foo/file.bin
+if [ -f "${FLAGS_from}" ]; then
+ pathname=$(dirname "${FLAGS_from}")
+ filename=$(basename "${FLAGS_from}")
+ FLAGS_image_name="${filename}"
+ FLAGS_from="${pathname}"
+fi
+
+
# Require autotest for manucaturing image.
if [ ${FLAGS_factory} -eq ${FLAGS_TRUE} ] ; then
echo "Factory image requires --test_image, setting."
« no previous file with comments | « no previous file | mount_gpt_image.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698