]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
kernel-install/60-ukify: do not rebuild existing UKIs
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 25 Mar 2024 10:18:25 +0000 (11:18 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 25 Mar 2024 18:01:30 +0000 (03:01 +0900)
In case kernel-install is called to install what's already a UKI, 60-ukify
must be skipped. E.g. when distro shipped and signed UKI is being installed,
it is counter-productive to try to rebuild it with ukify. Also, the existing
script is not ready to handle UKIs with embedded initramfs.

Note, it is already possible to disable 60-ukify by setting
KERNEL_INSTALL_UKI_GENERATOR to something but in case it is not set, 60-ukify
assumes it should run.

src/kernel-install/60-ukify.install.in

index 3611737962c4af70c74472fe1012d4d7e09b7a05..e08455b1560213a1c6bc861a3ad1ca3fd172707b 100755 (executable)
@@ -109,6 +109,12 @@ def parse_args(args=None):
     return opts
 
 def we_are_wanted() -> bool:
+    KERNEL_INSTALL_IMAGE_TYPE = os.getenv('KERNEL_INSTALL_IMAGE_TYPE')
+
+    if KERNEL_INSTALL_IMAGE_TYPE == 'uki':
+        log('The image being installed is already a UKI, quitting.')
+        return False
+
     KERNEL_INSTALL_LAYOUT = os.getenv('KERNEL_INSTALL_LAYOUT')
 
     if KERNEL_INSTALL_LAYOUT != 'uki':