for isofile in $isopath/manjaro-*.iso; do
  if [ -e "$isofile" ]; then
    regexp --set=isoname "$isopath/(.*)" "$isofile"
    submenu "$isoname ->" "$isofile" {
      iso_path="$2"
      loopback loop "$iso_path"
      probe --label --set=cd_label (loop)
      menuentry "Start Manjaro Linux" {
        bootoptions="img_dev=$imgdevpath img_loop=$iso_path earlymodules=loop misobasedir=manjaro misolabel=$cd_label nouveau.modeset=1 i915.modeset=1 radeon.modeset=1 logo.nologo overlay=free quiet splash showopts"
        linux (loop)/boot/vmlinuz-* $bootoptions
        initrd (loop)/boot/initramfs-*.img
      }
      menuentry "Start (non-free drivers)" {
        bootoptions="img_dev=$imgdevpath img_loop=$iso_path earlymodules=loop misobasedir=manjaro misolabel=$cd_label nouveau.modeset=0 i915.modeset=1 radeon.modeset=0 nonfree=yes logo.nologo overlay=nonfree quiet splash showopts"
        linux (loop)/boot/vmlinuz-* $bootoptions
        initrd (loop)/boot/initramfs-*.img
      }
    }
  fi
done
