#2419 Issue closed: RAWDISK output fails to boot on Ubuntu >=18.04.4 using Grub 2 + UEFI without Secure Boot

Labels: enhancement, bug, fixed / solved / done

OliverO2 opened issue at 2020-06-05 13:44:

  • ReaR version: Relax-and-Recover 2.6 / Git
  • OS version: Ubuntu 18.04.4 LTS, Ubuntu 20.04 LTS
  • System architecture: x86_64
  • Firmware and bootloader: UEFI, Grub 2 without Secure Boot
  • Description of the issue:

If Grub 2 is used to boot a UEFI rescue medium created on Ubuntu 18.04 or 20.04 with RAWDISK output, which was not configured for Secure Boot, the following messages appear:

error: file `/EFI/BOOT/x86_64/linuxefi.mod´ not found.
error: you need to load the kernel first.

This appears to be a regression, possibly caused by a change in Ubuntu's Grub packaging: According to this mailing list post, linuxefi.mod is a distribution-specific module.

NOTES:

  • UEFI secure boot (also done via Grub 2) is not affected.
  • UEFI booting via syslinux (another RAWDISK output option) is also not affected.

PR upcoming.

jsmeix commented at 2020-06-08 07:47:

@OliverO2 @gozora @pcahyna
could you have a look if UEFI booting the recovery system
for other output methods in particular for OUTPUT=ISO
cf. https://github.com/rear/rear/pull/2293
could be also affected by such distribution-specific modules?

OliverO2 commented at 2020-06-08 13:14:

UEFI-booting from an ISO image created on Ubuntu 18.04.4 LTS with OUTPUT=ISO works.

Documentation of grub-mkstandalone's behavior:

  • Log excerpts:

    GRUB2 modules to load: btrfs fat part_gpt
    [...]
    grub-mkstandalone: info: grub-mkimage --directory '/usr/lib/grub/x86_64-efi' --prefix '(memdisk)/boot/grub' --output '/tmp/rear.2oBsJUoHA8zsmQr/tmp/mnt/EFI/BOOT/BOOTX64.efi' --format 'x86_64-efi' --compression 'auto'  --memdisk '/tmp/grub.99zKVH' 'btrfs' 'fat' 'part_gpt' 'memdisk' 'tar'
    
  • Created sizes:

    • \EFI\BOOT directory: 7.9 MB
    • \EFI\BOOT\BOOTX64.efi: 5.4 MB
    • \EFI\BOOT\fonts: 2.4 MB

So it seems like grub-mkstandalone does not auto-include linuxefi.mod either but uses the modules present as command line arguments and adds 'memdisk' 'tar' as explained in the ArchWiki:

It is possible to create a grubx64_standalone.efi application which has all the modules embedded in a tar archive within the UEFI application, thus removing the need to have a separate directory populated with all of the GRUB UEFI modules and other related files. This is done using the grub-mkstandalone command (included in grub)

For reference, sizes created by OUTPUT=RAWDISK (using grub-mkimage directly):

  • With Grub:

    • EFI/BOOT/BOOTX64.EFI: 470K
  • With syslinux:

    • EFI/BOOT: 328K
    • EFI/BOOT/BOOTX64.EFI: 176K
    • EFI/BOOT/ldlinux.e64: 131K

jsmeix commented at 2020-06-09 07:36:

With https://github.com/rear/rear/pull/2420 merged
this issue is fixed.

@OliverO2
thank you for testing ReaR on Ubuntu 18.04 and 20.04,
for your issue reports, and especially for your prompt fixes!

OliverO2 commented at 2020-06-09 13:51:

@jsmeix As always, thanks for reviewing and coordinating!


[Export of Github issue for rear/rear.]