for isofile in $isopath/linuxbbq-*.iso; do
  if [ -e "$isofile" ]; then
    regexp --set=isoname "$isopath/(.*)" "$isofile"
    submenu "$isoname ->" "$isofile" {
      iso_path="$2"
      loopback loop "$iso_path"
      menuentry "LinuxBBQ" {
        bootoptions="findiso=$iso_path boot=live ip=frommedia union=overlay vga=current"
        linux (loop)/live/vmlinuz $bootoptions
        initrd (loop)/live/initrd.img
      }
      menuentry "LinuxBBQ (i915)" {
        bootoptions="findiso=$iso_path boot=live ip=frommedia union=overlay vga=current nomodeset i915.modeset=0"
        linux (loop)/live/vmlinuz $bootoptions
        initrd (loop)/live/initrd.img
      }
      menuentry "LinuxBBQ (nomode)" {
        bootoptions="findiso=$iso_path boot=live ip=frommedia union=overlay nomodeset vga=current verbose"
        linux (loop)/live/vmlinuz $bootoptions
        initrd (loop)/live/initrd.img
      }
      menuentry "LinuxBBQ (failsafe)" {
        bootoptions="findiso=$iso_path boot=live ip=frommedia union=overlay verbose noapic noapm nodma nomce nolapic nosmp vga=current"
        linux (loop)/live/vmlinuz $bootoptions
        initrd (loop)/live/initrd.img
      }
    }
  fi
done
