From 1be4eb930732a6a961d5102a24a9acdad5dc471b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Stelmach?= Date: Thu, 29 Sep 2022 23:06:15 +0200 Subject: [PATCH] scripts: Normalize device name MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- scripts/tizen/sd_fusing_rpi3.sh | 4 +++- scripts/tizen/sd_fusing_rpi4.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/tizen/sd_fusing_rpi3.sh b/scripts/tizen/sd_fusing_rpi3.sh index 8c2e227..ddcd730 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 3e2c448..9f71443 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 "" } -- 2.7.4