grub.cfg: handle extlinux in the default menuentry

isolinux/syslinux/extlinux config files should all work,
using the syslinux parser function in grub

the current behaviour is to only search for grub.cfg,
so extlinux users can't use the default libreboot setup.
with this change, their systems should hopefully work.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2023-12-18 07:58:31 +00:00
parent eaa1341b9e
commit c4544e04bb
+14 -6
View File
@@ -92,13 +92,21 @@ function search_isolinux {
done done
echo # Insert newline echo # Insert newline
} }
function try_bootcfg {
try_user_config "${1}"
try_isolinux_config "${1}"
}
function search_bootcfg {
search_grub "${1}"
search_isolinux "${1}"
}
menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o' { menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o' {
if [ "${grub_scan_disk}" != "ata" ]; then if [ "${grub_scan_disk}" != "ata" ]; then
search_grub ahci search_bootcfg ahci
fi fi
if [ "${grub_scan_disk}" != "ahci" ]; then if [ "${grub_scan_disk}" != "ahci" ]; then
search_grub ata search_bootcfg ata
fi fi
# grub device enumeration is very slow, so checks are hardcoded # grub device enumeration is very slow, so checks are hardcoded
@@ -113,7 +121,7 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
# TODO: optimize grub itself, and use */? here for everything # TODO: optimize grub itself, and use */? here for everything
for vol in ${lvmvol} ${raidvol} ; do for vol in ${lvmvol} ${raidvol} ; do
try_user_config "${vol}" try_bootcfg "${vol}"
done done
unset ahcidev unset ahcidev
@@ -139,13 +147,13 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
# after cryptomount, lvm volumes might be available # after cryptomount, lvm volumes might be available
for vol in ${lvmvol}; do for vol in ${lvmvol}; do
try_user_config "${vol}" try_bootcfg "${vol}"
done done
search_grub crypto search_bootcfg crypto
for vol in lvm/* ; do for vol in lvm/* ; do
try_user_config "${vol}" try_bootcfg "${vol}"
done done
true # Prevent pager requiring to accept each line instead of whole screen true # Prevent pager requiring to accept each line instead of whole screen