scripts: sd_fusing_rpi3: check whether block device is valid or not 50/201750/1
authorJaehoon Chung <jh80.chung@samsung.com>
Tue, 19 Mar 2019 06:47:06 +0000 (15:47 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 19 Mar 2019 07:10:26 +0000 (16:10 +0900)
Check whether block devic is valid or not.
If try to update the image without block device, it will make just
device image.

e.g)sudo ./sd_fusing_rpi3.sh -d /dev/sdf -b kernel.tar
- then it's maken kernel image as /dev/sdf. it's not real block device.

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

index 2f262bf4c76a8140cfc79e2d02acb65c262bacb7..d0e4582e07a31c4f57a5ee8baea7defcbf7dd055 100755 (executable)
@@ -267,7 +267,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