#1339 PR merged: Allow "grub PXE style" for non x86 platform.

Labels: enhancement, fixed / solved / done

schabrolles opened issue at 2017-05-02 08:58:

Some non x86 platform (like ppc64/ppc64le) does not support native PXE boot. Some document recommend to use GRUB as a PXE alternative. (https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-installation-server-setup.html#sect-network-boot-setup-ppc-grub2)

I would like to propose this possibility in ReaR as an addition to the standard PXE.

  • This alternative way to use "Grub PXE" server will be controlled by a new boolean variable : PXE_CONFIG_GRUB_STYLE
  • a New make_pxelinux_config_grub function to create the grub compatible boot menu.
  • Like PXE, when the client is looking at its MAC address or IP (in hex) on the config directory of the TFTP server. But file should be like this : grub.cfg-<MAC or IP>.
  • gethostip is part of syslinux (which is not available on PPC, may be some tool limited to x86...) I use a workaround based on printf when gethostip is not available

Here is an example of a local.conf

OUTPUT=PXE
OUTPUT_PREFIX_PXE=rear/$HOSTNAME
PXE_CONFIG_GRUB_STYLE=y
PXE_CONFIG_URL="nfs://10.7.19.177/var/lib/tftpboot/boot/grub2/powerpc-ieee1275"
PXE_CREATE_LINKS=IP
PXE_REMOVE_OLD_LINKS=y
PXE_TFTP_URL="nfs://10.7.19.177/var/lib/tftpboot"

BACKUP=NETFS
BACKUP_URL="nfs://10.7.19.177/rear"

tested successfully with RedHat 6, RedHat 7, Sles 11, Sles 12 on ppc64/ppc64le

Like usual, feedback/review welcomed

schlomo commented at 2017-05-02 09:12:

Nice addition. I was actually already thinking about switching to Grub2 for all our boot loader needs.

jsmeix commented at 2017-05-02 10:50:

@schabrolles
please explain all new variables in default.conf
that are meant to be set by the user in local.conf
(like your new PXE_CONFIG_GRUB_STYLE).

gdha commented at 2017-05-02 11:29:

@schabrolles Just out of curiosity - did you try it on x86 platforms as well?

schabrolles commented at 2017-05-02 11:38:

No, I don't have any x86 available ...

schlomo commented at 2017-05-02 11:44:

@schabrolles in a Virtual Machine on your desktop / laptop? Or is that also PPC64?

gdha commented at 2017-05-02 11:50:

@schabrolles Just comment the new variable in default.conf and the pull request is ready for being merged.

schabrolles commented at 2017-05-02 13:33:

@gdha I use a PXE_LINK_PREFIX variable to add "grub.cfg-" on configuration file generated only when we are using PXE_GRUB_STYLE.

But this variable PXE_LINK_PREFIX is local. May be I should name it in lower case ... What do you think ?

gdha commented at 2017-05-02 13:45:

@schabrolles when PXE_LINK_PREFIX is a local variable meant for PXE_GRUB_STYLE then I would rename it to PXE_GRUB_LINK_PREFIX to make it very clear and I would add it the default.conf file to have at least a brief description on what it is used for (over a couple of months I wouldn't know anymore)
@jsmeix @schlomo Do you agree?

jsmeix commented at 2017-05-02 14:06:

When PXE_LINK_PREFIX is a local variable
meant for PXE_GRUB_STYLE then I would
name it pxe_grub_link_prefix according to
https://github.com/rear/rear/wiki/Coding-Style

jsmeix commented at 2017-05-02 14:09:

The idea behind is that commands like

find . | xargs grep -i 'PXE_GRUB_'

could be used to 'grep' over the whole code and get a correct
overview what actually belongs to a particular "thingy".

schabrolles commented at 2017-05-02 14:22:

@gdha, I named it PXE_LINK_PREFIX because it can be used by any PXE type (legacy or grub).
For legacy PXE, PXE_LINK_PREFIX is empty, but it must be PXE_LINK_PREFIX="grub.cfg-" for grub style PXE.

@jsmeix, right now I think we can keep PXE_LINK_PREFIX local and not global... So I should rename it to pxe_link_prefix

gdha commented at 2017-05-02 14:32:

@schabrolles Are we all set to merge?

schabrolles commented at 2017-05-02 14:36:

@gdha From my point of view, yes .... But may be @jsmeix or @schlomo would like to add or change something ...

schabrolles commented at 2017-05-03 10:09:

@gdha ... Wait, I may be find a bug ... let me more time to investigate.

jsmeix commented at 2017-05-04 12:35:

@schabrolles
is it now o.k. to be merged from your point of view?

schabrolles commented at 2017-05-04 13:24:

Yep... look good, I made additional test by swapping different config ... it is now stable.

jsmeix commented at 2017-05-04 13:51:

@gdha
if you do not object, I will merge it soon...

jsmeix commented at 2017-05-04 14:29:

@schabrolles
again many thanks for your various contributions
that improve ReaR in particular on PPC architecture!

jsmeix commented at 2018-08-16 14:30:

In
https://github.com/rear/rear/issues/1899#issuecomment-413564261
I wonder why in conf/examples/RHEL7-PPC64LE-Mulitpath-PXE-GRUB.conf
there is (excerpt)

AUTOEXCLUDE_MULTIPATH=n
BOOT_OVER_SAN=y

but neither SAN nor multipath was mentioned here.
I.e. I wonder how PXE based on GRUB2 booting on PPC64/PPC64LE
is interconnected with BOOT_OVER_SAN and multipath.

jsmeix commented at 2018-08-17 09:49:

@schabrolles explained it in
https://github.com/rear/rear/issues/1899#issuecomment-413777499


[Export of Github issue for rear/rear.]