Skip to content

Commit

Permalink
fix(install.d): skip if dracut is not the initrd or UKI generator
Browse files Browse the repository at this point in the history
Preparation work to avoid interfering with other initrd generators.
  • Loading branch information
aafeijoo-suse committed May 3, 2024
1 parent 8875b31 commit 713db05
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion install.d/50-dracut.install
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -48,6 +55,8 @@ else
BOOT_DIR_ABS="/boot"
IMAGE="initrd-${KERNEL_VERSION}"
fi
else
exit 0
fi

ret=0
Expand Down

0 comments on commit 713db05

Please sign in to comment.