Syslinux EFI 64bit: start_image() returned Load Error

58 views Asked by At

The syslinux binaries provided by debian are working well with qemu.

But I have compiled syslinux from Debian 12 source code. And when I run it with qemu, it fails saying start_image() returned Load Error.

I first installed the packages needed to the build:

sudo apt-get update
sudo apt-get install dpkg-dev make python-is-python3 nasm uuid-dev gnu-efi

Then I downloaded the source code of syslinux:

mkdir ./Desktop/syslinux-mod
cd ./Desktop/syslinux-mod
apt-get source syslinux

To avoid a compilation error, in the file ./syslinux-6.04~git20190206.bf6db5b4+dfsg1/efi/efi.h I have replaced lines 23, 24, 25:

#include <efi.h>
#include <efilib.h>
#include <efistdarg.h>

by:

#include <efi/efi.h>
#include <efi/efilib.h>
#include <efi/efistdarg.h>
#include <efi/efisetjmp.h>

Then I compiled with the command make efi64

I have created a virtual machine drive file, a gpt partition table, and a boot partition.

Once the boot partition mounted, I have copied to it in the directory /EFI/boot/:

  • all .c32 files found in ./syslinux-6.04~git20190206.bf6db5b4+dfsg1/efi64 subdirectories
  • ldlinux.e64
  • syslinux.efi, renamed grubx64.efi, because I use the bootx64.efi from the debian live DVD, that want to chainload to grubx64.efi.

About qemu, I installed:

sudo apt-get install qemu-system-x86 aqemu ovmf

Then I have configured aqemu, a graphical frontend to qemu, to use TCG accelerator instead of KVM. And a command line parameter -bios /usr/share/ovmf/OVMF.fd.

When I try to rename syslinux.efi directly bootx64.efi, qemu display another error message, but I didn't have the time to read it.

So I wonder how to get a syslinux working installation from the source code provided by Debian.

0

There are 0 answers