Skip to content
Snippets Groups Projects
Commit 1a4a2195 authored by livio's avatar livio Committed by Libreboot project
Browse files

Changed GRUB config detection function to load from a list inside a variable

parent 04ba3b0f
Branches
Tags
No related merge requests found
...@@ -80,13 +80,17 @@ set pager=1 ...@@ -80,13 +80,17 @@ set pager=1
read read
} }
# Default list of GRUB possible directories. The @/... entries are for cases where the BTRFS filesystem is being used
set grub_dirs="boot grub grub2 boot/grub boot/grub2 @/boot @/grub @/grub2 @/boot/grub @/boot/grub2"
# Default list of GRUB possible config files prefixes
set grub_conf_names="'' osboot_ autoboot_ libreboot_ coreboot_"
function try_user_grub_config { function try_user_grub_config {
set root="${1}" set root="${1}"
# The @/... entries are for cases where the BTRFS filesystem is being used for dir in ${grub_dirs}; do
for dir in boot grub grub2 boot/grub boot/grub2 @/boot @/grub @/grub2 @/boot/grub @/boot/grub2; do
# In order to save time, we do not attempt anything on non existing directory. # In order to save time, we do not attempt anything on non existing directory.
if [ -d /"${dir}"/ ]; then if [ -d /"${dir}"/ ]; then
for name in '' osboot_ autoboot_ libreboot_ coreboot_; do for name in ${grub_conf_names}; do
if [ -f /"${dir}"/"${name}"grub.cfg ]; then if [ -f /"${dir}"/"${name}"grub.cfg ]; then
unset superusers unset superusers
configfile /"${dir}"/"${name}"grub.cfg configfile /"${dir}"/"${name}"grub.cfg
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment