GRUB_RESCUE=y now works with UEFI based systems #954
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello all,
I've managed to find (hopefully) universal solution to boot ReaR on UEFI based systems without endless (and as I've learned pointless) chasing after grub.cfg when GRUB_RESCUE=y
The idea behind this pull request is simple:
Don't modify grub.cfg but rather create separate UEFI boot entry.
UEFI "Relax-and-Recover" boot entry motivation:
If UEFI boot is in use, we will not modify grub.cfg, but setup "Relax-and-Recover" entry in UEFI boot menu instead. This looks to be simplest and safest approach since finding out what mechanisms were used to boot OS in UEFI mode, looks to be near to impossible.
One could argue that efibootmgr/efivars can tell you, however this entry is not mandatory and OS could be booted using default values or startup.nsh.
Once UEFI loads Grub2 hell breaks loose, as Grub2 can load whatever arbitrary configuration file anywhere on the system or configuration file can be even embedded in bootx64.efi (and friends) as file or memdisk. Unfortunately there seems to be no reliable way how to track this back.
This code should work regardless on distribution or whether you have Secure Boot enabled or not.
I did testing on:
Hope it will prove useful in the future...
V.