From: Daan De Meyer Date: Thu, 9 Nov 2023 10:31:46 +0000 (+0100) Subject: Fix want_uki() X-Git-Tag: v19~8^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dfd35c6ab48d81c0eefc258ff149170bfb324fc5;p=thirdparty%2Fmkosi.git Fix want_uki() If we're building a UKI image, we always want a UKI regardless of the other options. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 437eabd4b..8a9a4b6e6 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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()