mirror of
https://github.com/linuxboot/heads.git
synced 2025-04-12 21:53:03 +00:00
media-scan: Simplify implementation and improve RB message
Since 'standard boot' was removed, empty "$option" only occurs due to error now. Die with a specific error. Now, we only proceed past ISO boot if no ISOs were present, meaning the disk might be a plain bootable medium. Present a specific error for restricted boot in that case. Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
This commit is contained in:
parent
0378d62d49
commit
09d8bf9930
@ -70,6 +70,10 @@ get_menu_option() {
|
||||
fi
|
||||
|
||||
option=`head -n $option_index /tmp/iso_menu.txt | tail -1`
|
||||
|
||||
if [ -z "$option" ]; then
|
||||
die "Failed to find menu option $option_index"
|
||||
fi
|
||||
}
|
||||
|
||||
# create ISO menu options
|
||||
@ -81,17 +85,17 @@ if [ `cat /tmp/iso_menu.txt | wc -l` -gt 0 ]; then
|
||||
get_menu_option
|
||||
done
|
||||
|
||||
if [ -n "$option" ]; then
|
||||
MOUNTED_ISO=$option
|
||||
ISO=${option:7} # remove /media/ to get device relative path
|
||||
DO_WITH_DEBUG kexec-iso-init $MOUNTED_ISO $ISO $USB_BOOT_DEV
|
||||
MOUNTED_ISO="$option"
|
||||
ISO="${option:7}" # remove /media/ to get device relative path
|
||||
DO_WITH_DEBUG kexec-iso-init "$MOUNTED_ISO" "$ISO" "$USB_BOOT_DEV"
|
||||
|
||||
die "Something failed in iso init"
|
||||
fi
|
||||
die "Something failed in iso init"
|
||||
fi
|
||||
|
||||
# No *.iso files on media, try ordinary bootable USB
|
||||
|
||||
if [ "$CONFIG_RESTRICTED_BOOT" = y ]; then
|
||||
die "ISO boot failed in Restricted Boot mode."
|
||||
die "No ISO files found, bootable USB not allowed with Restricted Boot."
|
||||
fi
|
||||
|
||||
echo "!!! Could not find any ISO, trying bootable USB"
|
||||
|
Loading…
x
Reference in New Issue
Block a user