for x in (ahci*,*) (usb*.*) ; do if [ -f "${x}/netbsd" ] ; then menuentry "Load NetBSD from $x" $x { root=$2 knetbsd /netbsd } fi for path in '' /grub /grub2 /boot /boot/grub /boot/grub2; do if [ -f "${x}${path}/grub.cfg" ] ; then menuentry "Load config from ${x}" $x $path { root=$2 configfile "/${3}/grub.cfg" } fi done for path in '' /boot; do if [ -f "${x}${path}/syslinux/syslinux.cfg" ] ; then menuentry "Load syslinux config from ${x}" $x $path { root=$2 syslinux_configfile -s "${3}/syslinux/syslinux.cfg" } fi if [ -f "${x}${path}/isolinux/isolinux.cfg" ] ; then menuentry "Load isolinux config from ${x}" $x $path { root=$2 syslinux_configfile -i "${3}/isolinux/isolinux.cfg" } fi done done