for isofile in $isopath/KaOS-*-x86_64.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 "KaOS" {
        bootoptions="img_dev=$imgdevpath img_loop=$iso_path kdeosisodevice=/dev/loop0 earlymodules=loop kdeisolabel=$cd_label"
        linux (loop)/kdeos/boot/x86_64/kdeosiso $bootoptions
        initrd (loop)/kdeos/boot/x86_64/kdeosiso.img
      }
    }
  fi
done
