for isofile in $isopath/blackarchlinux-*.iso; do
  if [ -e "$isofile" ]; then
    regexp --set=isoname "$isopath/(.*)" "$isofile"
    submenu "$isoname ->" "$isofile" {
      iso_path="$2"
      loopback loop "$iso_path"
      proble --label --set=cd_label (loop)
      menuentry "Boot BlackArch Linux" {
        bootoptions="img_dev=$imgdevpath img_loop=$iso_path earlymodules=loop archisodevice=/dev/loop0 archisobasedir=blackarch archisolabel=$cd_label"
        linux (loop)/blackarch/boot/*/vmlinuz $bootoptions
        initrd (loop)/blackarch/boot/*/archiso.img
      }
    }
  fi
done
