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." |