grubby/boot/isos.cfg.d/fedora.cfg

46 lines
1.1 KiB
INI
Raw Normal View History

2020-11-13 03:43:10 +01:00
# Fedora Grub Config
set this_isopath="${isodev}${isopath}/fedora"
2020-11-13 03:43:10 +01:00
# abuse for to check for existence
for isofile in ${this_isopath}/Fedora-*.iso; do
2020-11-13 03:43:10 +01:00
if [ ! -e "$isofile" ]; then break; fi
echo "Found Fedoras in ${this_isopath}"
submenu "Fedora >" "${this_isopath}" --class fedora {
this_isopath=$2
2020-11-13 03:43:10 +01: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 \
"^.*/(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
regexp \
--set 1:isodev \
--set 2:isofile \
"^(\(.*\))?(.*)\$" "${isofile}"
2020-11-13 03:43:10 +01:00
echo "Using ${isoname}..."
loopback loop "${isodev}${isofile}"
2020-11-13 03:43:10 +01:00
probe --set isolabel --label (loop)
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