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/main.go b/metropolis/installer/main.go
index baf9cc8..20a8240 100644
--- a/metropolis/installer/main.go
+++ b/metropolis/installer/main.go
@@ -186,6 +186,7 @@
 			// whenever it's writing to block devices, such as now.
 			Data: 128,
 		},
+		Architecture:   osImage.Config.ProductInfo.Architecture(),
 		SystemImage:    systemImage,
 		EFIPayload:     efiPayload,
 		ABLoader:       structfs.Bytes(abloader),
diff --git a/metropolis/installer/test/BUILD.bazel b/metropolis/installer/test/BUILD.bazel
index 903f46e..d68f78a 100644
--- a/metropolis/installer/test/BUILD.bazel
+++ b/metropolis/installer/test/BUILD.bazel
@@ -25,6 +25,7 @@
         "//osbase/build/mkimage/osimage",
         "//osbase/cmd",
         "//osbase/oci",
+        "//osbase/oci/osimage",
         "//osbase/structfs",
         "@com_github_diskfs_go_diskfs//:go-diskfs",
         "@com_github_diskfs_go_diskfs//disk",
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,