#1780 PR merged: Fix 'Hah.IdontNeedEFI' case.

Labels: fixed / solved / done, minor bug

jsmeix opened issue at 2018-04-23 11:00:

jsmeix commented at 2018-04-23 12:34:

Right now I found out that I can test the 'Hah!IdontNeedEFI' case
because I do have a system with a GPT BIOS boot partition!

It is what YaST sets up by default as SLE15 when it runs on a BIOS machine
(in my case a virtual QEMU/KVM virtual machine).
I get GPT partitioning with BIOS so that a GPT BIOS boot partition is set up:

 # parted -s /dev/sda unit MiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 20480MiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start     End       Size      File system     Name  Flags
 1      1.00MiB   9.00MiB   8.00MiB                         bios_grub
 2      9.00MiB   18431MiB  18422MiB  ext4                  legacy_boot
 3      18431MiB  20480MiB  2049MiB   linux-swap(v1)        swap

# dd if=/dev/sda bs=512 count=4 2>/dev/null | strings
ZRr=
`|f
\|f1
GRUB 
Geom
Hard Disk
Read
 Error
EFI PART
Hah!IdontNeedEFI

This means in particular that the 'Hah!IdontNeedEFI' case will be
the common case when SLE15 is installed on a BIOS machine.

jsmeix commented at 2018-04-23 12:51:

On SUSE systems one gets (from layout/save/default/445_guess_bootloader.sh)

Using sysconfig bootloader 'grub2'

which is the right thing (we use GRUB2 on SLE15 not GRUB).

When I disable for a test the sysconfig bootloader detection
in layout/save/default/445_guess_bootloader.sh I get:

Using guessed bootloader 'GRUB' (found in first bytes on GPT BIOS boot partition /dev/sda)

which indicates the code works as intended.

That results 'GRUB' in var/lib/rear/recovery/bootloader
which likely goes wrong on SLES15 because actually GRUB2 is used
but that does not matter for SUSE systems because
at SUSE there is the right value in /etc/sysconfig/bootloader

LOADER_TYPE="grub2"

jsmeix commented at 2018-04-24 09:06:

https://github.com/rear/rear/pull/1780#issuecomment-383563712
shows that the LogPrint message in the 'Hah!IdontNeedEFI' case is not right

Using guessed bootloader 'GRUB' (found in first bytes on GPT BIOS boot partition /dev/sda)

because /dev/sda is the disk but not the GPT BIOS boot partition
so that I fixed that and the new LogPrint message in the 'Hah!IdontNeedEFI' case is

Using guessed bootloader 'GRUB' (found in first bytes on /dev/sda with GPT BIOS boot partition)

jsmeix commented at 2018-04-24 09:08:

@gdha
because things work well for my tests
I would like to merge it today if you do not object.

jsmeix commented at 2018-04-24 12:58:

Out of curiosity I tried "rear recover" for the special test case in
https://github.com/rear/rear/pull/1780#issuecomment-383563712
that results 'GRUB' in var/lib/rear/recovery/bootloader.

Fortunately that even works on my SLES15 system
and during "rear recover" I get

Skip installing GRUB Legacy boot loader because GRUB 2 is installed (grub-probe or grub2-probe exist).
Installing GRUB 2 boot loader

and the recreated system "just boots" and works for me.


[Export of Github issue for rear/rear.]