#1262 PR merged: First attempt to implement BOOTLOADER support

Labels: enhancement, cleanup, fixed / solved / done

jsmeix opened issue at 2017-03-24 14:17:

Currently onyl FYI so that you can have a look
my first attempt to implement BOOTLOADER support, cf.
https://github.com/rear/rear/issues/1242#issuecomment-288349895

Currently it is not tested.

I think there could be some missing alignment between
prep/default/500_guess_bootloader.sh
and
layout/save/default/450_check_bootloader_files.sh

When someone uses the grand new "FancyBoot" bootloader,
setting BOOTLOADER="FancyBoot" in default.conf won't help him
as long as there is no support for that in ReaR.

But setting BOOTLOADER is not meant this way.

Setting BOOTLOADER is only meant so that the user
can - if needed - (i.e. when autodetection fails for him)
enforce ReaR to set up during "rear recover" one of
the supported bootloaders i.e. one of what is listed in
layout/save/default/450_check_bootloader_files.sh

jsmeix commented at 2017-03-24 14:18:

Currently BOOTLOADER is intentionally
not yet described in default.conf.

jsmeix commented at 2017-03-24 15:00:

I did some very first tests and it seems to work o.k for me.

jsmeix commented at 2017-03-27 08:50:

@gdha
wow!
You just merged it.
I think it should be o.k. regardless that I did only some very first tests.
If issues or even regressions appear because of it
I will fix them of course!

jsmeix commented at 2017-03-27 09:41:

ReaR fails perfectly well with an unsupported BOOTLOADER value:

# grep BOOTLOADER etc/rear/local.conf
BOOTLOADER="grubby"

# usr/sbin/rear -d -D mkrescue
...
ERROR: 
====================
BUG in /root/rear/usr/share/rear/layout/save/default/450_check_bootloader_files.sh:
'Unknown bootloader (GRUBBY) - ask for sponsoring to get this fixed'
...

jsmeix commented at 2017-03-27 11:05:

Surprisingly it even works on my SLE12 system
where I actually use Grub2
with a false BOOTLOADER="grub":

# grep BOOTLOADER etc/rear/local.conf
BOOTLOADER="grub"

# usr/sbin/rear -d -D mkbackup
...
Using specified bootloader 'grub'

but during "rear recover" it does automatically "the right thing"

RESCUE e205:~ # rear -d -D recover
...
Skip installing GRUB Legacy boot loader because GRUB 2 is installed (grub-probe or grub2-probe exist).
Installing GRUB2 boot loader
Finished recovering your system. You can explore it under '/mnt/local'.
RESCUE e205:~ #

and the recreated system boots fine.

jsmeix commented at 2017-03-27 11:10:

Of course it also still works for me on SLE12 with Grub2 and BIOS
with the empty default BOOTLOADER="" so that I now think
this pull request really looks o.k. (at least as far as I can see).


[Export of Github issue for rear/rear.]