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
+1 -17
View File
@@ -53,24 +53,8 @@ func (s *Service) Upload(ctx context.Context, p UploadParams) (*model.Image, err
return nil, fmt.Errorf("extract ISO: %w", err)
}
report := func(stage, detail string) {
if p.OnProgress != nil {
p.OnProgress(stage, detail)
}
}
report("packaging", "Creating PXE boot image (embedding ISO in initrd)...")
origInitrdPath := filepath.Join(destDir, result.InitrdFilename)
origISOPath := filepath.Join(destDir, result.ISOFilename)
pxeInitrdFile := "initrd-pxe.img"
pxeInitrdPath := filepath.Join(destDir, pxeInitrdFile)
if err := CreatePXEInitrd(origInitrdPath, origISOPath, pxeInitrdPath); err != nil {
os.RemoveAll(destDir)
return nil, fmt.Errorf("create PXE initrd: %w", err)
}
kernelPath := filepath.Join(p.Name, result.KernelFilename)
initrdPath := filepath.Join(p.Name, pxeInitrdFile)
initrdPath := filepath.Join(p.Name, result.InitrdFilename)
isoPath := filepath.Join(p.Name, result.ISOFilename)
id, err := s.Store.Create(ctx, model.Image{