7

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.

Naftuli Kay
  • 38,686
  • 85
  • 220
  • 311
  • Could you at least add the output of `dkms status` please ? And do you have a service that is named or that calls `dkms_autoinstaller` on every boot? Should be similar to [this](http://anonscm.debian.org/cgit/pkg-dkms/dkms.git/tree/dkms_autoinstaller) and from what I can see is that it also logs to syslog, so you should probably see something in `/var/log/messages` if it runs. You can also run it manually as root as `/etc/rc.d/init.d/dkms_autoinstaller start` and post the output here. – doktor5000 Dec 18 '15 at 21:48
  • Done, looks like DKMS isn't installing anything. – Naftuli Kay Dec 21 '15 at 19:18
  • Well, if dkms doesn't install anything, and if there's no service that would check the status and rebuild your dkms modules on each reboot, then those are two issues you would need to fix. As you don't provide more information, can't really help you further. – doktor5000 Dec 21 '15 at 19:35

1 Answers1

2

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
doktor5000
  • 2,689
  • 15
  • 30
  • Updated question. – Naftuli Kay Dec 18 '15 at 20:50
  • There is no DKMS service here. – Naftuli Kay Dec 21 '15 at 19:19
  • DKMS is not necessarily a continuously-running service: it can also be triggered by the kernel installation mechanism by a script placed in e.g. `/etc/kernel/postinst.d/dkms` and `/etc/kernel/header_postinst.d`. Note that you'll have to install the exact same version of both the kernel headers and the actual kernel package: if the headers are missing, `dkms` cannot compile modules for your kernel. That's why there are two trigger scripts: they should trigger the compilation once both a new kernel and its headers have been installed, regardless of which order the packages are installed in. – telcoM Oct 10 '18 at 14:59