Bug 873406 - Add ability to autoload grub2's config file when netbooting
Add ability to autoload grub2's config file when netbooting
Product: Fedora
Classification: Fedora
Component: grub2 (Show other bugs)
ppc64 All
unspecified Severity urgent
: ---
: ---
Assigned To: Peter Jones
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-11-05 14:06 EST by IBM Bug Proxy
Modified: 2012-12-06 02:25 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-12-06 02:25:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
[PATCH 1/3] Add %X option to printf functions. (1.64 KB, patch)
2012-11-27 14:45 EST, Paulo Flabiano Smorigo
no flags Details | Diff
[PATCH 2/3] DHCP client ID and UUID options added. (3.47 KB, patch)
2012-11-27 14:46 EST, Paulo Flabiano Smorigo
no flags Details | Diff
[PATCH 3/3] Search for specific config file for netboot (6.22 KB, patch)
2012-11-27 14:46 EST, Paulo Flabiano Smorigo
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
IBM Linux Technology Center 86537 None None None 2012-11-05 14:06:44 EST

  None (edit)
Description IBM Bug Proxy 2012-11-05 14:06:43 EST
== Comment: #0 - Brent J. Baude <baude@us.ibm.com> - 2012-11-05 13:40:08 ==
+++ This bug was initially created as a clone of Bug #80686 +++

Similar to yaboot and pxelinux, grub2 network boot needs to auto load a config file. A few things that we need to fix:

1. net_bootp must default to the network we loaded grub2 off. RIght now it seems to default to the last network card. We need to use the info in boot-device to find the correct interface.

2. We need to load a machine specific config file over tftp. The algorithm used by both yaboot and pxelinux can be found at:

Comment 1 IBM Bug Proxy 2012-11-05 15:00:35 EST
------- Comment From baude@us.ibm.com 2012-11-05 19:53 EDT-------
Original response from Paulo below:

I made a patch to do the pxe config. The procedure looks for the following files, just like pxe/yaboot do:


After talking with GRUB2 maintainer about it, he suggested to put a script inside grub.cfg to do this job. I made one with the content:

source "$configfile"


for c in 1 2 3 4; do
source "$configfile"
regexp --set=ip '^(.*)\..+$' "$ip"

It searches:

Do you think this approach is good?
What do you think about use IP as decimal?
Comment 2 Paulo Flabiano Smorigo 2012-11-27 14:45:02 EST
Created attachment 653057 [details]
[PATCH 1/3]  Add %X option to printf functions.
Comment 3 Paulo Flabiano Smorigo 2012-11-27 14:46:04 EST
Created attachment 653058 [details]
[PATCH 2/3] DHCP client ID and UUID options added.
Comment 4 Paulo Flabiano Smorigo 2012-11-27 14:46:44 EST
Created attachment 653059 [details]
[PATCH 3/3] Search for specific config file for netboot
Comment 5 Paulo Flabiano Smorigo 2012-11-27 14:49:07 EST
Those patches implement a search for a specific configuration when the config
file is on a remote server. It uses the following order:
   1) DHCP client UUID option.
   2) MAC address (in lower case hexadecimal with dash separators);
   3) IP (in upper case hexadecimal) or IPv6;
   4) The original grub.cfg file.

This procedure is similar to what is used by pxelinux and yaboot:
Comment 6 Fedora Update System 2012-11-27 15:36:06 EST
grub2-2.00-13.fc18 has been submitted as an update for Fedora 18.
Comment 7 Fedora Update System 2012-11-27 21:12:14 EST
Package grub2-2.00-13.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing grub2-2.00-13.fc18'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 8 Fedora Update System 2012-12-06 02:25:42 EST
grub2-2.00-13.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.