From 71d89e856da2d56fa56822885a30149f7d2ee420 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Sat, 8 Apr 2017 07:09:58 +0200 Subject: [PATCH] Bugfix and error supprerssion --- .../usr/lib/nand-sata-install/nand-sata-install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/nand-sata-install/usr/lib/nand-sata-install/nand-sata-install.sh b/scripts/nand-sata-install/usr/lib/nand-sata-install/nand-sata-install.sh index 6ec92d9ccf89..3518e048f5ba 100644 --- a/scripts/nand-sata-install/usr/lib/nand-sata-install/nand-sata-install.sh +++ b/scripts/nand-sata-install/usr/lib/nand-sata-install/nand-sata-install.sh @@ -35,7 +35,7 @@ root_partition=$(cat /proc/cmdline | sed -e 's/^.*root=//' -e 's/ .*$//') root_partition_device=$(blkid | tr -d '":' | grep $( cat /proc/cmdline | sed -e 's/^.*root=//' -e 's/ .*$//') | awk '{print $1}'| rev | cut -c3- | rev) # find targets: NAND, EMMC, SATA -nandcheck=$(ls -d -1 /dev/nand* | grep -w 'nand' | awk '{print $NF}'); +[[ -b /dev/nand ]] && nandcheck=$(ls -d -1 /dev/nand* | grep -w 'nand' | awk '{print $NF}'); emmccheck=$(ls -d -1 /dev/mmcblk* | grep -w 'mmcblk[0-9]' | grep -v "$root_partition_device"); satacheck=$(cat /proc/partitions | grep 'sd' | awk '{print $NF}') @@ -447,7 +447,6 @@ main() [[ ${#options[@]} -eq 0 || "$root_partition" == "$emmcuuid" || "$root_partition" == "/dev/nand2" ]] && \ dialog --title "$title" --backtitle "$backtitle" --colors --no-collapse --msgbox "\n\Z1There are no targets. Please check your drives.\Zn" 7 54 - [[ $? -ne 0 ]] && exit 1 cmd=(dialog --title "Choose an option:" --backtitle "$backtitle" --menu "\nCurrent root: $root_partition \n \n" 12 60 7) choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty) [[ $? -ne 0 ]] && exit 1