# Use Grub 2 to Boot Ubuntu ISO from exFAT USB brought to you by https://www.pendrivelinux.com/make-an-exfat-bootable-usb-flash-drive/ # Studied the Grub 2 File Manager e2b.sh file for Partnew options; https://github.com/a1ive/grub2-filemanager/blob/master/boot/grubfm/rules/iso/e2b.sh GRUB_TERMINAL=console set gfxmode=auto set gfxpayload=keep insmod all_video insmod gfxterm insmod exfat insmod part_msdos insmod part_gpt insmod regexp terminal_output gfxterm set timeout=60 set default=0 if [ -e (${bootdev},msdos1)/*.* ]; then for isofile in (${bootdev},msdos1)/*.*; do regexp --set=isoname "/(.*.*)" "${isofile}"; export isoname; regexp --set=1:ext '^.*\.(.*$)' "${isoname}"; if regexp '^[iI][sS][oO]$' "${ext}"; then menuentry ${isoname} { set iso_path="(${bootdev},msdos1)/${1}"; export iso_path; if [ "$grub_platform" = "efi" ]; then map -f "${iso_path}"; echo $"Creating a 3rd partition placeholder at (${bootdev},3)"; partnew -t 0 -s 0 -l 0 (${bootdev}) 3; partnew --type=0x00 --file="${iso_path}" (${bootdev}) 3; set root=(vd0); _config fi; } fi; done fi; function _config { if [ -e /boot/grub/grub.cfg ]; then configfile /boot/grub/grub.cfg; elif [ -e /boot/grub/loopback.cfg ]; then configfile /boot/grub/loopback.cfg; elif [ -e /amogos/boot/syslinux.cfg ]; then syslinux_configfile /amogos/boot/syslinux.cfg; elif [ -e /linux/boot/EFI/Boot/syslinux.cfg ]; then syslinux_configfile -s /linux/boot/syslinux.cfg; elif [ -e /linux/boot/syslinux.cfg ]; then syslinux_configfile /linux/boot/syslinux.cfg; elif [ -e /system/isolinux/isolinux.cfg ]; then syslinux_configfile -i /system/isolinux/isolinux.cfg; elif [ -e /BOOT/GRUB/GRUBSRCD.cfg ]; then configfile /BOOT/GRUB/GRUBSRCD.cfg; elif [ -e /grub/grub.cfg ]; then configfile /grub/grub.cfg; elif [ -e /EFI/BOOT/grub.cfg ]; then configfile /EFI/BOOT/grub.cfg; elif [ -e /EFI/debian/grub/grub.cfg ]; then configfile /EFI/debian/grub/grub.cfg; elif [ -e /isolinux.cfg ]; then syslinux_configfile -i /isolinux.cfg; elif [ -e /isolinux/isolinux.cfg ]; then syslinux_configfile -i /isolinux/isolinux.cfg; elif [ -e /isolinux/live.cfg ]; then syslinux_configfile /isolinux/live.cfg; elif [ -e /boot/isolinux/isolinux.cfg ]; then syslinux_configfile -i /boot/isolinux/isolinux.cfg; elif [ -e /boot/isolinux/syslinux.cfg ]; then syslinux_configfile /boot/isolinux/syslinux.cfg; elif [ -e /boot/syslinux/syslinux.cfg ]; then syslinux_configfile /boot/syslinux/syslinux.cfg; elif [ -e /boot/syslinux/porteus.cfg ]; then syslinux_configfile /boot/syslinux/porteus.cfg; elif [ -e /slax/boot/syslinux.cfg ]; then syslinux_configfile /slax/boot/syslinux.cfg; elif [ -e /system/isolinux/isolinux.cfg ]; then syslinux_configfile -i /system/isolinux/isolinux.cfg; fi; }