aguslr / multibootusb

A collection of GRUB files and scripts that will allow you to create a pendrive capable of booting different ISO files
https://mbusb.aguslr.com
GNU General Public License v3.0
574 stars 153 forks source link

mbusb.d: fedora: Allow recognition of netinstall isos #220

Closed eskultety closed 5 years ago

eskultety commented 6 years ago

Both configs were strictly matching either '-dvd-.iso' or '-Live-.iso'. That means however, that none of the netinstall isos will be found during the drive iso scan.

Signed-off-by: Erik Skultety eskultet@redhat.com

aguslr commented 5 years ago

Thanks for the PR, @eskultety!

This doesn't seem to work for the Workstation netinstall since it expects the boot option inst.stage2=hd:LABEL=$cd_label but gets root=live:CDLABEL=$cd_label instead.

I think it'd be better to have two files, one for live images and another for install images. The later could simply be:

for isofile in $isopath/Fedora-*.iso; do
  if [ -e "$isofile" ]; then
    regexp --set=isoname "$isopath/(.*)" "$isofile"
    # Skip Live ISOs
    if regexp "Live" "$isofile"; then continue; fi
    submenu "$isoname ->" "$isofile" {
      iso_path="$2"
      loopback loop "$iso_path"
      probe --label --set=cd_label (loop)
      menuentry "Install Fedora" {
        bootoptions="iso-scan/filename=$iso_path inst.stage2=hd:LABEL=$cd_label quiet"
        linux (loop)/isolinux/vmlinuz $bootoptions
        initrd (loop)/isolinux/initrd.img
      }
      menuentry "Test this media & install Fedora" {
        bootoptions="iso-scan/filename=$iso_path inst.stage2=hd:LABEL=$cd_label rd.live.check quiet"
        linux (loop)/isolinux/vmlinuz $bootoptions
        initrd (loop)/isolinux/initrd.img
      }
      menuentry "Install Fedora in basic graphics mode" {
        bootoptions="iso-scan/filename=$iso_path inst.stage2=hd:LABEL=$cd_label nomodeset quiet"
        linux (loop)/isolinux/vmlinuz $bootoptions
        initrd (loop)/isolinux/initrd.img
      }
      menuentry "Rescue a Fedora system" {
        bootoptions="iso-scan/filename=$iso_path inst.stage2=hd:LABEL=$cd_label rescue quiet"
        linux (loop)/isolinux/vmlinuz $bootoptions
        initrd (loop)/isolinux/initrd.img
      }
      menuentry "Run a memory test" {
        bootoptions=""
        linux16 (loop)/isolinux/memtest $bootoptions
      }
    }
  fi
done

Notice the line if regexp "Live" "$isofile"; then continue; fi which will skip Live ISOs so they are not processed twice.

PR #222 should fix the issue.