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

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

parent 1a4a2195
Branches hotfix/syshandler-overwrite-luksheaderbackup
No related tags found
No related merge requests found
...@@ -80,6 +80,8 @@ set pager=1 ...@@ -80,6 +80,8 @@ set pager=1
read read
} }
# FIXME Make an automatic override for BTRFS directories instead of copypasting with a "@/" in front of every element
# Default list of GRUB possible directories. The @/... entries are for cases where the BTRFS filesystem is being used # 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" 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 # Default list of GRUB possible config files prefixes
...@@ -99,6 +101,7 @@ function try_user_grub_config { ...@@ -99,6 +101,7 @@ function try_user_grub_config {
fi fi
done 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"
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
...@@ -111,9 +114,12 @@ function search_grub { ...@@ -111,9 +114,12 @@ function search_grub {
echo # Insert newline echo # Insert newline
} }
# Default list of ISOLINUX possible directories. The @/... entries are for cases where the BTRFS filesystem is being used
set isolinux_dirs="'' /boot /EFI /boot/EFI /@ /@/boot /@/boot/EFI /@/EFI"
function try_isolinux_config { function try_isolinux_config {
set root="${1}" set root="${1}"
for dir in '' /boot /EFI /boot/EFI /@ /@/boot /@/boot/EFI /@/EFI; do for dir in ${isolinux_dirs}; 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
...@@ -125,6 +131,7 @@ function try_isolinux_config { ...@@ -125,6 +131,7 @@ function try_isolinux_config {
fi fi
done done
} }
function search_isolinux { function search_isolinux {
echo "\nAttempting to parse iso/sys/extlinux 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
...@@ -136,6 +143,7 @@ function search_isolinux { ...@@ -136,6 +143,7 @@ function search_isolinux {
done done
echo # Insert newline echo # Insert newline
} }
function try_bootcfg { function try_bootcfg {
try_user_grub_config "${1}" try_user_grub_config "${1}"
try_isolinux_config "${1}" try_isolinux_config "${1}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment