#2420 PR merged: Fix #2419: RAWDISK output fails to boot with Grub 2 on UEFI

Labels: enhancement, bug, fixed / solved / done

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

Pull Request Details:
  • Type: Bug Fix

  • Impact: Normal

  • Reference to related issue (URL): #2419

  • How was this pull request tested? On Ubuntu 18.04.4 LTS and 20.04 LTS

  • Brief description of the changes in this pull request:

    • RAWDISK output: Add distribution-specific module 'linuxefi.mod' to Grub

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

@rear/contributors
because this change affects only OUTPUT=RAWDISK
and because it was tested by @OliverO2
I would like to merge it tomorrow morning
if there are no objections.

gozora commented at 2020-06-08 08:01:

@OliverO2
In general this PR looks OK to me.

Only for the future, it might be good idea to unite Grub2 UEFI code also for OUTPUT=RAWDISK . With https://github.com/rear/rear/commit/c67e24d32c09a86ca98733c2f2399f428e6ce071 @pcahyna introduced code for this purpose. Maybe it would be worth a wile to check if it would be usable also for OUTPUT=RAWDISK. Some example code can be found in 250_populate_efibootimg.sh.

V.

pcahyna commented at 2020-06-08 09:23:

@gozora I would like to unify the code with my previous GRUB changes, but I don't have time for it now - @yontalcar do you want to have a look?

OliverO2 commented at 2020-06-08 09:27:

@gozora Actually, I've tried to use build_bootx86_efi in my attempt to fix this. Unfortunately, I was unable to make it work right away.

OliverO2 commented at 2020-06-08 10:25:

@pcahyna @yontalcar Some ideas from my side if build_bootx86_efi were to be used universally.

RAWDISK output is not just used to create a recovery image. It is also used to create a pre-boot-authentication system to unlock self-encrypting disks. Such a system must be pretty small (less than 128 MB) and boot quickly, silently and nicely (with a plymouth graphical splash if available). So in this case a minimal set of grub modules is required, the only file system support needed is GPT/FAT, but relevant video modes must be usable.

Using build_bootx86_efi would replace just one line in usr/share/rear/output/RAWDISK/Linux-i386/270_create_grub2_efi_bootloader.sh:

    $grub2_name-mkimage -O x86_64-efi -o "$boot_loader" -p "/EFI/BOOT" "${grub_modules[@]}"

Would that be worth it? If you think so, could you consider including some documentation in build_bootx86_efi making some guarantees about its invocation (parameters, global variables, behavior) so that it is easier to use and things don't change unexpectedly later on?


[Export of Github issue for rear/rear.]