]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
mkosi: hook up i386 gpt pt types 795/head
authorLennart Poettering <lennart@poettering.net>
Tue, 7 Sep 2021 19:50:35 +0000 (21:50 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 8 Sep 2021 07:25:23 +0000 (09:25 +0200)
Let's actually hook up the i386 gpt pt types to be used.

(This uses the list of known uname machine fields we use in systemd:
https://github.com/systemd/systemd/blob/main/src/basic/architecture.c#L32
)

mkosi/__init__.py

index 5c3f91e3975910926c5e5da50b0af5e171dfb294..f74ca81f21d64398d647f2c929c9aca65fee246e 100644 (file)
@@ -331,7 +331,9 @@ def gpt_root_native(arch: Optional[str], usr_only: bool = False) -> GPTRootTypeP
         arch = platform.machine()
 
     if usr_only:
-        if arch == "x86_64":
+        if arch in ("i386", "i486", "i586", "i686"):
+            return GPTRootTypePair(GPT_USR_X86, GPT_USR_X86_VERITY)
+        elif arch == "x86_64":
             return GPTRootTypePair(GPT_USR_X86_64, GPT_USR_X86_64_VERITY)
         elif arch == "aarch64":
             return GPTRootTypePair(GPT_USR_ARM_64, GPT_USR_ARM_64_VERITY)
@@ -340,7 +342,9 @@ def gpt_root_native(arch: Optional[str], usr_only: bool = False) -> GPTRootTypeP
         else:
             die(f"Unknown architecture {arch}.")
     else:
-        if arch == "x86_64":
+        if arch in ("i386", "i486", "i586", "i686"):
+            return GPTRootTypePair(GPT_ROOT_X86, GPT_ROOT_X86_VERITY)
+        elif arch == "x86_64":
             return GPTRootTypePair(GPT_ROOT_X86_64, GPT_ROOT_X86_64_VERITY)
         elif arch == "aarch64":
             return GPTRootTypePair(GPT_ROOT_ARM_64, GPT_ROOT_ARM_64_VERITY)