for isofile in $isopath/void-live-*.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 "Void Linux" {
        bootoptions="iso-scan/filename=$iso_path root=live:CDLABEL=$cd_label init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=us locale.LANG=en_US.UTF-8"
        linux (loop)/boot/vmlinuz $bootoptions
        initrd (loop)/boot/initrd
      }
      menuentry "Void Linux (RAM)" {
        bootoptions="iso-scan/filename=$iso_path root=live:CDLABEL=$cd_label init=/sbin/init ro rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 vconsole.unicode=1 vconsole.keymap=us locale.LANG=en_US.UTF-8  rd.live.ram"
        linux (loop)/boot/vmlinuz $bootoptions
        initrd (loop)/boot/initrd
      }
    }
  fi
done
