Add automated PXE installation via ISO GRUB modification and auto-answer endpoint
Modifies uploaded ISO's GRUB config in-place to set timeout=0 and inject proxmox-start-auto-installer + answer-url kernel params, enabling fully hands-off installation. Adds /api/boot/auto-answer endpoint that identifies hosts by ARP-resolving the requester's IP to MAC address. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+3
-11
@@ -7,19 +7,11 @@ import (
|
||||
)
|
||||
|
||||
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)
|
||||
isoURL := fmt.Sprintf("%s/images/boot/%s", publicURL, img.ISOPath)
|
||||
|
||||
return fmt.Sprintf(`#!ipxe
|
||||
echo Provisioning: booting %s on ${mac}
|
||||
echo Connecting ISO via SAN...
|
||||
sanhook %s
|
||||
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, isoURL, kernelURL, initrdURL)
|
||||
echo Booting ISO...
|
||||
sanboot %s
|
||||
`, img.Name, isoURL)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user