Bug 2278981 - Kernel uninstall failing since fc40 upgrade
Summary: Kernel uninstall failing since fc40 upgrade
Keywords:
Status: CLOSED DUPLICATE of bug 2274356
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: 40
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: dracut-maint-list
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-05-03 20:07 UTC by Andreas G
Modified: 2024-05-10 06:20 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-05-10 06:20:09 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Andreas G 2024-05-03 20:07:14 UTC
50-dracut.install fails during uninstall with

>rm: cannot remove '/boot/efi/04415f4205a64c0691dcaf68b2389ae1/6.7.9-200.fc39.aarch64/': Is a directory
>Apr 29 02:08:21 localhost dnf-3[775]: /usr/lib/kernel/install.d/50-dracut.install failed with exit status 1.

The cause seems to be the following lines in /usr/lib/kernel/install.d/50-dracut.install

>if [[ -d "$BOOT_DIR_ABS" ]]; then
>    INITRD="initrd"
>else
>    # No layout information, use users --uefi/--no-uefi preference
>    UEFI_OPTS=""
>    if [[ -d $BOOT_DIR_ABS ]]; then
>        IMAGE="initrd"
>    else
>        BOOT_DIR_ABS="/boot"
>        IMAGE="initramfs-${KERNEL_VERSION}.img"
>    fi
>fi

Which makes no sense to me, cause $INITRD is nowhere referenced in the script again. While $IMAGE isn't being set if $BOOT_DIR_ABS is a directory (which it is), so later in:
>rm -f -- "$BOOT_DIR_ABS/$IMAGE"
It tries to remove the $BOOT_DIR_ABS and fails, cause that's a directory.

It seems to be caused by this patch:

https://src.fedoraproject.org/rpms/dracut/blob/rawhide/f/0001-feat-kernel-install-do-nothing-when-KERNEL_INSTALL_I.patch

Reproducible: Always

Steps to Reproduce:
1.Uninstall any kernel



Running with systemd-boot.

Comment 1 Andreas G 2024-05-03 20:08:29 UTC
As reference, someone else noticing the same problem:

https://discussion.fedoraproject.org/t/kernel-uninstall-failed-during-f39-to-f40-upgrade/114788/1

Comment 2 David Tardon 2024-05-10 06:20:09 UTC

*** This bug has been marked as a duplicate of bug 2274356 ***


Note You need to log in before you can comment on or make changes to this bug.