#3128 PR open: BugError when GRUB Legacy is used

Labels: cleanup, discuss / RFC

jsmeix opened issue at 2024-01-15 11:41:

  • Type: Cleanup

  • Impact: Low
    Hopefully even no impact because I hope
    nobody uses current ReaR on a system
    that uses GRUB Legacy as bootloader

  • Reference to related issue (URL):
    https://github.com/rear/rear/issues/3127

  • How was this pull request tested?

"rear mkrescue" still works for me on openSUSE Leap 15.5
I get

Using sysconfig bootloader 'grub2' for 'rear recover'

so I have GRUB2 in var/lib/rear/recovery/bootloader

  • Description of the changes in this pull request:

In layout/save/default/450_check_bootloader_files.sh
BugError when GRUB Legacy is used as bootloader
so we get user reports when GRUB Legacy is still used

jsmeix commented at 2024-01-15 13:01:

Curently some tests fail exactly because of those changes
e.g. for testing-farm:fedora-rawhide-x86_64
https://artifacts.dev.testing-farm.io/55919d6e-3281-433e-8354-9bd79d1654bc/
shows (excerpts)

2024-01-15 11:49:08.634649608 Using guessed bootloader 'GRUB' for 'rear recover' (found in first bytes on /dev/nvme0n1 with GPT BIOS boot partition)
...
2024-01-15 11:49:08.654153523 ERROR: 
                              ====================
                              BUG in /usr/share/rear/layout/save/default/450_check_bootloader_files.sh line 21:
                              GRUB Legacy is no longer supported

@pcahyna
do you perhaps know what is going on here?
Does "fedora-rawhide" really still use GRUB Legacy
or is GRUB in first bytes on /dev/nvme0n1 a false positive?
See the code in layout/save/default/445_guess_bootloader.sh

pcahyna commented at 2024-01-15 14:07:

@jsmeix I will have a look. I am about to change this file anyway because of other issues.

jsmeix commented at 2024-01-18 12:52:

@pcahyna
if the guessed bootloader 'GRUB' is a false guess
could you specify BOOTLOADER in local.conf
at least as band aid for now
so that those tests do no longer fail
and I could then merge this pull request?

pcahyna commented at 2024-01-18 13:07:

@jsmeix please don't. This change would break all Fedora and RHEL versions on machines using BIOS. (EDIT: By this I mean it would force all users to specify BOOTLOADER in local.conf.)

I investigated the situation and will send you a PR that corrects the code, please stay tuned. Sorry for the delay.

pcahyna commented at 2024-01-18 13:11:

@jsmeix by the way, I suppose there is still /etc/sysconfig/bootloader that specifies the correct bootloader on the SUSE Linux versions where you tested, right? If so that's why you have not seen the problem in your tests.

pcahyna commented at 2024-01-18 13:20:

I hope nobody uses current ReaR on a system
that uses GRUB Legacy as bootloader

Note that this drops support for RHEL 6, CentOS 6 and Scientific Linux 6:
https://github.com/rear/rear.github.com/blob/master/documentation/release-notes-2-7.md#supported-and-unsupported-operating-systems

jsmeix commented at 2024-01-18 15:06:

@pcahyna
regarding your
https://github.com/rear/rear/pull/3128#issuecomment-1898447831

Don't worry.
I will not merge it as long as it breaks things.

You could do a review in GitHub and "request changes"
to make it obvious for others that it must not be merged
in its current state.

pcahyna commented at 2024-01-18 18:44:

You could do a review in GitHub and "request changes"
to make it obvious for others that it must not be merged
in its current state.

I considered it, but I don't have any specific changes to request beyond the general "fix the failure", which would be a much larger work than this PR, and it is more efficient if I do it in a separate PR, as I have studied the code in detail already.

@jsmeix could you please mark the PR as Draft?

By the way, I am glad that our CI done by @antonvoznia is showing real benefits :-)

jsmeix commented at 2024-01-19 07:31:

@pcahyna @antonvoznia
yes, I am also glad to see that the CI you implemented
proves to have real benefits - again thank you for that!

In particular for this pull request I did not expect
that the change here could have a real negative effect.
I had the false assumption that SUSE SLES is the only
Linux distribution where really old stuff still exists
like ELILO that is still there in SLES15, cf.
https://github.com/rear/rear/issues/3127

jsmeix commented at 2024-01-19 07:33:

@pcahyna
does Red Hat still need support for RHEL 6
in current ReaR master code?
Or can we drop support for RHEL 6, CentOS 6 and Scientific Linux 6
for the next ReaR 2.8 release?

jsmeix commented at 2024-01-19 07:44:

@pcahyna regarding your
https://github.com/rear/rear/pull/3128#issuecomment-1898454337

Yes, see my initial description
https://github.com/rear/rear/pull/3128#issue-2081858314

"rear mkrescue" still works for me on openSUSE Leap 15.5
I get

Using sysconfig bootloader 'grub2' for 'rear recover'

so I have GRUB2 in var/lib/rear/recovery/bootloader

cf. the code around
https://github.com/rear/rear/blob/rear-2.7/usr/share/rear/layout/save/default/445_guess_bootloader.sh#L19

pcahyna commented at 2024-01-19 09:41:

@jsmeix sorry, I should have read the message more carefully, as it already indicates where the code got the value from.

Since SUSE continues to use /etc/sysconfig/bootloader, do you please know what will the file contain on hybrid EFI/BIOS installations? It is possible to install a system so that it boots correctly both with BIOS and with UEFI, and such system has effectively two bootloaders: one in the MBR and one as a file in the EFI System Partition. My main motivation for changing this code is to support this scenario and fixing the issue we are seeing will be a side effect. I would like to have a solution that works on SUSE if possible, but for this I would need to know how such a SUSE system looks like.

jsmeix commented at 2024-01-19 13:11:

@pcahyna
currently I neither know what /etc/sysconfig/bootloader
contains on SUSE hybrid EFI/BIOS installations
nor whether a hybrid EFI/BIOS installation is supported
with the SUSE installer YaST.
For answering this question I need some time.

jsmeix commented at 2024-01-22 10:13:

@pcahyna
I asked a colleague and he told me that
a hybrid EFI/BIOS installation is
neither supported with the SUSE installer YaST
nor is it officially suppoted by SUSE for SLES.

On my openSUSE Leap 15.5
/etc/sysconfig/bootloader contains (all its content):

## Path:        System/Bootloader
## Description: Bootloader configuration
## Type:        list(grub,grub2,grub2-efi,none)
## Default:     grub2
#
# Type of bootloader in use.
# For making the change effect run bootloader configuration tool
# and configure newly selected bootloader
#
#
LOADER_TYPE="grub2"

## Path:        System/Bootloader
## Description: Bootloader configuration
## Type:        yesno
## Default:     "no"
#
# Enable UEFI Secure Boot support
# This setting is only relevant to UEFI which supports Secure Boot. It won't
# take effect on any other firmware type.
#
#
SECURE_BOOT="yes"

## Path:        System/Bootloader
## Description: Bootloader configuration
## Type:        yesno
## Default:     "no"
#
# Enable Trusted Boot support
# Only available for legacy (non-UEFI) boot.
#
TRUSTED_BOOT="no"

## Path:        System/Bootloader
## Description: Bootloader configuration
## Type:        yesno
## Default:     "yes"
#
# Update nvram boot settings (UEFI, OF)
# Unset to preserve specific settings or workaround firmware issues.
#
UPDATE_NVRAM="yes"

So in particular LOADER_TYPE must be one of

grub
grub2
grub2-efi
none

[Export of Github issue for rear/rear.]