Files
Provisioning/internal/pxe/ipxe.go
T
josh 4774600040
build-and-push / test (push) Successful in 34s
build-and-push / build-and-push (push) Successful in 1m7s
Add boot image management with ISO extraction and serving
Upload Proxmox ISOs via API or dashboard UI, extract kernel+initrd
using pure-Go iso9660 library, store on disk, and serve over HTTP
for PXE booting. Dynamic kernel/initrd filenames per image replace
the previous hardcoded paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-09 21:26:31 -04:00

20 lines
449 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}
kernel %s vga=791 video=vesafb:lfb:on
initrd %s
boot
`, img.Name, kernelURL, initrdURL)
}