2020-11-13 00:50:49 +01:00
|
|
|
# Load ISO configuration files
|
2020-11-13 03:22:54 +01:00
|
|
|
#
|
|
|
|
insmod regexp
|
2020-11-13 00:50:49 +01:00
|
|
|
|
|
|
|
set isoconfdir="${isoconfig}.d"
|
|
|
|
export isoconfdir
|
|
|
|
|
2023-04-07 19:26:39 +02:00
|
|
|
if [ ! -d "${isoconfdir}" ]; then
|
|
|
|
echo "Cannot read ${isoconfdir}"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Loop over both FAT32 and ExFAT filesystems
|
|
|
|
isouuids="EAB6-E0E9 0BB2-9158"
|
|
|
|
|
|
|
|
for isouuid in $isouuids
|
|
|
|
do
|
2023-04-08 11:17:53 +02:00
|
|
|
echo ""
|
|
|
|
echo "Searching isoroot on UUID=${isouuid}"
|
2023-04-07 19:26:39 +02:00
|
|
|
|
|
|
|
search --no-floppy --fs-uuid --set=isodev $isouuid
|
|
|
|
set isopath="/isos"
|
|
|
|
|
|
|
|
set isoroot="(${isodev})${isopath}"
|
|
|
|
|
|
|
|
if [ ! -d "${isoroot}" ]; then
|
|
|
|
echo "Ignoring invalid iso root at ${isoroot}"
|
|
|
|
sleep 1
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
# split isoroot again
|
|
|
|
echo "Found iso root at ${isoroot}"
|
|
|
|
|
|
|
|
regexp \
|
|
|
|
--set 1:isodev \
|
|
|
|
--set 2:isopath \
|
|
|
|
"^(\(.*\))?(.*)\$" "${isoroot}"
|
|
|
|
|
|
|
|
echo "isodev: ${isodev}"
|
|
|
|
echo "isopath: ${isopath}"
|
|
|
|
|
|
|
|
# Export the variables
|
|
|
|
export isoroot
|
|
|
|
export isopath
|
|
|
|
export isodev
|
|
|
|
|
|
|
|
# Read appropriate iso configs
|
|
|
|
echo "Reading ${isoconfdir}"
|
2020-11-13 03:22:54 +01:00
|
|
|
for conf in ${isoconfdir}/*.cfg; do
|
|
|
|
if [ ! -f "$conf" ]; then
|
|
|
|
echo "No valid configuration to read"
|
|
|
|
break;
|
|
|
|
fi
|
|
|
|
|
2023-04-08 11:17:53 +02:00
|
|
|
#echo "Sourcing $conf "
|
2020-11-13 03:22:54 +01:00
|
|
|
source "${conf}"
|
2020-11-13 00:50:49 +01:00
|
|
|
done
|
2020-11-13 03:22:54 +01:00
|
|
|
|
2023-04-07 19:26:39 +02:00
|
|
|
sleep 1
|
|
|
|
done
|
2020-11-13 03:22:54 +01:00
|
|
|
|
2023-04-07 19:26:39 +02:00
|
|
|
# let the echos be readable
|
|
|
|
echo "Waiting for 5 seconds..."
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
menuentry ' ' { true }
|
2020-11-13 03:22:54 +01:00
|
|
|
|
2023-04-07 19:26:39 +02:00
|
|
|
menuentry "[Esc] Back to Menu" {
|
|
|
|
configfile "${prefix}/grub.cfg"
|
|
|
|
}
|