scripts: sd_fusing_xu4: check whether block device is valid or not 52/201852/1
authorJaehoon Chung <jh80.chung@samsung.com>
Wed, 20 Mar 2019 06:13:59 +0000 (15:13 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 20 Mar 2019 06:13:59 +0000 (15:13 +0900)
Check whether block device is valid or not.
Refer to previous commit about sd_fusing_rpi3.

Change-Id: Ia2124f8086c91c0309efed26e82e8c2ba5d76883
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
scripts/tizen/sd_fusing_xu4.sh

index 387466817f991f3648136033e65b875cd880677f..8c255762521fa055459c86f23e124acaa86aaf61 100755 (executable)
@@ -310,7 +310,14 @@ function check_args () {
        fi
 
        if [ "$DEVICE" != "" ]; then
-               echo "Device: $DEVICE"
+               if [ -b "$DEVICE" ]; then
+                       echo "Device: $DEVICE"
+               else
+                       echo "Device not found : $DEVICE"
+                       show_usage
+                       tput sgr 0
+                       exit 0
+               fi
        fi
 
        if [ "$FUSING_BINARY_NUM" != 0 ]; then