]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
boot: do not hard-code EFI stub architecture
authorLuca Boccassi <bluca@debian.org>
Sat, 20 Aug 2022 15:03:58 +0000 (16:03 +0100)
committerLuca Boccassi <bluca@debian.org>
Sat, 20 Aug 2022 15:26:43 +0000 (16:26 +0100)
mkosi/__init__.py

index b9fee1d458b2c3be75779ec1455e5580b87060f6..53126a159f4dce46e120397c88150cb5bdd384ee 100644 (file)
@@ -425,6 +425,15 @@ DEBIAN_KERNEL_ARCHITECTURES = {
     "s390x": "s390x",
 }
 
+# EFI has its own conventions too
+EFI_ARCHITECTURES = {
+    "x86_64": "x64",
+    "x86": "ia32",
+    "aarch64": "aa64",
+    "armhfp": "arm",
+    "riscv64:": "riscv64",
+}
+
 
 class GPTRootTypeTriplet(NamedTuple):
     root: uuid.UUID
@@ -4065,7 +4074,7 @@ def install_unified_kernel(
                 "--add-section", f".cmdline={cmdline}",   "--change-section-vma", ".cmdline=0x30000",
                 "--add-section", f".linux={root / kimg}", "--change-section-vma", ".linux=0x2000000",
                 "--add-section", f".initrd={initrd}",     "--change-section-vma", ".initrd=0x3000000",
-                root / "lib/systemd/boot/efi/linuxx64.efi.stub",
+                root / f"lib/systemd/boot/efi/linux{EFI_ARCHITECTURES[args.architecture]}.efi.stub",
                 boot_binary,
             ]