Linux – DKMS modules never installed properly on kernel upgrade

dkmskernelkernel-moduleslinux-kernel

I have multiple DKMS modules installed on my system, some of them mine, and some of them belonging to pretty major maintained packages such as Oracle's VirtualBox 5.

What I've found is that on every kernel upgrade, all DKMS modules get broken and not installed in the new kernel. I thought it was bad configuration on my behalf in my own modules, but now that I'm seeing VirtualBox broken as well, I'm suspecting it's something else.

How can I debug why DKMS isn't installing modules in newer kernel versions?

I'm on kernel 3.19, Ubuntu 14.04.

After a kernel upgrade dkms status doesn't output much of anything, meaning that none of my DKMS modules are getting installed properly.

Best Answer

You miss information which distro you're using currently. And for what it's worth, VirtualBox 5.x also didn't register properly with dkms for me, meaning after a kernel update those modules would not be rebuilt by dkms.

For the instructions you provided regarding the DKMS installation those steps only take care that the module source is installed under /usr/src/<modulename>-<moduleversion>/ and that the module is built for the currently running kernel (or the one that is specified). If there's no dkms service running at boot then no new version will be compiled if a new kernel was booted for the first time.

It should be easy to verify, all modules that show up when running dkms status as root should be rebuilt automatically once you boot a new kernel for the first time and if you have the kernel headers for that kernel installed. Additionally the dkms.conf for the module in question needs to have AUTOINSTALL=Y specified, and the dkms service ( usually /etc/rc.d/init.d/dkms for older distributions ) will rebuilt those registered modules on next boot.

Can you check each of those conditions is met, especially that a service runs during bootup that will check dkms status and build new modules if necessary? It should either be called dkms or dkms_autoinstaller or similar.

For comparison, this is what dkms status output looks here with several binary and source modules installed for several kernel versions:

[doktor5000@Mageia5]─[16:40:27]─[~] sudo dkms status | sort
broadcom-wl, 6.30.223.271-1.mga5.nonfree, 4.1.12-desktop-1.mga5, x86_64: installed 
broadcom-wl, 6.30.223.271-1.mga5.nonfree, 4.1.13-desktop-2.mga5, x86_64: installed 
broadcom-wl, 6.30.223.271-1.mga5.nonfree, 4.1.8-desktop-1.mga5, x86_64: installed 
nvidia-current, 346.96-1.mga5.nonfree, 4.1.12-desktop-1.mga5, x86_64: installed 
nvidia-current, 346.96-1.mga5.nonfree, 4.1.12-desktop-1.mga5, x86_64: installed-binary from 4.1.12-desktop-1.mga5
nvidia-current, 346.96-1.mga5.nonfree, 4.1.13-desktop-2.mga5, x86_64: installed-binary from 4.1.13-desktop-2.mga5
nvidia-current, 346.96-1.mga5.nonfree, 4.1.8-desktop-1.mga5, x86_64: installed 
nvidia-current, 346.96-1.mga5.nonfree, 4.1.8-desktop-1.mga5, x86_64: installed-binary from 4.1.8-desktop-1.mga5
rtl8192cu-fixes, 1.10, 4.1.12-desktop-1.mga5, x86_64: installed 
rtl8192cu-fixes, 1.10, 4.1.13-desktop-2.mga5, x86_64: installed 
rtl8192cu-fixes, 1.10, 4.1.8-desktop-1.mga5, x86_64: installed 
sysdig, 0.2.0-1.mga5, 4.1.13-desktop-2.mga5, x86_64: installed 
virtualbox, 5.0.10-1.mga5, 4.1.12-desktop-1.mga5, x86_64: installed 
virtualbox, 5.0.10-1.mga5, 4.1.13-desktop-2.mga5, x86_64: installed-binary from 4.1.13-desktop-2.mga5
virtualbox, 5.0.8-1.mga5, 4.1.12-desktop-1.mga5, x86_64: installed-binary from 4.1.12-desktop-1.mga5
virtualbox, 5.0.8-1.mga5, 4.1.8-desktop-1.mga5, x86_64: installed-binary from 4.1.8-desktop-1.mga5
Related Question