Project

General

Profile

Bug #27550

Generate grub2 config also in grub2/grub.cfg-aa:bb:cc:dd:ee:ff form

Added by Lukas Zapletal 11 months ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Category:
TFTP
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Grub2 on non-Red Hat systems does not automatically load per-MAC configuration files. We simulated that behavior using a hack:

# To load MAC-based config explicitly, a MAC address separated by dash chars is needed.
# Also due to bug in RHEL 7.4 files are loaded with an extra ":" character at the end.
# This workarounds both cases, make sure "regexp.mod" file is present on the TFTP.
# For more info see: https://bugzilla.redhat.com/show_bug.cgi?id=1370642#c70
insmod regexp
regexp --set=1:m1 --set=2:m2 --set=3:m3 --set=4:m4 --set=5:m5 --set=6:m6 '^([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})\: +([0-9a-f]{1,2})\:([0-9a-f]{1,2})\:([0-9a-f]{1,2})' "$net_default_mac" 
mac=${m1}-${m2}-${m3}-${m4}-${m5}-${m6}
configfile=/grub2/grub.cfg-01-$mac
source "$configfile" 

I have found this hack no longer works in HTTP UEFI Boot mode. It's much cleaner to generate the configuration filename in expected way than doing this terrible hack, so this ticket is adding additional file generated by TFTP module. Now two are generated for PXEGrub2:

  • "grub2/grub.cfg-01-aa-bb-cc-dd-ee-ff"
  • "grub2/grub.cfg-aa:bb:cc:dd:ee:ff" (this one is new)

The hack can be now simplified to:

source "/grub2/grub.cfg-$net_default_mac" 

Associated revisions

Revision 7d0053a5 (diff)
Added by Lukas Zapletal 11 months ago

Fixes #27550 - grub2 native config files

History

#1 Updated by The Foreman Bot 11 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/smart-proxy/pull/670 added

#2 Updated by The Foreman Bot 11 months ago

  • Fixed in Releases 1.24.0 added

#3 Updated by Ewoud Kohl van Wijngaarden 11 months ago

  • Target version set to 1.24.0

#4 Updated by Anonymous 11 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF