grub.cfg syslinux: support ESP and extlinux.conf

the so-called EFI System Partition (ESP) is used
on many UEFI-based setups. some users may be
migrating to libreboot, so let's support it.

on BIOS setups, it would be e.g.
/boot/syslinux/syslinux.conf

on UEFI setups, it would be e.g.

/boot/EFI/syslinux/syslinux.conf

additionally, support scanning for extlinux.conf

Signed-off-by: Leah Rowe <leah@libreboot.org>
9020vga
Leah Rowe 2023-12-18 07:46:14 +00:00
parent b817001e29
commit eaa1341b9e
1 changed files with 4 additions and 2 deletions

View File

@ -71,16 +71,18 @@ function search_grub {
function try_isolinux_config { function try_isolinux_config {
set root="${1}" set root="${1}"
for dir in '' /boot; do for dir in '' /boot /EFI; do
if [ -f "${dir}"/isolinux/isolinux.cfg ]; then if [ -f "${dir}"/isolinux/isolinux.cfg ]; then
syslinux_configfile -i "${dir}"/isolinux/isolinux.cfg syslinux_configfile -i "${dir}"/isolinux/isolinux.cfg
elif [ -f "${dir}"/syslinux/syslinux.cfg ]; then elif [ -f "${dir}"/syslinux/syslinux.cfg ]; then
syslinux_configfile -s "${dir}"/syslinux/syslinux.cfg syslinux_configfile -s "${dir}"/syslinux/syslinux.cfg
elif [ -f "${dir}"/syslinux/extlinux.conf ]; then
syslinux_configfile -s "${dir}"/syslinux/extlinux.conf
fi fi
done done
} }
function search_isolinux { function search_isolinux {
echo "\nAttempting to parse isolinux/syslinux config from '${1}' devices" echo "\nAttempting to parse iso/sys/extlinux config from '${1}' devices"
for i in 0 1 2 3 4 5 6 7 8 9 10 11; do for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
try_isolinux_config "(${1}${i},${part})" try_isolinux_config "(${1}${i},${part})"