Use sanhook to expose ISO as block device during kernel/initrd boot
build-and-push / test (push) Successful in 35s
build-and-push / build-and-push (push) Successful in 1m12s

The CPIO-embedded initrd approach failed (too large for iPXE memory).
Instead, use iPXE's sanhook to connect the ISO as a SAN block device
before booting with kernel/initrd. The installer finds the ISO on the
SAN device while we retain control over kernel parameters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-14 14:09:12 -04:00
parent e2dd78d8f9
commit 994152bedf
2 changed files with 7 additions and 20 deletions
+6 -3
View File
@@ -9,14 +9,17 @@ 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 rdinit=/pxe-init initrd=initrd
echo Loading initrd (this may take a few minutes)...
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)
`, img.Name, isoURL, kernelURL, initrdURL)
}