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

Unified Diff: src/scripts/image_to_usb.sh

Issue 1730012: build: Get rid of scary /dev/sdb defaults in scripts. (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: Created 10 years, 8 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 | « src/scripts/build_image ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scripts/image_to_usb.sh
diff --git a/src/scripts/image_to_usb.sh b/src/scripts/image_to_usb.sh
index e489f730aae7756a87bc98749b6890745a7933d1..69d7ba465d93975140b585f8c4d4546841d16820 100755
--- a/src/scripts/image_to_usb.sh
+++ b/src/scripts/image_to_usb.sh
@@ -77,19 +77,9 @@ if [ ! -d "${FLAGS_from}" ] ; then
exit 1
fi
-# If to isn't explicitly set
if [ -z "${FLAGS_to}" ]; then
- # Script can be run either inside or outside the chroot.
- if [ ${INSIDE_CHROOT} -eq 1 ]
- then
- # Inside the chroot, we'll only output to a file, and we probably already
- # have a valid image. Make the user specify a filename.
- echo "ERROR: Inside the chroot, you must specify a --to FILE to create."
- exit 1
- else
- # Outside the chroot, so output to the default device for a usb key.
- FLAGS_to="/dev/sdb"
- fi
+ echo "You must specify a file or device to write to using --to."
+ exit 1
fi
# Convert args to paths. Need eval to un-quote the string so that shell
@@ -233,9 +223,9 @@ else
echo "Copying ${SRC_IMAGE} to ${FLAGS_to}..."
cp -f "${SRC_IMAGE}" "${FLAGS_to}"
- echo "Done. To copy to USB keyfob, outside the chroot, do something like:"
- echo " sudo dd if=${FLAGS_to} of=/dev/sdb bs=4M"
- echo "where /dev/sdb is the entire keyfob."
+ echo "Done. To copy to a USB drive, outside the chroot, do something like:"
+ echo " sudo dd if=${FLAGS_to} of=/dev/sdX bs=4M"
+ echo "where /dev/sdX is the entire drive."
if [ ${INSIDE_CHROOT} -eq 1 ]
then
example=$(basename "${FLAGS_to}")
« no previous file with comments | « src/scripts/build_image ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698