diff --git a/grub2/grub.cfg b/grub2/grub.cfg index c8908b4..6247d38 100644 --- a/grub2/grub.cfg +++ b/grub2/grub.cfg @@ -187,7 +187,7 @@ if any_exists ${isopath}/clonezilla/clonezilla-live-*.iso; then } fi -if any_exists ${isopath}/debian/debian-live-*.iso ${isopath}/debian/mini.iso; then +if any_exists ${isopath}/debian/debian-live-*.iso ${isopath}/debian/debian-*-netinst.iso ${isopath}/debian/mini.iso; then menuentry "Debian >" --class debian { configfile "${prefix}/inc-debian.cfg" } diff --git a/grub2/inc-debian.cfg b/grub2/inc-debian.cfg index a906682..8051e51 100644 --- a/grub2/inc-debian.cfg +++ b/grub2/inc-debian.cfg @@ -1,5 +1,6 @@ # Debian GNU/Linux -function add_menu { +# Live ISOs - The regular method +function add_live_menu { isofile="$1" regexp \ @@ -18,7 +19,28 @@ function add_menu { } } -for_each_sorted add_menu "$isopath"/debian/debian-live-*.iso +# Netinst ISOs - Lots of options, so chain its own grub.cfg +function add_netinst_menu { + isofile="$1" + + regexp \ + --set 1:isoname \ + --set 2:version \ + --set 3:arch \ + "^${isopath}/debian/(debian-([^-]+)-([^-]+)-netinst\.iso)\$" "${isofile}" + menuentry "Debian Netinst ${version} ${arch}" "${isofile}" "${isoname}" --class debian { + set isofile=$2 + set isoname=$3 + use "${isoname}" + loop $isofile + change_root (loop) + configfile /boot/grub/grub.cfg + restore_root + } +} + +for_each_sorted add_live_menu "$isopath"/debian/debian-live-*.iso +for_each_sorted add_netinst_menu "$isopath"/debian/debian-*-netinst.iso # Special mini.iso installer - Lots of options, so chain its own grub.cfg if [ -e "$isopath/debian/mini.iso" ]; then