Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(install.d): skip if dracut is not the initrd or UKI generator #329

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions install.d/50-dracut.install
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then
fi

# Do not attempt to create initramfs if the supplied image is already a UKI
if [[ "$KERNEL_INSTALL_IMAGE_TYPE" = "uki" ]]; then
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

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
4 changes: 2 additions & 2 deletions install.d/51-dracut-rescue.install
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fi
[[ -n $PRETTY_NAME ]] || PRETTY_NAME="Linux $KERNEL_VERSION"

SORT_KEY="$IMAGE_ID"
[[ -z "$SORT_KEY" ]] && SORT_KEY="$ID"
[[ -z $SORT_KEY ]] && SORT_KEY="$ID"

if [[ ${KERNEL_INSTALL_MACHINE_ID+x} ]]; then
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
Expand Down Expand Up @@ -142,7 +142,7 @@ case "$COMMAND" in
echo "title $PRETTY_NAME - Rescue Image"
echo "version $KERNEL_VERSION"
echo "machine-id $MACHINE_ID"
[[ -n "$SORT_KEY" ]] && echo "sort-key $SORT_KEY"
[[ -n $SORT_KEY ]] && echo "sort-key $SORT_KEY"
echo "options ${BOOT_OPTIONS[*]} rd.auto=1"
echo "linux $BOOT_DIR/linux"
echo "initrd $BOOT_DIR/initrd"
Expand Down
Loading