Bug 2184139 - dnf remove kernel-core doesn't clean /lib/modules complete for that kernel
Summary: dnf remove kernel-core doesn't clean /lib/modules complete for that kernel
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 38
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-04-03 18:06 UTC by Ronald Warsow
Modified: 2024-05-21 14:35 UTC (History)
21 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-05-21 14:35:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ronald Warsow 2023-04-03 18:06:19 UTC
1. Please describe the problem:

under Fedora 38 running dnf remove kernel-core leads to a left over in /lib/modules for that removed kernel

2. What is the Version-Release number of the kernel:

should have been kernel-6.2.8-300.fc38 

3. Did it work previously in Fedora? If so, what kernel version did the issue
   *first* appear?  

yup, Fedora 37


4. Can you reproduce this issue? If so, please provide the steps to reproduce
   the issue below:

a) sudo dnf remove kernel-core
b) take a look under /lib/modules/


5. Does this problem occur with the latest Rawhide kernel? To install the
   Rawhide kernel, run ``sudo dnf install fedora-repos-rawhide`` followed by
   ``sudo dnf update --enablerepo=rawhide kernel``:

not tested

6. Are you running any modules that not shipped with directly Fedora's kernel?:

No

Comment 1 Justin M. Forbes 2023-04-03 21:33:00 UTC
Do you also have kernel-modules-core-6.2.8-300.fc38.x86_64 installed?

Comment 2 Kamil Páral 2023-04-04 08:27:05 UTC
On my F35->F36->F37->F38 upgraded system, I see lots of almost empty or empty leftover directories under /lib/modules as well. I have just these kernels installed:

$ rpm -q kernel
kernel-6.2.7-300.fc38.x86_64
kernel-6.2.8-300.fc38.x86_64
kernel-6.2.9-300.fc38.x86_64

But I have these directories present:

$ for d in /lib/modules/*; do du -sh "$d"; done
32K	/lib/modules/5.14.10-300.fc35.x86_64
32K	/lib/modules/5.14.14-300.fc35.x86_64
32K	/lib/modules/5.14.15-300.fc35.x86_64
32K	/lib/modules/5.14.16-301.fc35.x86_64
32K	/lib/modules/5.14.17-301.fc35.x86_64
32K	/lib/modules/5.15.13-200.fc35.x86_64
32K	/lib/modules/5.15.14-200.fc35.x86_64
32K	/lib/modules/5.15.15-200.fc35.x86_64
32K	/lib/modules/5.15.16-200.fc35.x86_64
32K	/lib/modules/5.15.6-200.fc35.x86_64
32K	/lib/modules/5.15.7-200.fc35.x86_64
32K	/lib/modules/5.16.10-200.fc35.x86_64
32K	/lib/modules/5.16.11-200.fc35.x86_64
32K	/lib/modules/5.16.12-200.fc35.x86_64
32K	/lib/modules/5.16.13-200.fc35.x86_64
32K	/lib/modules/5.16.14-200.fc35.x86_64
32K	/lib/modules/5.16.15-201.fc35.x86_64
32K	/lib/modules/5.16.16-200.fc35.x86_64
32K	/lib/modules/5.16.5-200.fc35.x86_64
32K	/lib/modules/5.16.6-200.fc35.x86_64
32K	/lib/modules/5.16.7-200.fc35.x86_64
32K	/lib/modules/5.16.8-200.fc35.x86_64
32K	/lib/modules/5.16.9-200.fc35.x86_64
0	/lib/modules/6.2.2-300.fc38.x86_64
0	/lib/modules/6.2.2-301.fc38.x86_64
0	/lib/modules/6.2.5-300.fc38.x86_64
0	/lib/modules/6.2.6-300.fc38.x86_64
135M	/lib/modules/6.2.7-300.fc38.x86_64
135M	/lib/modules/6.2.8-300.fc38.x86_64
135M	/lib/modules/6.2.9-300.fc38.x86_64


Directories with size 0 are empty, directories with size 32K contain just a single file:
$ ll /lib/modules/5.14.10-300.fc35.x86_64
total 33k
-rw-r--r--. 1 root root 30k Nov 10  2021 modules.builtin.alias.bin


Looking at the ".fcNN" tag, this problem was last present in F35, and now it re-appeared in F38. The first affected kernel seems to be 6.2.2-300.fc38 on my system, but there might be some earlier ones before I upgraded to F38. It should be easy to figure out where it started. I can test that, if it helps.

Comment 3 Ronald Warsow 2023-04-04 11:00:27 UTC
Justin,

yes, kernel-modules-core is/was installed

currently is this on my box:

rpm -qa|grep kernel

kernel-srpm-macros-1.0-16.fc38.noarch
kernel-headers-6.2.6-300.fc38.x86_64
kernel-modules-core-6.2.9-300.fc38.x86_64
kernel-core-6.2.9-300.fc38.x86_64
kernel-modules-6.2.9-300.fc38.x86_64
kernel-6.2.9-300.fc38.x86_64

Comment 4 Justin M. Forbes 2023-04-04 12:20:17 UTC
The modules.builtin.alias.bin thing was fixed a while ago, though nothing was in place to go back and remove those older directories owned by it. The empty directory itself is a new thing, and I am guessing when the kernel-core/kernel-modules-core split happened for UKI, ownership of the module directory got confused.

Comment 5 Ronald Warsow 2024-02-16 20:47:30 UTC
seems to be fixed

Thanks !

to be closed ?

Comment 6 Aoife Moloney 2024-05-07 16:04:16 UTC
This message is a reminder that Fedora Linux 38 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 38 on 2024-05-21.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '38'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 38 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 7 Aoife Moloney 2024-05-21 14:35:49 UTC
Fedora Linux 38 entered end-of-life (EOL) status on 2024-05-21.

Fedora Linux 38 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


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