grub.cfg: scan grub.cfg from ESP

we already supported syslinux but not grub

support grub by scanning for the most common paths,
based on the most popular distros

we don't hardcode this with * because it slows down
the boot, and in practise many distros still use the
same grub.cfg location as in BIOS systems (the EFI
one is often just a link to the BIOS one)

Signed-off-by: Leah Rowe <leah@libreboot.org>
20240612_branch
Leah Rowe 2024-06-01 17:01:11 +01:00
parent b3d58f1edc
commit 42b5b58d36
1 changed files with 3 additions and 0 deletions

View File

@ -75,6 +75,9 @@ function try_user_config {
for dir in boot grub grub2 boot/grub boot/grub2 @/boot @/grub @/grub2 @/boot/grub @/boot/grub2; do for dir in boot grub grub2 boot/grub boot/grub2 @/boot @/grub @/grub2 @/boot/grub @/boot/grub2; do
really_try_user_config "${1}" "${dir}" really_try_user_config "${1}" "${dir}"
done done
for dir in ubuntu debian redhat; do
really_try_user_config "${1}" "EFI/${dir}"
done
} }
function search_grub { function search_grub {
echo -n "Attempting to load grub.cfg from '${1}' devices" echo -n "Attempting to load grub.cfg from '${1}' devices"