Comment 3 for bug 300773

Revision history for this message
Matt Zimmerman (mdz) wrote : Re: [Bug 300773] Re: Removal does not clean up after dkms, l-r-m(?)

On Thu, Dec 04, 2008 at 02:24:53PM -0000, Andy Whitcroft wrote:
> Put together a patch to clean this lot up (attached).

This patch looks good and fixes several bugs, but not the exact issue I
reported. My apologies for not being clearer in the original report.

In my case, the modules.* files *were* removed, but probably only thanks to
bug 250511 (those kernels predated the fix, so the files were included in
the package and removed by dpkg).

The build links do in fact belong to linux-headers-* packages and so their
presence is not unexpected (though they do trigger the error message from
failing rmdir, which your patch addresses).

The crux of my problem is the "updates" directory, which contains modules
built by DKMS. Nothing cleans up these files when a kernel is removed, only
when the entire module package (e.g. nvidia-173-kernel-source) is removed.

I think what's needed is to add a "dkms remove" command to the kernel
package postrm which removes all modules installed by dkms for the specified
kernel version.

(FWIW, I think the maintainer scripts for the kernel package would probably
benefit from being stripped down to simpler shell scripts. We inherited
them from kernel-package, but don't use it anymore and could get by with
something much simpler I think.)

--
 - mdz