]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fix want_uki()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 9 Nov 2023 10:31:46 +0000 (11:31 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 9 Nov 2023 14:46:06 +0000 (15:46 +0100)
If we're building a UKI image, we always want a UKI regardless of
the other options.

mkosi/__init__.py

index 437eabd4b3bdfde25033fa3a22c353f61137a18b..8a9a4b6e6c6f07165dc7b4f6a7588cdf3f14ee39 100644 (file)
@@ -1318,18 +1318,19 @@ def want_uki(config: MkosiConfig) -> bool:
     # Note that this returns True also in the case where autodetection might later
     # cause the UKI not to be installed after the file system has been populated.
 
+    if config.output_format == OutputFormat.uki:
+        return True
+
     if config.bootable == ConfigFeature.disabled:
         return False
 
     if config.bootloader == Bootloader.none:
         return False
 
-    if (config.output_format in (OutputFormat.cpio, OutputFormat.uki) and
-        config.bootable == ConfigFeature.auto):
+    if config.output_format == OutputFormat.cpio and config.bootable == ConfigFeature.auto:
         return False
 
-    if (config.architecture.to_efi() is None and
-        config.bootable == ConfigFeature.auto):
+    if config.architecture.to_efi() is None and config.bootable == ConfigFeature.auto:
         return False
 
     return True
@@ -1342,7 +1343,7 @@ def install_uki(state: MkosiState, partitions: Sequence[Partition]) -> None:
     # benefit that they can be signed like normal EFI binaries, and can encode everything necessary to boot a
     # specific root device, including the root hash.
 
-    if not want_uki(state.config):
+    if not want_uki(state.config) or state.config.output_format == OutputFormat.uki:
         return
 
     arch = state.config.architecture.to_efi()