44c358a89b
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>
23 lines
585 B
Go
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)
|
|
}
|