#2283 PR merged: Currently, ReaR is using hard-coded set of Grub2 modules for UEFI

Labels: enhancement, cleanup, fixed / solved / done

gozora opened issue at 2019-11-22 21:42:

Pull Request Details:
  • Type: Enhancement

  • Impact: Low

  • Reference to related issue (URL): N/A

  • How was this pull request tested?
    Full backup && restore

  • Brief description of the changes in this pull request:
    Currently, ReaR is using hard-coded set of Grub2 modules for UEFI
    boot-loader. This patch introduces global GRUB2_MODULES variable, so
    that user can add or remove modules according his needs.

Rationale:
If one uses GRUB_RESCUE=y in UEFI mode (yet another nice combination :-)), rear.efi will be created with different set of modules compared to BOOTX64.efi.

It is not so important for user to have possibility to add/remove Grub2 modules to BOOTX64.efi because BOOTX64.efi serves mainly for ReaR recovery system and doesn't need to be changed that much. rear.efi on the other hand might need some modification from time-to-time.

In my particular example, I was not able to boot rear.efi because I was using BTRFS on LVM (don't ask me why, I know it is nasty ;-)), and rear.efi was not able to boot because lvm module was missing. For this reason I think there should be possibility to configure what modules should be included into *.efi boot-loaders.

I'd like to use this PR as corner stone for my future PR that will unify way how_rear.efi_ and BOOTX64.efi are created and what modules are they using.

V.

pcahyna commented at 2019-11-22 23:18:

Hello, FYI I would like to revisit this code in next few days (try some of the approaches that I proposed in https://github.com/rear/rear/pull/2199#issuecomment-518201001)

gozora commented at 2019-11-23 08:44:

Hello @pcahyna,

I'm happy to accept any solution that will make ReaR rescue system boot simpler or better, although I don't really believe that it can be done in any automatic way.

If this PR conflicts in any way with your work, I can of course withdraw it. Just let me know.

V.

jsmeix commented at 2019-11-25 08:40:

@gozora
could you also describe in default.conf more explicitly
where the Grub2 based UEFI boot loader is used.

At least I get almost always confused about which bootloader
this or that bootloader related stuff in ReaR is about.

Is it the bootloader of the ReaR recovery system
or the bootloader of the recreated target system
or both?

As far as I see in this case the build_bootx86_efi function
is only called in output/ISO/Linux-i386/250_populate_efibootimg.sh
which indicates in this case the Grub2 based UEFI boot loader
is (only) the bootloader of the ReaR recovery system.

gozora commented at 2019-11-25 21:29:

Hello @jsmeix,

Many thanks for your review!
I've adapted PR according your request and added some extra bit ;-).

When time allows, I'll do some additional cleaning in 100_create_efiboot.sh which is another spot where Grub2 module set is hard coded.

V.

pcahyna commented at 2019-12-08 22:30:

My promised PR is #2293, please review. One thing that it changes from this PR is that it makes GRUB2_MODULES a bash array.
@gozora I believe that the added autodetection in #2293 fixes your case "In my particular example, I was not able to boot rear.efi because I was using BTRFS on LVM (don't ask me why, I know it is nasty ;-)), and rear.efi was not able to boot because lvm module was missing." without the need of setting anything special in GRUB2_MODULES, please try it if you want.
I haven't looked yet at 100_create_efiboot.sh .


[Export of Github issue for rear/rear.]