From: Łukasz Stelmach Date: Thu, 10 Aug 2023 19:41:28 +0000 (+0200) Subject: scripts: Do not complain about using loopback devices X-Git-Tag: accepted/tizen/unified/riscv/20230903.234427~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e470e226670067ef61091c04d8cde9a6fbdf0d9;p=platform%2Fkernel%2Fu-boot.git scripts: Do not complain about using loopback devices Change-Id: Iaf2b561e8ad9f269ba75fbb1f9a5ab6e35f0f081 Signed-off-by: Łukasz Stelmach --- diff --git a/scripts/tizen/sd_fusing_rpi3.sh b/scripts/tizen/sd_fusing_rpi3.sh index 10fb3e756a..a701d0c045 100755 --- a/scripts/tizen/sd_fusing_rpi3.sh +++ b/scripts/tizen/sd_fusing_rpi3.sh @@ -406,9 +406,10 @@ function check_device () { 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 + local LOOPBACK=`lsblk $DEVICE -nd -o TYPE | grep loop | wc -l` + if [ "$REMOVABLE" == "0" -a "$LOOPBACK" = "0" ]; then echo "" - echo -n "$(tput setaf 3)$(tput bold)$DEVICE is not a removable disk, Is it OK? [y/] " + echo -n "$(tput setaf 3)$(tput bold)$DEVICE is neither a removable disk nor a loopback, Is it OK? [y/] " tput sgr 0 read input if [ "$input" != "y" ] && [ "$input" != "Y" ]; then diff --git a/scripts/tizen/sd_fusing_rpi4.sh b/scripts/tizen/sd_fusing_rpi4.sh index 05bd3a5bf7..400df71e5d 100755 --- a/scripts/tizen/sd_fusing_rpi4.sh +++ b/scripts/tizen/sd_fusing_rpi4.sh @@ -513,9 +513,10 @@ function check_device () { DEVICE=/dev/`lsblk $DEVICE -o TYPE,KNAME | awk '/^(disk|loop)/ { print $2 }'` local REMOVABLE=`lsblk $DEVICE -nd -o RM | grep 1 | wc -l` - if [ "$REMOVABLE" == "0" ]; then + local LOOPBACK=`lsblk $DEVICE -nd -o TYPE | grep loop | wc -l` + if [ "$REMOVABLE" == "0" -a "$LOOPBACK" = "0" ]; then echo "" - echo -n "$(tput setaf 3)$(tput bold)$DEVICE is not a removable disk, Is it OK? [y/] " + echo -n "$(tput setaf 3)$(tput bold)$DEVICE is neither a removable disk nor a loopback, Is it OK? [y/] " tput sgr 0 read input if [ "$input" != "y" ] && [ "$input" != "Y" ]; then diff --git a/scripts/tizen/sd_fusing_vf2.sh b/scripts/tizen/sd_fusing_vf2.sh index ccf82e9174..d8c9e06757 100755 --- a/scripts/tizen/sd_fusing_vf2.sh +++ b/scripts/tizen/sd_fusing_vf2.sh @@ -363,9 +363,10 @@ function check_device () { DEVICE=/dev/`lsblk $DEVICE -o TYPE,KNAME | awk '/^(disk|loop)/ { print $2 }'` local REMOVABLE=`lsblk $DEVICE -nd -o RM | grep 1 | wc -l` - if [ "$REMOVABLE" == "0" ]; then + local LOOPBACK=`lsblk $DEVICE -nd -o TYPE | grep loop | wc -l` + if [ "$REMOVABLE" == "0" -a "$LOOPBACK" == "0" ]; then echo "" - echo -n "$(tput setaf 3)$(tput bold)$DEVICE is not a removable disk, Is it OK? [y/] " + echo -n "$(tput setaf 3)$(tput bold)$DEVICE is neither a removable disk nor a loopback, Is it OK? [y/] " tput sgr 0 read input if [ "$input" != "y" ] && [ "$input" != "Y" ]; then