Bug 456856 - on kernel uninstall dkms leaves modules of old kernel as "built"
on kernel uninstall dkms leaves modules of old kernel as "built"
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: dkms (Show other bugs)
14
All Linux
low Severity low
: ---
: ---
Assigned To: Mario Limonciello
Fedora Extras Quality Assurance
: Reopened, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-28 04:05 EDT by Piergiorgio Sartor
Modified: 2012-08-16 18:06 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-16 18:06:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Piergiorgio Sartor 2008-07-28 04:05:53 EDT
Description of problem:
With the new hooks for kernel upgrade/uninstall, dkms should remove the module
of the uninstalled kernel, during the pre-remove/uninstall procedure.
Nevertheless, it seems something is left over, since the old modules appear as
"built" referenced to the, now unistalled, kernel.

Version-Release number of selected component (if applicable):
dkms-2.0.19.1-1.fc9.noarch

How reproducible:
On kernel upgrade, with already two (old) F9 kernels, it seems always.

Steps to Reproduce:
1.
Having some dkms modules (like nvidia) is, of course, prerequisite
2.
yum upgrade [kernel] (when new kernel available)
  
Actual results:
Verifying the dkms situation with "dkms status" returns something like:

ov51x-jpeg, 1.5.8, 2.6.25.9-76.fc9.i686, i686: built 
ov51x-jpeg, 1.5.8, 2.6.25.11-97.fc9.i686, i686: installed 
ov51x-jpeg, 1.5.8, 2.6.25.10-86.fc9.i686, i686: installed 
nvidia, 173.14.09-2.beta.fc9, 2.6.25.9-76.fc9.i686, i686: built 
nvidia, 173.14.09-2.beta.fc9, 2.6.25.11-97.fc9.i686, i686: installed 
nvidia, 173.14.09-2.beta.fc9, 2.6.25.10-86.fc9.i686, i686: installed 

Where kernel 2.6.25.9-76.fc9.i686 was the uninstalled one.

Expected results:
The old modules should be really cleaned up.

Additional info:
Running a further "dkms remove ..." with the proper module, version and (old)
kernel seems to clean up definitively.
Comment 1 Matt Domsch 2008-08-06 17:01:53 EDT
This is in fact working as designed.  The DKMS database and the RPM database, while they interact, are not intended to have a 1-to-1 correspondence.  It's perfectly valid to have modules built for a kernel which is not presently installed (in fact, it happens quite regularly).  Should you wish to 'dkms remove' them, you may.
Comment 2 Piergiorgio Sartor 2008-08-06 17:20:22 EDT
(In reply to comment #1)
> This is in fact working as designed.  The DKMS database and the RPM database,
> while they interact, are not intended to have a 1-to-1 correspondence.  It's
> perfectly valid to have modules built for a kernel which is not presently
> installed (in fact, it happens quite regularly).  Should you wish to 'dkms
> remove' them, you may.

Well, I would expect the act of removing a kernel will remove all its modules, from everywhere they are.

The hook script /etc/kernel/prerm.d/dkms (belonging to "dkms") contains:

...
dkms uninstall -m $name -v $vers -k $inst_kern -a $arch
...

Why "uninstall" instead of "remove"?
Is there any specific reason for that?

I understand it is valid to have "built" modules for uninstalled kernels, but I do not get the reason for this behavior.
The problem I see is that, with time, it will end up with an endless count of unused "built" modules and this does not seem clean to me.
Actually, it seems to me quite annoying to "remove" those modules by hand...

An option could be to provide a configuration option, maybe in /etc/sysconfig/dkms-something, where the user can decide "uninstall" or "remove", thus keeping both options (exclusively) available.

I reopen it, eventually you can close it again, if there is a specific technical reason to "uninstall" instead of "remove".

Thanks again for your patience,

piergiorgio
Comment 3 Matt Domsch 2008-08-06 17:33:29 EDT
dkms remove deletes the pointer to the source from the database.

kernel %preun runs before kernel %posttrans.  If we 'remove' in %preun, and there was only one kernel installed, then the %posttrans hook would never succeed, the source having been deleted before it ran...

What you want is a 'dkms remove' that deletes the built modules but leaves the source pointer.  like an 'uninstall --delete'  or somesuch syntax, which doesn't presently exist.  Perhaps Mario could add such.  I'll leave it open for now.

Thanks,
Matt
Comment 4 Piergiorgio Sartor 2008-08-07 03:54:34 EDT
(In reply to comment #3)
> dkms remove deletes the pointer to the source from the database.
> 
> kernel %preun runs before kernel %posttrans.  If we 'remove' in %preun, and
> there was only one kernel installed, then the %posttrans hook would never
> succeed, the source having been deleted before it ran...

This makes things more clear, thanks, but...
Is this a real case?
I mean, is it possible to run a kernel uninstall with only one kernel installed?
The system will end up without any kernel.
Or it is simple a matter of order of operations, first uninstall the only kernel available and then install a new one?
If this is the case, I understand why "remove" can be dangerous... :-)

> What you want is a 'dkms remove' that deletes the built modules but leaves the
> source pointer.  like an 'uninstall --delete'  or somesuch syntax, which
> doesn't presently exist.  Perhaps Mario could add such.  I'll leave it open for
> now.

Another option could be, but this maybe it is kernel.spec dependent, to run a "dkms remove" at the very end, for the "built" modules only.
This maybe possible in /etc/init.d/dkms_autoinstaller (which runs at the very end, if I get it correctly).

In any case, IMHO, the general requirement would be to leave a "clean" system.
That is, no further operations should be necessary in order to have only the (dkms) modules (and related files) for the current installed kernels.

Thanks again, I hope this discussion will lead to some positive outcome.

piergiorgio
Comment 5 Matt Domsch 2008-08-07 10:21:58 EDT
Charles, please add this to the action item list.
Comment 6 Bug Zapper 2009-06-09 22:16:15 EDT
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  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 WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 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 please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 7 Piergiorgio Sartor 2009-06-17 13:32:21 EDT
Hi, how is it going with this?
Any news?

I upgraded the bug to Fedora 10 to keep it alive.

Thanks,

pg
Comment 8 Bug Zapper 2009-11-18 07:37:47 EST
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  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 WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 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 please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 9 Bug Zapper 2010-11-04 07:50:14 EDT
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  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 WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 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 please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 10 Piergiorgio Sartor 2010-11-04 16:18:37 EDT
Keep-alive change.

bye,

pg
Comment 11 Bug Zapper 2011-06-02 14:29:27 EDT
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  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 WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 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 please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 12 Piergiorgio Sartor 2011-06-03 03:30:52 EDT
Currently, due to rpmfusion changes, I do not have any more dkms modules installed.

Nevertheless, I think this should stay open until a patch will be available or it is decided it is not an issue.

Thanks,

bye,

pg
Comment 13 Fedora End Of Life 2012-08-16 18:06:29 EDT
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached 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, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

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