grub.cfg: split up try_user_config

in the next revision, i will add ESP paths

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit2-merge1
Leah Rowe 2024-06-01 16:58:59 +01:00 committed by Leah Rowe
parent cb4bacc9d9
commit 8bc7e3a539
1 changed files with 9 additions and 5 deletions

View File

@ -61,15 +61,19 @@ if [ -f (cbfsdisk)/keymap.gkb ]; then
keymap (cbfsdisk)/keymap.gkb
fi
function try_user_config {
function really_try_user_config {
set root="${1}"
if [ -f /"${2}"/grub.cfg ]; then
unset superusers
configfile /"${2}"/grub.cfg
fi
}
function try_user_config {
# The @/... entries are for cases where the BTRFS filesystem is being used
for dir in boot grub grub2 boot/grub boot/grub2 @/boot @/grub @/grub2 @/boot/grub @/boot/grub2; do
if [ -f /"${dir}"/grub.cfg ]; then
unset superusers
configfile /"${dir}"/grub.cfg
fi
really_try_user_config "${1}" "${dir}"
done
}
function search_grub {