#1848 PR merged: Fixed, simplified and enhanced GRUB2 installation for PPC64/PPC64LE

Labels: enhancement, bug, documentation, cleanup, fixed / solved / done

jsmeix opened issue at 2018-07-02 12:25:

Fixed, simplified and enhanced GRUB2 installation for PPC64/PPC64LE

Enhanced GRUB2 installation by the new config variable
GRUB2_INSTALL_DEVICES so that now the user can specify
what he wants if needed.

Aligned code in finalize/Linux-ppc64le/620_install_grub2.sh
with the code in finalize/Linux-i386/620_install_grub2.sh
as far as I could from plain looking at the code
without actual knowledge about PPC64/PPC64LE.

jsmeix commented at 2018-07-02 12:31:

@schabrolles
I made this pull request somewhat 'blindly' only by plain looking at the code
without actual knowledge about PPC64/PPC64LE specific things
because I have no PPC64/PPC64LE systems for testing.

Therefore I ask you for a very careful review of my changes here.

Please also test if it works to specify GRUB2_INSTALL_DEVICES
on PPC64/PPC64LE systems as described in default.conf.

In particular I run now in any case

# Generate GRUB configuration file anew to be on the safe side (this could be even mandatory in MIGRATION_MODE):
if ! chroot $TARGET_FS_ROOT /bin/bash --login -c "$grub_name-mkconfig -o /boot/$grub_name/grub.cfg" ; then
    LogPrintError "Failed to generate boot/$grub_name/grub.cfg in $TARGET_FS_ROOT - trying to install GRUB2 nevertheless"
fi

I don't know if GRUB2 setup also is done in this way on PPC64/PPC64LE.
Cf. https://github.com/rear/rear/issues/1828#issuecomment-398717889
how the SUSE GRUB2 maintainer told me how to set up GRUB2 in general
but perhaps his instructions are only meant for x86 compatible architecture?

jsmeix commented at 2018-07-02 14:39:

The last commit here
https://github.com/rear/rear/pull/1848/commits/f23c601857a9b8e6cb08892b1e3b67257ad5314a
is intended to fix https://github.com/rear/rear/issues/1847
via the new is_completely_identical_layout_mapping function
that detects a completely identical mapping and is used
to not run the apply_layout_mappings function
when there is a completely identical mapping.
This particular commit functionality was tested by me on SLES15.

jsmeix commented at 2018-07-12 10:52:

According to
https://github.com/rear/rear/issues/1828#issuecomment-404449224
my changes in this pull request should be o.k. - at least in theory -
"In theory, theory and practice are the same. In practice, they are not."

jsmeix commented at 2018-07-12 10:55:

@schabrolles
if you don't find time to review and test it
I think I could merge it nevertheless because
https://github.com/rear/rear/issues/1828#issuecomment-404449224
indicates I didn't do things totally wrong
so that I would dare to merge it and see
how things behave in the real world "out there".

jsmeix commented at 2018-07-16 07:43:

I will merge it soon today...

schabrolles commented at 2018-07-16 10:06:

@jsmeix, Ok for me ... I did not find the time to have a look to your code, but I tested it on my system with rhel7.4 and sles12sp3 => looks OK.

output snippet:

[...]
Installing GRUB2 boot loader on PPC64/PPC64LE...
Determining where to install GRUB2 (no GRUB2_INSTALL_DEVICES specified)
Found PPC PReP boot partition /dev/mapper/mpatha1 - installing GRUB2 there
PPC PReP Boot partition found: /dev/mapper/mpatha1
Boot device disk is /dev/mapper/mpatha.
Limiting bootlist to 5 entries...
Set LPAR bootlist to /dev/sdv /dev/sds /dev/sdj /dev/sdg /dev/sdp
Finished recovering your system. You can explore it under '/mnt/local'.
Exiting rear recover (PID 9238) and its descendant processes
Running exit tasks
[...]

jsmeix commented at 2018-07-16 11:31:

@schabrolles
thank you so much for your test on a real POWER system.
It shows at least that I didn't introduce a generic regression.


[Export of Github issue for rear/rear.]