e2dd78d8f9
Instead of sanboot (which can't pass kernel params for automation), switch back to kernel/initrd boot. The ISO is embedded in the initrd as a CPIO append. A pxe-init wrapper script loop-mounts the ISO before handing off to the original init, so the installer finds it as a block device. Uses rdinit=/pxe-init kernel parameter. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
632 B
Go
23 lines
632 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 rdinit=/pxe-init initrd=initrd
|
|
echo Loading initrd (this may take a few minutes)...
|
|
initrd --name initrd %s
|
|
echo Booting...
|
|
boot
|
|
`, img.Name, kernelURL, initrdURL)
|
|
}
|