Project

General

Profile

Actions

Bug #27550

closed

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

Added by Lukas Zapletal over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Category:
TFTP
Target version:
Difficulty:
Triaged:
Yes
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" 
Actions #1

Updated by The Foreman Bot over 4 years ago

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

Updated by The Foreman Bot over 4 years ago

  • Fixed in Releases 1.24.0 added
Actions #3

Updated by Ewoud Kohl van Wijngaarden over 4 years ago

  • Target version set to 1.24.0
Actions #4

Updated by Anonymous over 4 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF