2020-11-13 03:43:10 +01:00
|
|
|
# Fedora Grub Config
|
|
|
|
|
2023-04-07 19:45:36 +02:00
|
|
|
|
|
|
|
set this_isopath="${isodev}${isopath}/fedora"
|
2020-11-13 03:43:10 +01:00
|
|
|
|
|
|
|
# abuse for to check for existence
|
2023-04-07 19:45:36 +02:00
|
|
|
for isofile in ${this_isopath}/Fedora-*.iso; do
|
2020-11-13 03:43:10 +01:00
|
|
|
if [ ! -e "$isofile" ]; then break; fi
|
|
|
|
|
2023-04-07 19:45:36 +02:00
|
|
|
echo "Found Fedoras in ${this_isopath}"
|
|
|
|
|
|
|
|
submenu "Fedora >" "${this_isopath}" --class fedora {
|
|
|
|
this_isopath=$2
|
2020-11-13 03:43:10 +01:00
|
|
|
|
2023-04-07 19:45:36 +02:00
|
|
|
for isofile in ${this_isopath}/Fedora-*.iso; do
|
2020-11-13 03:43:10 +01:00
|
|
|
if [ ! -e "$isofile" ]; then break; fi
|
|
|
|
|
|
|
|
regexp \
|
|
|
|
--set 1:isoname \
|
|
|
|
--set 2:variant \
|
|
|
|
--set 3:arch \
|
|
|
|
--set 4:version \
|
2023-04-07 19:45:36 +02:00
|
|
|
"^.*/(Fedora-([^-]+)-Live-([^-]+)-([^-]+)-[^-]+\.iso)\$" "${isofile}"
|
2020-11-13 03:43:10 +01:00
|
|
|
|
|
|
|
menuentry "Fedora ${version} ${arch} ${variant}" "${isofile}" "${isoname}" --class fedora {
|
|
|
|
set isofile=$2
|
|
|
|
set isoname=$3
|
2023-04-07 19:45:36 +02:00
|
|
|
|
|
|
|
regexp \
|
|
|
|
--set 1:isodev \
|
|
|
|
--set 2:isofile \
|
|
|
|
"^(\(.*\))?(.*)\$" "${isofile}"
|
|
|
|
|
2020-11-13 03:43:10 +01:00
|
|
|
echo "Using ${isoname}..."
|
2023-04-07 19:45:36 +02:00
|
|
|
loopback loop "${isodev}${isofile}"
|
2020-11-13 03:43:10 +01:00
|
|
|
probe --set isolabel --label (loop)
|
2023-04-07 19:45:36 +02:00
|
|
|
linux (loop)/images/pxeboot/vmlinuz root=live:CDLABEL=${isolabel} rd.live.image iso-scan/filename=${isofile} rhgb ro
|
|
|
|
initrd (loop)/images/pxeboot/initrd.img
|
2020-11-13 03:43:10 +01:00
|
|
|
}
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
# kill for loop
|
|
|
|
break
|
|
|
|
done
|