rhboot / shim

UEFI shim loader
Other
867 stars 293 forks source link

Booting Grml ISO results in `Reloc 0 block size 2756420659 is invalid` #131

Open paulmenzel opened 6 years ago

paulmenzel commented 6 years ago

On the two Dell laptops XPS 13 9360 and 9370 and with OVMF and QEMU the Grml live image cannot be started from a USB device.

The error on the Dell display is:

Reloc 0 block size 2756420659 is invalid Relocation failed: Unsupported Failed to load image: Unsupported start_image() returned Unsupported

With OVMF I only get the first two lines.

Here is how you can reproduce this with QEMU.

Download the Grml ISO file, and follow How to run OVMF in the Wiki. I downloaded Gerd’s prebuilt images and extracted them.

Then I did mkdir hda-contents and run QEMU with the command below.

qemu-system-x86_64 -enable-kvm -bios edk2.git/ovmf-x64/OVMF-pure-efi.fd -hda fat:hda-contents -net none -hdb ~/Downloads/grml64-full_sid_latest.iso
paulmenzel commented 6 years ago

On the edk2-devel list I was told, that the error comes from relocate_coff.

[…]
while (RelocBase < RelocBaseEnd) {
    Reloc = (UINT16 *) ((char *) RelocBase + sizeof (EFI_IMAGE_BASE_RELOCATION));

    if ((RelocBase->SizeOfBlock == 0) || (RelocBase->SizeOfBlock > context->RelocDir->Size)) {
        perror(L"Reloc %d block size %d is invalid\n", n, RelocBase->SizeOfBlock);
        return EFI_UNSUPPORTED;
    }
    […]
}
  "[edk2] Booting ISO gives `Reloc 0 block size 2756420659 is invalid`"
paulmenzel commented 6 years ago

context->RelocDir->Size should probably also be printed in the error message.