Pre-can iPXE with a script that tries and tries to netboot forever#47
Pre-can iPXE with a script that tries and tries to netboot forever#47
Conversation
📝 WalkthroughWalkthroughAdds a new iPXE DHCPv6 HTTP boot script Changes
Sequence DiagramsequenceDiagram
participant Script as iPXE Script
participant Iface as Network Interface
participant DHCPv6 as DHCPv6 Server
participant BootSvr as Boot Server
participant Loader as EFI Loader
loop for each interface (net0, net1, ...)
Script->>Iface: reset / bring up
Script->>Iface: wait for link (timeout)
Iface-->>Script: link status
Script->>DHCPv6: request IPv6 (SLAAC/DHCPv6)
DHCPv6-->>Script: IPv6 address + boot-uri (or none)
Script->>Script: verify boot-uri / fallback vars
Script->>BootSvr: chain-load from boot-uri
alt chain load succeeds
BootSvr-->>Loader: deliver boot image
Loader-->>Script: boot continues
else chain load fails
Script->>Script: log failure, continue
end
end
alt all interfaces exhausted
Script->>Script: wait (retry delay) and retry all interfaces
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
This should catch issues with the network etc. that cause iPXE to fail and sends the system into the BIOS.
Flake lock file updates:
• Updated input 'nixpkgs':
'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.907002%2Brev-f61125a668a320878494449750330ca58b78c557/019af28f-4a47-7f68-a9d7-f6f6e905b8ab/source.tar.gz' (2025-12-05)
→ 'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.931542%2Brev-88d3861acdd3d2f0e361767018218e51810df8a1/019be60b-f6ea-74ec-ab74-e960f412a787/source.tar.gz' (2026-01-21)
930180f to
7d18de9
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@ipxe/dhcpv6-httpboot.ipxe`:
- Around line 165-170: The cleanup loop using close_idx and idx (labels
close_loop, variables close_idx and idx, and the check ifclose net${close_idx})
can spin forever when idx == 0; change the logic to first skip the loop when idx
== 0 and then iterate closing only existing interfaces by using ifclose
net${close_idx} as the loop terminator rather than relying solely on the
counter. Concretely: add an initial guard that exits the cleanup when ${idx} is
zero, and rewrite the close_loop so each iteration checks ifclose
net${close_idx} and breaks when no interface exists, otherwise closes
net${close_idx} and increments close_idx until it reaches the counted limit
(idx) or ifclose signals no more interfaces.
- Around line 69-76: Before running IPv6 configuration in the configure_ipv6
section, clear any existing boot URI variables to avoid stale values across
interfaces: explicitly unset or empty the variables boot-uri, bootfile-url, and
filename prior to the ifconf --configurator ipv6 --timeout ${dhcp_timeout}
${nic} call so each interface starts with a clean state; locate the
configure_ipv6 label and the ifconf invocation to add the variable clears there
(referencing boot-uri, bootfile-url, filename, and the ifconf command).
cole-h
left a comment
There was a problem hiding this comment.
I'm going to assume you've tested this and it works
|
sure |
This should catch issues with the network etc. that cause iPXE to fail and sends the system into the BIOS.
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.