mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-20 05:28:08 +00:00
media-scan: Fix up whiptail prompt, remove errant "s for standard boot"
The whiptail prompt text was copied from the 'read' prompt but did not actually have the Abort option. Add it. The "s for standard boot" option was missing from whiptail. For plain 'read' it does not appear to revert to a normal boot, it actually went on to try plain bootable USB on the same medium. It's not realistic for a disk to be both directly bootable and contain ISOs, and this option does not appear to have been missed since it was missing from the whiptail/fbwhiptail version, which almost all boards use. Remove it. Handle canceling fbwhiptail with esc-esc the same as Abort. Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
This commit is contained in:
parent
09f66e93df
commit
0378d62d49
@ -42,8 +42,10 @@ get_menu_option() {
|
||||
MENU_OPTIONS="$MENU_OPTIONS $n ${option}"
|
||||
done < /tmp/iso_menu.txt
|
||||
|
||||
MENU_OPTIONS="$MENU_OPTIONS a Abort"
|
||||
|
||||
whiptail $BG_COLOR_MAIN_MENU --title "Select your ISO boot option" \
|
||||
--menu "Choose the ISO boot option [1-$n, s for standard boot, a to abort]:" 0 80 8 \
|
||||
--menu "Choose the ISO boot option [1-$n]:" 0 80 8 \
|
||||
-- $MENU_OPTIONS \
|
||||
2>/tmp/whiptail || die "Aborting boot attempt"
|
||||
|
||||
@ -58,19 +60,15 @@ get_menu_option() {
|
||||
done < /tmp/iso_menu.txt
|
||||
|
||||
read \
|
||||
-p "Choose the ISO boot option [1-$n, s for standard boot, a to abort]: " \
|
||||
-p "Choose the ISO boot option [1-$n, a to abort]: " \
|
||||
option_index
|
||||
fi
|
||||
|
||||
if [ "$option_index" = "a" ]; then
|
||||
# Empty occurs when aborting fbwhiptail with esc-esc
|
||||
if [ -z "$option_index" ] || [ "$option_index" = "a" ]; then
|
||||
die "Aborting boot attempt"
|
||||
fi
|
||||
|
||||
if [ "$option_index" = "s" ]; then
|
||||
option=""
|
||||
return
|
||||
fi
|
||||
|
||||
option=`head -n $option_index /tmp/iso_menu.txt | tail -1`
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user