Boot iso file through uEFI by calling EFI executable inside the iso

boot-loaderlive-usbuefi

I want to create a USB stick that I can use to boot multiple iso files. I want to do this through uEFI.

The usb stick would look something like this:

/EFI
  /bootx64.efi
  /something.conf
/isos
  /foo.iso
  /bar.iso
  ...

Here, /isos holds a bunch of uEFI bootable iso files. From what I understand these isos have a /EFI/BOOT<some arch>.efi file that the uEFI booloader would normally execute.

On the drive /EFI/bootx64.efi is some to be determined efi booloader and /EFI/something.conf is its configuration file.

What I need is some uEFI executable that can somehow call /EFI/BOOT<some arch>.efi within one of the iso files. I don't know if this is theoretically possible.

I know that something similar can be done with GRUB2, but it requires specifying the linux image, its options and the initrd file. This is different from one iso to the other and sometimes, it doesn't work at all. My hope is that by calling /EFI/BOOT<some arch>.efi, I don't have to specify these and I can have one recipe to boot any iso image.

My question is: Is there a uEFI bootloader that can let me call an EFI executable that is located inside an iso file?

Best Answer

This won't work for all ISOs, but you can use MEMDISK from syslinux to copy the ISO to memory as a RAMDISK image. BIOS calls will see the RAMDISK, and linux, too, will recognize the RAMDISK. To do this you will have to copy syslinux.efi and the associated files someplace onto your EFI system partition (ESP), like EFI/syslinux. Then in /EFI/syslinux/syslinux.cfg, create a bunch of memdisk memory options for your ISO files, along the lines of the examples on the MEMDISK page.

Related Question