m/installer/install: take OCI image in Params
install.Params now takes an OCI image. This avoids some duplicate code
to extract info from the OCI image in all places which create
install.Params.
Change-Id: I2430ce1101befaa1b1a4781f592d06ee015a0f99
Reviewed-on: https://review.monogon.dev/c/monogon/+/4297
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/cli/takeover/install.go b/metropolis/cli/takeover/install.go
index 4d42269..d58d89c 100644
--- a/metropolis/cli/takeover/install.go
+++ b/metropolis/cli/takeover/install.go
@@ -73,24 +73,13 @@
return nil, fmt.Errorf("failed to read OS image: %w", err)
}
- efiPayload, err := osImage.Payload("kernel.efi")
- if err != nil {
- return nil, fmt.Errorf("cannot open EFI payload in OS image: %w", err)
- }
- systemImage, err := osImage.Payload("system")
- if err != nil {
- return nil, fmt.Errorf("cannot open system image in OS image: %w", err)
- }
-
return &install.Params{
PartitionSize: install.PartitionSizeInfo{
ESP: 384,
System: 4096,
Data: 128,
},
- Architecture: osImage.Config.ProductInfo.Architecture(),
- SystemImage: systemImage,
- EFIPayload: efiPayload,
+ OSImage: osImage,
ABLoader: structfs.Bytes(abloader),
NodeParameters: structfs.Bytes(metropolisSpecRaw),
Output: rootDev,