mirror of
https://github.com/linuxboot/heads.git
synced 2025-02-06 11:10:46 +00:00
Merge branch 'usb-scan-gui' of https://github.com/kylerankin/heads
This commit is contained in:
commit
9c95b4ed58
@ -18,6 +18,23 @@ fi
|
|||||||
|
|
||||||
# Check for ISO first
|
# Check for ISO first
|
||||||
get_menu_option() {
|
get_menu_option() {
|
||||||
|
if [ -x /bin/whiptail ]; then
|
||||||
|
MENU_OPTIONS=""
|
||||||
|
n=0
|
||||||
|
while read option
|
||||||
|
do
|
||||||
|
n=`expr $n + 1`
|
||||||
|
option=$(echo $option | tr " " "_")
|
||||||
|
MENU_OPTIONS="$MENU_OPTIONS $n ${option}"
|
||||||
|
done < $TMP_MENU_FILE
|
||||||
|
|
||||||
|
whiptail --clear --title "Select your ISO boot option" \
|
||||||
|
--menu "Choose the ISO boot option [1-$n, s for standard boot, a to abort]:" 20 120 8 \
|
||||||
|
-- $MENU_OPTIONS \
|
||||||
|
2>/tmp/whiptail || die "Aborting boot attempt"
|
||||||
|
|
||||||
|
option_index=$(cat /tmp/whiptail)
|
||||||
|
else
|
||||||
echo "+++ Select your ISO boot option:"
|
echo "+++ Select your ISO boot option:"
|
||||||
n=0
|
n=0
|
||||||
while read option
|
while read option
|
||||||
@ -29,6 +46,7 @@ get_menu_option() {
|
|||||||
read \
|
read \
|
||||||
-p "Choose the ISO boot option [1-$n, s for standard boot, a to abort]: " \
|
-p "Choose the ISO boot option [1-$n, s for standard boot, a to abort]: " \
|
||||||
option_index
|
option_index
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$option_index" = "a" ]; then
|
if [ "$option_index" = "a" ]; then
|
||||||
die "Aborting boot attempt"
|
die "Aborting boot attempt"
|
||||||
@ -62,6 +80,10 @@ fi
|
|||||||
|
|
||||||
echo "!!! Could not find any ISO, trying bootable USB"
|
echo "!!! Could not find any ISO, trying bootable USB"
|
||||||
# Attempt to pull verified config from device
|
# Attempt to pull verified config from device
|
||||||
|
if [ -x /bin/whiptail ]; then
|
||||||
|
kexec-select-boot -b /media -c "*.cfg" -u -g
|
||||||
|
else
|
||||||
kexec-select-boot -b /media -c "*.cfg" -u
|
kexec-select-boot -b /media -c "*.cfg" -u
|
||||||
|
fi
|
||||||
|
|
||||||
die "Something failed in selecting boot"
|
die "Something failed in selecting boot"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user