third_party/edk2: use toolchain-bundle for edk2 build

This moves the build into a custom rule instead of a genrule.
This also adds the AARCH64 build and renames the files to be more
generic

Change-Id: If6e3cecaf4011e2e39f13b1d40bcc7060cee3afb
Reviewed-on: https://review.monogon.dev/c/monogon/+/4154
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/cli/takeover/e2e/BUILD.bazel b/metropolis/cli/takeover/e2e/BUILD.bazel
index 4098904..d01812e 100644
--- a/metropolis/cli/takeover/e2e/BUILD.bazel
+++ b/metropolis/cli/takeover/e2e/BUILD.bazel
@@ -8,14 +8,14 @@
         "//metropolis/cli/metroctl:metroctl_lite",
         "//metropolis/cli/takeover",
         "//metropolis/installer/test/testos:testos_image",
-        "//third_party/edk2:OVMF_CODE.fd",
-        "//third_party/edk2:OVMF_VARS.fd",
+        "//third_party/edk2:CODE.fd",
+        "//third_party/edk2:VARS.fd",
         "@debian_11_cloudimage//file",
     ],
     x_defs = {
         "xImagePath": "$(rlocationpath //metropolis/installer/test/testos:testos_image )",
-        "xOvmfVarsPath": "$(rlocationpath //third_party/edk2:OVMF_VARS.fd )",
-        "xOvmfCodePath": "$(rlocationpath //third_party/edk2:OVMF_CODE.fd )",
+        "xOvmfVarsPath": "$(rlocationpath //third_party/edk2:VARS.fd )",
+        "xOvmfCodePath": "$(rlocationpath //third_party/edk2:CODE.fd )",
         "xCloudImagePath": "$(rlocationpath @debian_11_cloudimage//file )",
         "xTakeoverPath": "$(rlocationpath //metropolis/cli/takeover )",
         "xMetroctlPath": "$(rlocationpath //metropolis/cli/metroctl:metroctl_lite )",
diff --git a/metropolis/installer/test/BUILD.bazel b/metropolis/installer/test/BUILD.bazel
index 8aab4b4..8c6bc8d 100644
--- a/metropolis/installer/test/BUILD.bazel
+++ b/metropolis/installer/test/BUILD.bazel
@@ -9,14 +9,14 @@
         ":kernel",
         "//build/toolchain/toolchain-bundle:qemu-kvm",
         "//metropolis/installer/test/testos:testos_image",
-        "//third_party/edk2:OVMF_CODE.fd",
-        "//third_party/edk2:OVMF_VARS.fd",
+        "//third_party/edk2:CODE.fd",
+        "//third_party/edk2:VARS.fd",
     ],
     importpath = "source.monogon.dev/metropolis/installer/test",
     visibility = ["//visibility:private"],
     x_defs = {
-        "xOvmfVarsPath": "$(rlocationpath //third_party/edk2:OVMF_VARS.fd )",
-        "xOvmfCodePath": "$(rlocationpath //third_party/edk2:OVMF_CODE.fd )",
+        "xOvmfVarsPath": "$(rlocationpath //third_party/edk2:VARS.fd )",
+        "xOvmfCodePath": "$(rlocationpath //third_party/edk2:CODE.fd )",
         "xInstallerPath": "$(rlocationpath :kernel )",
         "xImagePath": "$(rlocationpath //metropolis/installer/test/testos:testos_image )",
         "xQEMUPath": "$(rlocationpath //build/toolchain/toolchain-bundle:qemu-kvm )",
diff --git a/metropolis/node/core/update/e2e/BUILD.bazel b/metropolis/node/core/update/e2e/BUILD.bazel
index cd4bef9..0bc7652 100644
--- a/metropolis/node/core/update/e2e/BUILD.bazel
+++ b/metropolis/node/core/update/e2e/BUILD.bazel
@@ -5,8 +5,8 @@
     srcs = ["e2e_test.go"],
     data = [
         # For emulation
-        "//third_party/edk2:OVMF_CODE.fd",
-        "//third_party/edk2:OVMF_VARS.fd",
+        "//third_party/edk2:CODE.fd",
+        "//third_party/edk2:VARS.fd",
         # For the initial image creation
         "//metropolis/node/core/update/e2e/testos:testos_image_x",
         "//metropolis/node/abloader",
@@ -19,8 +19,8 @@
         "xImageXPath": "$(rlocationpath //metropolis/node/core/update/e2e/testos:testos_image_x )",
         "xImageYPath": "$(rlocationpath //metropolis/node/core/update/e2e/testos:testos_image_y )",
         "xImageZPath": "$(rlocationpath //metropolis/node/core/update/e2e/testos:testos_image_z )",
-        "xOvmfVarsPath": "$(rlocationpath //third_party/edk2:OVMF_VARS.fd )",
-        "xOvmfCodePath": "$(rlocationpath //third_party/edk2:OVMF_CODE.fd )",
+        "xOvmfVarsPath": "$(rlocationpath //third_party/edk2:VARS.fd )",
+        "xOvmfCodePath": "$(rlocationpath //third_party/edk2:CODE.fd )",
         "xAbloaderPath": "$(rlocationpath //metropolis/node/abloader )",
         "xQEMUPath": "$(rlocationpath //build/toolchain/toolchain-bundle:qemu-kvm )",
     },
diff --git a/metropolis/test/launch/BUILD.bazel b/metropolis/test/launch/BUILD.bazel
index c03da7d..b2530c5 100644
--- a/metropolis/test/launch/BUILD.bazel
+++ b/metropolis/test/launch/BUILD.bazel
@@ -20,8 +20,8 @@
         "//metropolis/test/swtpm/certtool",
         "//metropolis/test/swtpm/swtpm_cert",
         "//osbase/test/ktest:linux-testing",
-        "//third_party/edk2:OVMF_CODE.fd",
-        "//third_party/edk2:OVMF_VARS.fd",
+        "//third_party/edk2:CODE.fd",
+        "//third_party/edk2:VARS.fd",
         "@swtpm",
         "@swtpm//:swtpm_localca",
         "@swtpm//:swtpm_setup",
@@ -35,8 +35,8 @@
         "xSwtpmCertPath": "$(rlocationpath //metropolis/test/swtpm/swtpm_cert )",
         "xCerttoolPath": "$(rlocationpath //metropolis/test/swtpm/certtool )",
         "xMetroctlPath": "$(rlocationpath //metropolis/cli/metroctl:metroctl_lite )",
-        "xOvmfVarsPath": "$(rlocationpath //third_party/edk2:OVMF_VARS.fd )",
-        "xOvmfCodePath": "$(rlocationpath //third_party/edk2:OVMF_CODE.fd )",
+        "xOvmfVarsPath": "$(rlocationpath //third_party/edk2:VARS.fd )",
+        "xOvmfCodePath": "$(rlocationpath //third_party/edk2:CODE.fd )",
         "xKernelPath": "$(rlocationpath //osbase/test/ktest:linux-testing )",
         "xInitramfsPath": "$(rlocationpath //metropolis/test/nanoswitch:initramfs )",
         "xNodeImagePath": "$(rlocationpath //metropolis/node:oci_image_uncompressed )",
diff --git a/metropolis/test/launch/cluster.go b/metropolis/test/launch/cluster.go
index d2bbb4b..af15564 100644
--- a/metropolis/test/launch/cluster.go
+++ b/metropolis/test/launch/cluster.go
@@ -322,7 +322,7 @@
 	}
 
 	tpmSocketPath := filepath.Join(r.sd, "tpm-socket")
-	fwVarPath := filepath.Join(r.ld, "OVMF_VARS.fd")
+	fwVarPath := filepath.Join(r.ld, "VARS.fd")
 	storagePath := filepath.Join(r.ld, "image.img")
 	qemuArgs := []string{
 		"-machine", "q35",