Skip to content

Search for specific config files using UUID, MAC and IP

Javier Martinez Canillas grub-devel 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest5 patches 2 repliesIn review
  2. v55 patches 7 repliesSuperseded
  3. v45 patches 6 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v35 patches5 repliesSuperseded
v23 patches2 repliesSuperseded
v13 patches9 repliesSuperseded

Changes in v6 from the cover letter

- Allow the feature to be disabled by setting feature_net_search_cfg=n.
- Remove Reviewed-by tag from Daniel Kiper since the patch #4 changed.
- Explain in the GRUB manual that the feature is enabled by default and how can be disabled by setting a variable in an embedded configuration file.

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5Add %X option to printf functionsgrub-core/kern/misc.c+5 -20 replies
2/5net/dhcp: Consistently use decimal numbers for DHCP/BOOTP options enuminclude/grub/net.h+9 -90 replies
3/5net/dhcp: Set net_<interface>_client{id, uuid} variables from DHCP optionsgrub-core/net/bootp.c include/grub/net.h+46 -80 replies
4/5normal/main: Search for specific config files for netbootgrub-core/net/net.c grub-core/normal/main.c include/grub/net.h+155 -41 reply
5/5docs: Update info with grub.cfg netboot selection orderdocs/grub.texi+51 -01 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchDaniel Kiper
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/5] Search for specific config files using UUID, MAC and IP

Hello,

This is a v6 of a series that have been carried in Fedora (and other distros) for a long time. It allows to fetch GRUB configurations that are customized to each machine by using the client UUID, MAC and IP as grub.cfg suffixes.

The procedure is similar to what is used by pxelinux and yaboot, i.e:
http://www.syslinux.org/wiki/index.php/PXELINUX#config

Patch #1 adds a %X format specifier to make the grub_printf() function more similar to printf() and not require to use %x plus grub_toupper().

Patch #2 is just a cleanup of the bootp/dhcp options enum to consistently use hexadecimal numbers for all the values.

Patch #3 sets net_<interface>_client{id,uuid} environment variables by using the DHCP client ID and UUID options if these are found.

Patch #4 adds the support to fetch the config files using the UUID, MAC and IP as suffixes. If these aren't found, the default GRUB config filename is used as a fallback.

Patch #5 adds documentation that specifies the order netboot clients use to select a GRUB configuration file and explains how the feature can be disabled.

Best regards,
Javier

Changes in v6:
- Allow the feature to be disabled by setting feature_net_search_cfg=n.
- Remove Reviewed-by tag from Daniel Kiper since the patch #4 changed.
- Explain in the GRUB manual that the feature is enabled by default and how can be disabled by setting a variable in an embedded configuration file.

Changes in v5:
- Add Reviewed-by from Daniel Kiper to patch #2.
- Don't mix variable declaration and code.
- Don't initialize variable without need.
- Check for memory allocation failure.
- Add missing grub_free().
- Don't mix varible declarations and code.
- Don't use variable length arrays.
- Fix coding style issues.
- Fix function prototype.
- Include missing <grub/net.h> header.
- Add Reviewed-by tag from Daniel Kiper to patch #5.

Changes in v4:
- Use decimal instead of hexadecimal numbers to be consistent with RFC 2132.
- Mention that the UUID is unique to the machine and not the NIC and also refer to the RFC 4578 where the client UUID DHCP option is specified.

Changes in v3:
- Add patch to cleanup bootp/dhcp options enum.
- Use decimal numbers for the newly added DHCP client ID and UUID options.
- Add Reviewed-by tag from Daniel Kiper.
- Add a patch documenting the grub.cfg netboot selection order.

Changes in v2:
- Put patch that adds the %X format specifier first in the series.
- Use the existing grub_env_set_net_property() and remove duplicated code.

Javier Martinez Canillas (1):
net/dhcp: Consistently use decimal numbers for DHCP/BOOTP options enum

Paulo Flabiano Smorigo (3):
Add %X option to printf functions
net/dhcp: Set net_<interface>_client{id,uuid} variables from DHCP
options
normal/main: Search for specific config files for netboot

Robert Marshall (1):
docs: Update info with grub.cfg netboot selection order

 docs/grub.texi          |  51 ++++++++++++++++
 grub-core/kern/misc.c   |   7 ++-
 grub-core/net/bootp.c   |  52 +++++++++++++---
 grub-core/net/net.c     | 131 ++++++++++++++++++++++++++++++++++++++++
 grub-core/normal/main.c |  26 ++++++--
 include/grub/net.h      |  22 ++++---
 6 files changed, 266 insertions(+), 23 deletions(-)
Signature · 1 line
2.24.1