6

I've been trying to add UEFI support in the 64-bit version of Minimal Linux Live for quite some time, unfortunately without much success. As you can see from the below image, I get critical error each time I try to boot via UEFI.

Minimal Linux Live - UEFI

This is what I did in order to get to this point:

  1. I downloaded syslinux-6.0.3.
  2. I followed the instructions here and copied efi64/efi/syslinux.efi to \EFI\BOOT\BOOTX64.EFI.
  3. I also copied efi64/com32/elflink/ldlinux/ldlinux.e64 to \EFI\BOOT\LDLINUX.E64.
  4. I created virtual machine in VirtualBox (version 5.0.20) and enabled UEFI.
  5. I generated new ISO image (all ISOLINUX configuration files are in the root folder, see the screenshot) and put it as primary bootable media in the virtual machine.
  6. After boot I immediately got the error which you see on the screenshot.
  7. At this point I had to rename \EFI\BOOT\BOOTX64.EFI to \EFI\BOOT\BOOTX641.EFI in order to "break" the boot process and fall back to UEFI shell.
  8. In the UEFI shell I used the command edit and then I navigated to the \EFI\BOOT folder.
  9. I manually invoked BOOTX641.EFI and I ended up with the same error which you can see.

So, I can conclude that my EFI stub is getting executed but something breaks during the execution process and at this point I don't know what's wrong.

I checked the ISO image structure of System Rescue CD which I know that supports UEFI and I noticed the following:

  1. The EFI structure contains only one file: \efi\boot\bootx64.efi.
  2. The size of \efi\boot\bootx64.efi is 724KB while the corresponding file in Syslinux 6.03 efi64/efi/syslinux.efi is ~200KB so this is definitely not the same file.
  3. When I copied \efi\boot\bootx64.efi from "System Rescue CD" and used it in the EFI structure in "Minimal Linux Live" the UEFI boot process was fine to the point where I was presented with GRUB 2 shell.

That's how I found out that the file \efi\boot\bootx64.efi in "System Rescue CD" has built-in GRUB 2 support, therefore it must be a custom built solution.

So, the problem in just few words - I'm using vanilla Syslinux package and I'd like to create UEFI compatible configuration which boots a simple ISO image. Following the official instructions doesn't seem to work for me.

All suggestions are highly appreciated! Thank you!


Note 1: The ISO image boots fine in BIOS mode. There is no problem there.

Note 2: Most probably this is not a bug in VirtualBox because other operating systems (e.g. Ubuntu and Linux Mint) boot just fine in UEFI mode.


EDIT 1 - (Jan-2017):

It has been very long time without answer, so I implemented my solution in quite different way:

  • I don't use Syslinux in UEFI boot mode.
  • I compiled my Linux kernel with EFI stub.
  • I created simple startup.nsh script which is executed automatically after UEFI boot.
  • The same script loads the kernel and the initramfs.

In this way I lose some of the boot functionality, e.g. vga=ask which works fine in Syslinux but it doesn't work in UEFI mode since this particular boot option requires proper Linux boot loader.

Even though I have solution which works fine, the question is still open.

EDIT 2 - (Dec-2017):

This is in addition to the previous update. The solution with startup.nsh works only if the UEFI system has 'UEFI Shell' (according to the UEFI specs the firmware may or may not provide shell) and only if this shell has support level 1 or above. Also, there is no guarantee that the startup script will be executed, because the proper way to provide ESP in ISO image is via 'El Torito' boot image. Providing ESP compatible structure directly on the ISO image seems to work fine on certain firmwares but it is not universal solution.

The question is still open but meanwhile I managed to integrate systemd-boot and I no longer consider this issue as high priority.

2

It sounds more like System Rescue CD uses GRUB, not syslinux. My grub64.efi is about 1MB, but I imagine you can build it with fewer modules included.

The image you copied is called syslinux.efi, so I would not call it isolinux. I expect it looks for a file called syslinux.cfg, not isolinux.cfg. (isolinux will fall back to syslinux.cfg though).

I also notice you say "all ISOLINUX configuration files are in the root folder". I can't tell how you created the ISO. Remember that the bootloader needs to be in a special boot image, not the directory tree you see if you mount the iso9660 filesystem. Obviously VirtualBox is booting something so that's not the problem here, but if it's more permissive than other systems then you might still be doing the "wrong" thing.

The hybrid boot images set up by "several popular Linux distributions" are highly entertaining to read about, but the last I read it wasn't quite possible to have a single image supporting all of Mac, 32-bit EFI... there are at least firmwares that see multiple of the boot images and ask the user to choose between "1" and "2". Just a note before anyone tries going down the rabbit hole, at least with the Mac-specific support, it might be safer only to implement the parts you're able to test.

  • Yes, in UEFI mode it's hard to say where the "efi" file comes from, so most probably "System Resue CD" uses GRUB 2 as main boot loader in UEFI mode without using Syslinux/ISOLINUX at all. – Ivan Davidov May 24 '16 at 17:06
  • You can see how I create the ISO image file here. Note that this is the original source code, without the UEFI stuff. I'm using only the stuff which comes from Syslinux, nothing more. Also, according to the Syslinux specs the structure is valid - you can use the root folder as main configuration folder. I already tried to rename the configuration file and use syslinux instead of isolinux. I even tried to place the conf files in syslinux folder inside the efi folder (read it somewhere), still no success. – Ivan Davidov May 24 '16 at 17:14
  • It looks like Ubuntu on EFI also used GRUB, at least in some versions help.ubuntu.com/… Can you confirm that successfully booting CD(s) in Virtualbox are booting the EFI version of syslinux? – sourcejedi May 24 '16 at 18:39
  • Nope, seems like Linux Mint, Ubuntu and Arch Linux, as well as System Rescue CD are all running UEFI versions of GRUB 2. The closest thing I found is using Syslinux on EFI partition for HDD installation but this is quite different from my case since I have ISO image with live Linux OS. Anyway, I tried this approach and the result I get is the same critical error. – Ivan Davidov May 24 '16 at 19:18

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.