From a7536efa24266266fccfa796465720da421fcbb6 Mon Sep 17 00:00:00 2001 From: Gilad Arnold Date: Wed, 20 Jun 2012 18:43:39 -0700 Subject: [PATCH] Temporarily reinstate support for --to=/dev/sdX This is part of some user's workflow and should be deprecated with proper advance notice. - Added a deprecation warning when --to=/dev/sdX is used in image_to_usb.sh. - Removed mention of /dev/sdX from the output of build_image. Also simplified this output a bit (it should be obvious to a user who just invoked build_image that the other scripts should be invoked similarly, from inside the chroot's scripts directory). BUG=chromium-os:32023 TEST=Invoked image_to_usb.sh with different --to values Change-Id: Ib93d1b55f425b0978c4a9680be7755ae031c46e6 Reviewed-on: https://gerrit.chromium.org/gerrit/25819 Reviewed-by: Olof Johansson Tested-by: Gilad Arnold Commit-Ready: Gilad Arnold --- build_image | 11 ++++++----- image_to_usb.sh | 9 +++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/build_image b/build_image index 32fcccc377..581186edc3 100755 --- a/build_image +++ b/build_image @@ -282,8 +282,9 @@ fi print_time_elapsed -echo "To copy to USB keyfob, do something like:" -echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdX" -echo "To convert to VMWare image, INSIDE the chroot, do something like:" -echo " ./image_to_vm.sh --from=${OUTSIDE_OUTPUT_DIR} --board=${BOARD}" -echo "from the scripts directory where you entered the chroot." +cat << EOF +To copy the image to a USB key, use: + ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} +To convert it to a VMWare image, use: + ./image_to_vm.sh --from=${OUTSIDE_OUTPUT_DIR} --board=${BOARD} +EOF diff --git a/image_to_usb.sh b/image_to_usb.sh index fba9510bec..7d61545744 100755 --- a/image_to_usb.sh +++ b/image_to_usb.sh @@ -145,6 +145,15 @@ if [ ! -d "${FLAGS_from}" ] ; then die_notrace "Cannot find image directory ${FLAGS_from}" fi +# TODO(garnold) This code reinstates the previous default value for --to, which +# some users relied upon to trigger target device auto-detection. It should be +# removed once we're sure that all users have adapted to simply not specifying +# --to. The instructions emitted by build_image were changed accordingly. +if [ "${FLAGS_to}" == "/dev/sdX" ]; then + warn "the use of --to=/dev/sdX is deprecated, just omit --to instead" + FLAGS_to="" +fi + # No target provided, attempt autodetection. if [ -z "${FLAGS_to}" ]; then if [ ${FLAGS_yes} -eq ${FLAGS_TRUE} ]; then