From 43b50788c617f80fc1952b687c0b9674d12f1c8a Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Thu, 23 Sep 2021 13:07:07 -0500 Subject: [PATCH] config-gui: Show error if no disks found Currently, if no disks on system, selection of a new /boot device will silently fail and simply return the user to the previous screen. Add an error dialog if no disks found. Signed-off-by: Matt DeVillier --- initrd/bin/config-gui.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/initrd/bin/config-gui.sh b/initrd/bin/config-gui.sh index 3eb9a356..a93a1a76 100755 --- a/initrd/bin/config-gui.sh +++ b/initrd/bin/config-gui.sh @@ -31,7 +31,11 @@ while true; do ;; "b" ) CURRENT_OPTION=`grep 'CONFIG_BOOT_DEV=' /tmp/config | tail -n1 | cut -f2 -d '=' | tr -d '"'` - fdisk -l | grep "Disk" | cut -f2 -d " " | cut -f1 -d ":" > /tmp/disklist.txt + if ! fdisk -l | grep "Disk" | cut -f2 -d " " | cut -f1 -d ":" > /tmp/disklist.txt ; then + whiptail $BG_COLOR_ERROR --title 'ERROR: No bootable devices found' \ + --msgbox " $ERROR\n\n" 16 60 + exit 1 + fi # filter out extraneous options > /tmp/boot_device_list.txt for i in `cat /tmp/disklist.txt`; do