-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,35 @@ | ||
# This file was deployed by Puppet and is under Smart Proxy control. Click on | ||
# "Build PXE Default" button to overwrite it. Puppet is prevented managing this | ||
# file by default, this can be enforced via --foreman-proxy-tftp-replace-grub2-cfg | ||
# foreman-installer option or Puppet parameter. | ||
|
||
insmod regexp | ||
|
||
set net_pxe_mac=$net_default_mac | ||
# On Debian/Ubuntu grub2 does not have patch for loading MAC-based configs. 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 | ||
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_dashed=${m1}-${m2}-${m3}-${m4}-${m5}-${m6} | ||
mac=${m1}-${m2}-${m3}-${m4}-${m5}-${m6} | ||
configfile=/grub2/grub.cfg-01-$mac | ||
source "$configfile" | ||
|
||
# If MAC-specific config is not found, attempt to boot from local drive. | ||
|
||
default=local_chain_hd0 | ||
timeout=20 | ||
|
||
menuentry 'Chainload into BIOS bootloader on first disk' --id local_chain_hd0 { | ||
set root=(hd0,0) | ||
chainloader +1 | ||
} | ||
|
||
menuentry 'Chainload into BIOS bootloader on second disk' --id local_chain_hd1 { | ||
set root=(hd1,0) | ||
chainloader +1 | ||
} | ||
|
||
mac_configfile=$prefix/grub.cfg-01-$mac_dashed | ||
source "$mac_configfile" | ||
menuentry 'Third disk - for EFI or Discovery click on Build PXE Default'' --id local_chain_hd2 { | ||
set root=(hd2,0) | ||
chainloader +1 | ||
} |