Skip to content

fix: inject BOOTIF kernel param from requesting MAC at bootscript serve time#78

Open
j0hnL wants to merge 1 commit into
mainfrom
fix/inject-bootif-from-requesting-mac
Open

fix: inject BOOTIF kernel param from requesting MAC at bootscript serve time#78
j0hnL wants to merge 1 commit into
mainfrom
fix/inject-bootif-from-requesting-mac

Conversation

@j0hnL
Copy link
Copy Markdown

@j0hnL j0hnL commented May 26, 2026

Checklist

  • My code follows the style guidelines of this project
  • I have added/updated comments where needed
  • I have added tests that prove my fix is effective or my feature works
  • I have run make test (or equivalent) locally and all tests pass
  • DCO Sign-off: All commits are signed off (git commit -s) with my real name and email
  • REUSE Compliance:
    • Each new/modified source file has SPDX copyright and license headers
    • Any non-commentable files include a <filename>.license sidecar
    • All referenced licenses are present in the LICENSES/ directory

Description

On multi-NIC servers booted via BSS, dracut receives ip=dhcp with no BOOTIF parameter. It sends DHCP on all interfaces and configures whichever responds first, which may not be the PXE boot NIC. This breaks cloud-init (wrong IP) and network configuration at boot time. BSS currently leaves it to admins to hardcode BOOTIF at the boot layer in stored params, which is error-prone and difficult to do generically for a group.

Fix

buildParams() already injects xname=, nid=, and ds= dynamically at serve time using checkParam(). This PR adds BOOTIF to that list.

The requesting MAC is available in BootscriptGet() from ?mac=<mac>. It's threaded into scriptParams and injected as BOOTIF=01-<mac> in buildParams().

Behavior

  • Single-NIC nodes: BOOTIF is harmless, dracut confirms the only interface
  • Multi-NIC nodes: dracut correctly identifies the PXE boot interface
  • Operators with explicit BOOTIF in stored params: checkParam() skips
    injection, no duplicate, no override
  • Nodes fetched by ?name= or ?nid= without MAC: no injection (safe guard)

How to use this:

# you can now set this explicitly per node in stored params
ochami bss boot params set -d '{
  "macs": ["aa:bb:cc:dd:ee:ff"],
  "params": "ip=dhcp bond=bond0:eno1,eno2:mode=1,miimon=100 ip=bond0:dhcp"
}'

Fixes #(issue) did not open issue.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

For more info, see Contributing Guidelines.

…ve time

When a node fetches its bootscript via GET /boot/v1/bootscript?mac=<mac>,
BSS already has the requesting MAC available. On multi-NIC servers, dracut
sends DHCP on all interfaces without BOOTIF, causing it to configure the
wrong NIC.

This change injects BOOTIF=01-<mac> dynamically using the same checkParam()
mechanism already used for xname=, nid=, and ds=. checkParam() skips
injection if BOOTIF already exists in stored params, so operators who set
it explicitly retain control.

Nodes fetching by ?name= or ?nid= without a MAC get no BOOTIF injection
(mac is empty string, guard prevents injection).

Fixes: multi-NIC PXE boot failures where cloud-init configures the wrong
network interface.

Signed-off-by: John Lockman <j.lockman@dell.com>
@j0hnL j0hnL requested a review from alexlovelltroy May 26, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants