build: Get rid of scary /dev/sdb defaults in scripts.

Choosing a default device is no good; the user should
tell us where the image should be written.

BUG=none
TEST=wrote an image

Review URL: http://codereview.chromium.org/1730012
This commit is contained in:
Daniel Erat 2010-04-26 09:16:44 -07:00
parent 89b029c7c0
commit dd9818aaad
2 changed files with 6 additions and 16 deletions

View File

@ -432,7 +432,7 @@ rmdir "${ROOT_FS_DIR}" "${STATEFUL_DIR}" "${ESP_DIR}"
OUTSIDE_OUTPUT_DIR="../build/images/${FLAGS_board}/${IMAGE_SUBDIR}"
echo "Done. Image created in ${OUTPUT_DIR}"
echo "To copy to USB keyfob, OUTSIDE the chroot, do something like:"
echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdb"
echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX"
echo "To convert to VMWare image, OUTSIDE the chroot, do something like:"
echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}"
echo "from the scripts directory where you entered the chroot."

View File

@ -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}")