From 713db05ea78cccc7e0c31d3c804d60f58aabc0a9 Mon Sep 17 00:00:00 2001 From: Antonio Alvarez Feijoo Date: Fri, 3 May 2024 09:03:51 +0200 Subject: [PATCH] fix(install.d): skip if dracut is not the initrd or UKI generator Preparation work to avoid interfering with other initrd generators. --- install.d/50-dracut.install | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/install.d/50-dracut.install b/install.d/50-dracut.install index 19027416b4..3c3a28f49c 100755 --- a/install.d/50-dracut.install +++ b/install.d/50-dracut.install @@ -17,6 +17,13 @@ if [[ $KERNEL_INSTALL_IMAGE_TYPE == "uki" ]]; then exit 0 fi +# Skip this plugin if we're using a different generator. If nothing is specified, +# assume we're wanted since we're installed. +if [[ ${KERNEL_INSTALL_INITRD_GENERATOR:-dracut} != "dracut" ]] \ + && [[ ${KERNEL_INSTALL_UKI_GENERATOR:-dracut} != "dracut" ]]; 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" @@ -39,7 +46,7 @@ elif [[ $KERNEL_INSTALL_LAYOUT == "bls" && -n $KERNEL_INSTALL_STAGING_AREA ]]; t else exit 0 fi -else +elif [[ ${KERNEL_INSTALL_INITRD_GENERATOR:-dracut} == "dracut" ]]; then # No layout information, use users --uefi/--no-uefi preference UEFI_OPTS="" if [[ -d $BOOT_DIR_ABS ]]; then @@ -48,6 +55,8 @@ else BOOT_DIR_ABS="/boot" IMAGE="initrd-${KERNEL_VERSION}" fi +else + exit 0 fi ret=0