for isofile in $isopath/antiX-*.iso; do
  if [ -e "$isofile" ]; then
    regexp --set=isoname "$isopath/(.*)" "$isofile"
    submenu "$isoname ->" "$isofile" {
      iso_path="$2"
      loopback loop "$iso_path"
      menuentry "antiX" {
        bootoptions="from=hd,usb root=UUID=$rootuuid fromiso=$iso_path quiet splash=v disable=lx"
        linux (loop)/antiX/vmlinuz $bootoptions
        initrd (loop)/antiX/initrd.gz
      }
      menuentry "antiX Persistent" {
        bootoptions="from=hd,usb root=UUID=$rootuuid fromiso=$iso_path quiet splash=v disable=lx persist=hd,usb,r,h"
        linux (loop)/antiX/vmlinuz $bootoptions
        initrd (loop)/antiX/initrd.gz
      }
      menuentry "antiX Customize Boot (text menus)" {
        bootoptions="from=hd,usb root=UUID=$rootuuid fromiso=$iso_path quiet splash=v disable=lx menus"
        linux (loop)/antiX/vmlinuz $bootoptions
        initrd (loop)/antiX/initrd.gz
      }
      menuentry "antiX Failsafe" {
        bootoptions="from=hd,usb root=UUID=$rootuuid fromiso=$iso_path quiet splash=v disable=lx nomodeset failsafe"
        linux (loop)/antiX/vmlinuz $bootoptions
        initrd (loop)/antiX/initrd.gz
      }
      menuentry "antiX Create Bootchart" {
        bootoptions="from=hd,usb root=UUID=$rootuuid fromiso=$iso_path quiet splash=v disable=lx bootchart initcall_debug printk.time=y"
        linux (loop)/antiX/vmlinuz $bootoptions
        initrd (loop)/antiX/initrd.gz
      }
    }
  fi
done
