Files
Provisioning/internal/pxe/ipxe.go
T
josh 44c358a89b
build-and-push / test (push) Successful in 34s
build-and-push / build-and-push (push) Successful in 1m14s
Fix initrd loading with explicit iPXE name binding
iPXE needs --name on the initrd command and initrd=<name> on the
kernel line to properly pass the initrd to the kernel. Without this,
the kernel never receives the initrd, causing VFS mount failure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-14 11:03:03 -04:00

23 lines
585 B
Go

package pxe
import (
"fmt"
"provisioning/internal/model"
)
func BuildIPXEScript(publicURL string, img *model.Image, mac string) string {
kernelURL := fmt.Sprintf("%s/images/boot/%s", publicURL, img.KernelPath)
initrdURL := fmt.Sprintf("%s/images/boot/%s", publicURL, img.InitrdPath)
return fmt.Sprintf(`#!ipxe
echo Provisioning: booting %s on ${mac}
echo Loading kernel...
kernel %s ramdisk_size=16777216 vga=791 video=vesafb:lfb:on rw quiet splash=verbose initrd=initrd
echo Loading initrd...
initrd --name initrd %s
echo Booting...
boot
`, img.Name, kernelURL, initrdURL)
}