Files
bootapi-templates/ipxe/boot.ipxe.tmpl
T
unkinben ee81dd9e51
ci/woodpecker/push/pre-commit Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/push/validate Pipeline was successful
ci/woodpecker/pr/validate Pipeline was successful
Add inst.ks.sendmac to the iPXE boot script
Cobbler's per-MAC gPXE script passed inst.ks.sendmac, making anaconda send its
interface MACs as X-RHN-Provisioning-MAC-N headers when fetching the kickstart.
The bootapi iPXE script omitted it, so it was not a full drop-in for Cobbler's
gpxe output.

- Emit inst.ks.sendmac immediately before inst.ks= in the boot iPXE template,
  matching Cobbler ordering.

Claude-Session: https://claude.ai/code/session_01JUoARVdmhxKQHyyyp1pxeT
2026-08-06 22:19:32 +10:00

23 lines
1.2 KiB
Cheetah

{{- /*
iPXE boot script for a known, PXE-enabled host. Chains the OS installer
kernel+initrd (from the distro catalog) and points inst.ks= back at bootapi's
/ks/<host> over plain HTTP, so an installer with no internal-CA trust can fetch
it. Mirrors how Cobbler generated a per-MAC gPXE script carrying inst.ks=.
KernelURL/InitrdURL/RepoURL come from the selected catalog entry (artifactapi
remote); KernelArgs are the catalog's extra args. KickstartURL uses
BOOTAPI_BASE_URL (http://). inst.ks.sendmac makes anaconda send its interface
MACs as X-RHN-Provisioning-MAC-N headers when fetching the kickstart (Cobbler
parity; lets /ks resolve a host by MAC as well as by name).
*/ -}}
#!ipxe
echo bootapi: provisioning {{ .FQDN }} ({{ .Platform }})
{{ if and .KernelURL .InitrdURL -}}
kernel {{ .KernelURL }} initrd=initrd.img{{ if .RepoURL }} inst.repo={{ .RepoURL }}{{ end }} inst.ks.sendmac inst.ks={{ .KickstartURL }} ip=dhcp{{ range .KernelArgs }} {{ . }}{{ end }}
initrd {{ .InitrdURL }}
boot
{{- else -}}
echo bootapi: no boot images resolved for {{ .Platform }} (no catalog entry / BOOTAPI_BOOT_BASE_URL); booting local disk
sanboot --no-describe --drive 0x80 || exit
{{- end }}