dkms removes kernel module when installing/upgrading

mmodem00 at gmail.com
Wed Jun 6 16:20:51 CDT 2007


Em Quarta, 6 de Junho de 2007, Matt Domsch escreveu:
> On Wed, Jun 06, 2007 at 07:21:19PM +0100, Z? wrote:
> > I have been testing dkms-2.0.16 and i can reach the conclusion that when
> > upgrading a dkms package and the module kernel is the same, what dkms do,
> > first installs the kernel module (as expected) but then removes it (and
> > that is a total unexpected behaviour).
> >
> > But ill paste here the complete output of the install/upgrade:
>
> Yep.  Here's what's happening:
> > + /usr/sbin/dkms --rpm_safe_upgrade install -m virtualbox -v
> > 1.4.0-0.svn3059.2mde2007.1
> > Running module version sanity check.
> >
> > Good news! Module version 1.4.0 for vboxdrv.ko.gz
> > exactly matches what is already found in kernel 2.6.17-14mdv.
> > DKMS will not replace this module.
> > You may override by specifying --force.
>
> The RPM %post script didn't specify --force, so this 'install' didn't
> complete; you don't actually have the new version installed.  But it
The vboxdrv drive installed is the same version as the one being upgraded

> goes on:
> > + /usr/sbin/dkms --rpm_safe_upgrade remove -m virtualbox -v
> > 1.4.0-0.svn3059.1mde2007.1 --all
>
> which succeeds, having now erased the one copy you had installed.
>
> > The intention here is to show this terrible bug, since many times is
> > needed to upgrade between releases to apply for example a patch or any
> > other fix.
> >
> > And as it can be seen the kernel module was removed, but how can that be
> > possible when the intention of a dkms install/upgrade is to add/upgrade a
> > kernel module in the active kernel tree?
>
> The right solution is to edit the driver RPM %post script to check the
> return code of 'dkms install' command.  If $? == 101, this means the
> install did not succeed because it didn't need to, and --force should
> be used; or, don't uninstall.
Im really not understanding very well, but shouldnt be needed to use --force, 
dkms should check on the kernel module and if already exists, should 
uninstall the previous dkms package and dont remove the vboxdrv drive from 
kernel tree since this is an upgrade and not an uninstall. Also if in %preun 
i add:
if [ "$1" -eq "0" ]

it will not remove the old dkms package, so you start having severall folders 
inside /var/lib/dkms/virtualbox and that should never happen.

But i think if we could chat online it could have a bet understanding, do you 
use icq, jabber or other instant messenger?

regards,
-- 
Zé
Linux user #378762



More information about the DKMS-devel mailing list