From: Łukasz Stelmach Date: Thu, 29 Sep 2022 21:06:15 +0000 (+0200) Subject: scripts: Normalize device name X-Git-Tag: accepted/tizen/unified/20221108.163909~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=393140a2727fb7f6b1400636b9a7420cb93d2744;p=platform%2Fkernel%2Fu-boot.git scripts: Normalize device name Make sure the DEVICE holds the the real name of the block device and not one of symbolic links that can be found in /dev/disk/by-* directories. Change-Id: I8b3416b5de6471a15ef46748d124dbfbf80df156 Signed-off-by: Łukasz Stelmach --- diff --git a/scripts/tizen/sd_fusing_rpi3.sh b/scripts/tizen/sd_fusing_rpi3.sh index 8c2e22715d..ddcd730bde 100755 --- a/scripts/tizen/sd_fusing_rpi3.sh +++ b/scripts/tizen/sd_fusing_rpi3.sh @@ -384,6 +384,8 @@ function check_device () { exit 0 fi + DEVICE=/dev/`lsblk $DEVICE -o TYPE,KNAME | awk "/^disk/ { print \\\$2 }"` + local REMOVABLE=`lsblk $DEVICE -nd -o RM | grep 1 | wc -l` if [ "$REMOVABLE" == "0" ]; then echo "" @@ -403,7 +405,7 @@ function check_device () { function print_logo () { echo "" - echo "Only Raspberry Pi3 downloader, version 2.2.1" + echo "Only Raspberry Pi3 downloader, version 2.2.2" echo "" } diff --git a/scripts/tizen/sd_fusing_rpi4.sh b/scripts/tizen/sd_fusing_rpi4.sh index 3e2c448737..9f7144351a 100755 --- a/scripts/tizen/sd_fusing_rpi4.sh +++ b/scripts/tizen/sd_fusing_rpi4.sh @@ -480,6 +480,8 @@ function check_device () { exit 0 fi + DEVICE=/dev/`lsblk $DEVICE -o TYPE,KNAME | awk "/^disk/ { print \\\$2 }"` + local REMOVABLE=`lsblk $DEVICE -nd -o RM | grep 1 | wc -l` if [ "$REMOVABLE" == "0" ]; then echo "" @@ -499,7 +501,7 @@ function check_device () { function print_logo () { echo "" - echo "Raspberry Pi4 downloader, version 1.0.7" + echo "Raspberry Pi4 downloader, version 1.0.8" echo "" }