DKMS and RPM playing nice together

Gary_Lerhaupt@Dell.com Gary_Lerhaupt@Dell.com
Thu Oct 2 14:31:00 2003


One of the benefits of DKMS is that it works quite nicely when using the rpm
-U flag to upgrade between new versions of dkms-enabled RPM packages.  Thus,
when you do your -Uvh, it first installs the new RPM which puts your new
module-version into the DKMS tree and then it uninstalls the old version of
the RPM which calls a `dkms remove --all` to get rid of all the old versions
from the dkms tree.

However, it seems that when upgrading between inter-RPM-releases (eg. the
module-version stays the same, but you rev the RPM release version), dkms
was pretty brain dead.  It would first install the new RPM, but then during
the uninstall of the old rpm, it would call `dkms remove --all` ... and,
presto, it would remove all versions of that module from the tree.  Since
the module-version of the new and old RPM were the same, in effect,
upgrading between such RPMs had the nasty effect of cleaning out your dkms
tree for that version and leaving you with nothing.

This has been resolved with the new --rpm_safe_upgrade flag.  Now, in your
spec, during your add you should specify --rpm_safe_upgrade (eg. dkms add -m
<module> -v <version> --rpm_safe_upgrade).  Later, during the uninstall part
of your spec, you should also specify --rpm_safe_upgrade (eg. dkms remove -m
<module> -v <version> --all --rpm_safe_upgrade).  Through some nifty dkms
trickery, DKMS will now always do the right thing assuming these flags are
used as such.  You have to use it in both the add and remove for it to work.
See the man page and changeblog for more info.

http://www.lerhaupt.com/foo/archives/000140.html

Gary Lerhaupt
Dell Linux Development