From b84bef5cd4e74ddd2776d3adff694312d832e53f Mon Sep 17 00:00:00 2001 From: Paul Whalen Date: Jan 22 2018 18:50:44 +0000 Subject: Allow writing image to sda, with warning (BZ#537074) --- diff --git a/arm-image-installer b/arm-image-installer index d1bc5a8..006fff1 100755 --- a/arm-image-installer +++ b/arm-image-installer @@ -145,8 +145,19 @@ if [ "$MEDIA" = "" ]; then fi if [ "$MEDIA" = "/dev/sda" ]; then - echo " == NOTE: For user protection, this script will not run on sda." - exit 1 + echo "" + echo " ***********************************************************" + echo " ** WARNING: You have requested the image be written to sda." + echo " ** /dev/sda is usually the root filesystem of the host. " + echo " ***********************************************************" + echo " ** Do you wish to continue? (type 'yes' to continue)" + echo " ***********************************************************" + # wait for agreement + read -p " = Continue? " AGREE + if [ "$(echo ${AGREE} | tr [:lower:] [:upper:])" != "YES" ]; then + echo "User exit, no image written." + exit 0 + fi fi # change cubietruck target to uppercase