Serve full ISO for PXE boot via proxmox-iso-url kernel param
The Proxmox installer needs the full ISO to access packages and installer data. Previously the ISO was deleted after extracting kernel+initrd. Now we keep it as original.iso and serve it via HTTP. The iPXE script passes proxmox-iso-url=<url> so the installer fetches the ISO over the network instead of scanning block devices. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
type ExtractResult struct {
|
||||
KernelFilename string
|
||||
InitrdFilename string
|
||||
ISOFilename string
|
||||
}
|
||||
|
||||
type ProgressFunc func(stage string, detail string)
|
||||
@@ -33,22 +34,21 @@ func ExtractFromISOWithProgress(r io.Reader, destDir string, progress ProgressFu
|
||||
|
||||
report("receiving", "Writing ISO to disk...")
|
||||
|
||||
tmp, err := os.CreateTemp(filepath.Dir(destDir), "iso-upload-*.tmp")
|
||||
isoPath := filepath.Join(destDir, "original.iso")
|
||||
tmp, err := os.Create(isoPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("create temp file: %w", err)
|
||||
return nil, fmt.Errorf("create ISO file: %w", err)
|
||||
}
|
||||
tmpPath := tmp.Name()
|
||||
defer os.Remove(tmpPath)
|
||||
|
||||
if _, err := io.Copy(tmp, r); err != nil {
|
||||
tmp.Close()
|
||||
return nil, fmt.Errorf("write ISO to temp file: %w", err)
|
||||
return nil, fmt.Errorf("write ISO to disk: %w", err)
|
||||
}
|
||||
tmp.Close()
|
||||
|
||||
report("parsing", "Parsing ISO image...")
|
||||
|
||||
f, err := os.Open(tmpPath)
|
||||
f, err := os.Open(isoPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("open temp ISO: %w", err)
|
||||
}
|
||||
@@ -102,6 +102,7 @@ func ExtractFromISOWithProgress(r io.Reader, destDir string, progress ProgressFu
|
||||
return &ExtractResult{
|
||||
KernelFilename: kernelName,
|
||||
InitrdFilename: initrdName,
|
||||
ISOFilename: "original.iso",
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user