Skip to content

Conversation

@gozora
Copy link
Member

@gozora gozora commented Aug 7, 2016

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:

  • SUSE Linux Enterprise Server 12 SP1 (Secure boot)
  • Debian GNU/Linux 8.4 (jessie)
  • CentOS Linux release 7.2.1511 (Secure boot)

Hope it will prove useful in the future...

V.

@jsmeix jsmeix added the enhancement Adaptions and new features label Aug 8, 2016
@jsmeix jsmeix assigned jsmeix and gdha Aug 8, 2016
@jsmeix jsmeix added this to the Rear v1.19 milestone Aug 8, 2016
@jsmeix
Copy link
Member

jsmeix commented Aug 8, 2016

@gdha
regarding UEFI I fully trust @gozora and
because he tested it on SLES, Debian, and CentOS
I would just accept it for Rear 1.19
provided @gdha you agree.

@gozora
in particular I like your "quite long comment" very much!

@jsmeix
Copy link
Member

jsmeix commented Aug 8, 2016

@gozora
I assume in case of UEFI support for
GRUB_RESCUE_USER does not make sense.
If my assumption is right I would document in default.conf
that GRUB_RESCUE_USER is only supported for GRUB2
with Legacy BIOS booting.

@gozora
Copy link
Member Author

gozora commented Aug 8, 2016

@jsmeix yes, that is correct for this version of code.
If there is a need for it in the future, I can implement password authentication.
Should not be that hard...

@jsmeix
Copy link
Member

jsmeix commented Aug 9, 2016

I consider no exited objection from @gdha until now
as tacit consent so that I merge it now.

@gdha gdha merged commit 737868d into rear:master Aug 9, 2016
jsmeix added a commit that referenced this pull request Aug 9, 2016
…_not_supported_for_UEFI_issue954

document that GRUB_RESCUE_USER is not supported for UEFI
in conf/default.conf
and some changes to prepare 94_grub2_rescue.sh
for set -eu (cf. #700)
this enhances #954
jsmeix added a commit that referenced this pull request May 4, 2021
Add references to #954 for the UEFI case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adaptions and new features fixed / solved / done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants