From b154b37ac8b358f03f37c9cc019abcef4cdb72e1 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Wed, 1 Sep 2010 00:04:25 -0500 Subject: [PATCH] image_to_usb: List available disks when /dev/sdX is specified I'm lazy and sometimes copy and paste the output at the end of build_image verbatim and accidentally include the newline at the end. This gives a more useful output for that case. Change-Id: I1a4abefa884a91cb75dfe2779c79b3ef4b60e807 BUG=none TEST=./image_to_usb --from=../build/images/x86-generic/latest --to=/dev/sdX (and /dev/sde) Review URL: http://codereview.chromium.org/3212012 --- image_to_usb.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/image_to_usb.sh b/image_to_usb.sh index f41ff38719..b83708d447 100755 --- a/image_to_usb.sh +++ b/image_to_usb.sh @@ -19,7 +19,7 @@ get_default_board DEFINE_string board "${DEFAULT_BOARD}" "Board for which the image was built" DEFINE_string from "" \ "Directory containing chromiumos_image.bin" -DEFINE_string to "" "${DEFAULT_TO_HELP}" +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" DEFINE_boolean force_non_usb ${FLAGS_FALSE} \ @@ -81,7 +81,7 @@ if [ ! -d "${FLAGS_from}" ] ; then exit 1 fi -if [ -z "${FLAGS_to}" ]; then +if [ "${FLAGS_to}" == "/dev/sdX" ]; then echo "You must specify a file or device to write to using --to." disks=$(list_usb_disks) if [ -n "$disks" ]; then