treewide: use architecture-specific UEFI boot path
The default UEFI boot path depends on the architecture. This change is
needed for aarch64 support.
Change-Id: I69916ac5063e963b67ecdcdd814b0678c61da9fb
Reviewed-on: https://review.monogon.dev/c/monogon/+/4195
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/installer/test/run_test.go b/metropolis/installer/test/run_test.go
index 5008be0..bba323f 100644
--- a/metropolis/installer/test/run_test.go
+++ b/metropolis/installer/test/run_test.go
@@ -27,6 +27,7 @@
"source.monogon.dev/osbase/build/mkimage/osimage"
"source.monogon.dev/osbase/cmd"
"source.monogon.dev/osbase/oci"
+ ociosimage "source.monogon.dev/osbase/oci/osimage"
"source.monogon.dev/osbase/structfs"
)
@@ -59,6 +60,7 @@
// installerImage is a filesystem path pointing at the installer image that
// is generated during the test, and is removed afterwards.
installerImage string
+ bootPath string
)
// runQemu starts a new QEMU process, expecting the given output to appear
@@ -124,9 +126,9 @@
return fmt.Errorf("couldn't read the installer ESP: %w", err)
}
// Make sure the EFI payload exists by attempting to open it.
- efiPayload, err := fs.OpenFile("/"+osimage.EFIPayloadPath, os.O_RDONLY)
+ efiPayload, err := fs.OpenFile("/"+bootPath, os.O_RDONLY)
if err != nil {
- return fmt.Errorf("couldn't open the installer's EFI Payload at %q: %w", osimage.EFIPayloadPath, err)
+ return fmt.Errorf("couldn't open the installer's EFI Payload at %q: %w", bootPath, err)
}
efiPayload.Close()
return nil
@@ -145,6 +147,15 @@
log.Fatal(err)
}
+ osImage, err := ociosimage.Read(image)
+ if err != nil {
+ log.Fatal(err)
+ }
+ bootPath, err = osimage.EFIBootPath(osImage.Config.ProductInfo.Architecture())
+ if err != nil {
+ log.Fatal(err)
+ }
+
iargs := mctl.MakeInstallerImageArgs{
Installer: installer,
TargetPath: installerImage,