]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(install.d): do not create initramfs if the supplied image is UKI
authorVitaly Kuznetsov <vkuznets@redhat.com>
Tue, 19 Sep 2023 15:36:37 +0000 (17:36 +0200)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Sat, 28 Oct 2023 00:09:00 +0000 (20:09 -0400)
When the supplied kernel image is a UKI, there's no point in creating
initramfs as the UKI has it built-in already. This is the situation when
dracut.install is called for a distro shipped UKI.

Note, KERNEL_INSTALL_IMAGE_TYPE == "uki" is different from
KERNEL_INSTALL_LAYOUT == "uki", the later can be used to create UKI upon
installing a standard kernel image.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
install.d/50-dracut.install

index 476506052a102ff5fdcfb8e0fe41b8d5a7f205c2..441414ac3259d7508651ca54e9ae02d46e7b67be 100755 (executable)
@@ -11,6 +11,11 @@ if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then
     exit 0
 fi
 
+# Do not attempt to create initramfs if the supplied image is already a UKI
+if [[ "$KERNEL_INSTALL_IMAGE_TYPE" = "uki" ]]; then
+    exit 0
+fi
+
 # Mismatching the install layout and the --uefi/--no-uefi opts just creates a mess.
 if [[ $KERNEL_INSTALL_LAYOUT == "uki" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then
     BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA"