Debian – dkms versus module-assistant

debiandkms

module-assistant has been the de-facto method of compiling and building binary Debian packages containing kernel modules for a while now. More recently a comparable utility has appeared – dkms.

If anyone has experience using both, please do a compare and constrast on the advantages and disadvantages of using one versus the other.

One item to address in an answer is whether dkms builds binary Debian packages for kernel modules too, and if so, how, and if so, what the differences between the packages built by m-a and dkms are, if any.

I have personally never used dkms, but I have used module-assistant sporadically over many years, and it has been a good experience. I don't have immediate plans to experiment with dkms, so I don't think I am the right person to write an answer.

Random googling found a discussion here, also this.

Needless to say, any answer should be based on first hand experience, not copying from web forums. A worked example using both would be nice. Possibly nvidia-kernel, since that is quite commonly used. Yes, I know it is a proprietary kernel module. 🙁

UPDATE: Thanks to jordanm for his answer. I'd like something that goes into a little more detail about what is going on under the hood, for both m-a and dkms, though I did not initially mention this. Also, it sounds like most of the time dkms will work transparently and automatically. But what are the failure modes of dkms. How do they both cope with manually compiled/installed kernels? Either installed from a binary package or a local install.

Best Answer

The main difference from a user's perspective is that module-assistant (m-a) is a tool to manually compile a kernel module, whereas dkms does it automatically without user intervention. If you are using m-a and the kernel package is upgraded, you must manually recompile the module using m-a. Since m-a only compiles for the kernel you are currently running, this means you will have a broken GUI for the next reboot if the module that you need m-a for is a graphics driver.

The triggers for dkms are executed on every kernel package installation and it ensures the module is installed for every kernel on the system. I personally can not think of a reason for an end-user to continue use of m-a.

Here are some examples of m-a vs dkms for the nvidia kernel module:

Building a module with module-assistant:

apt-get install module-assistant nvidia-kernel-source
m-a prepare # install the header package for the current kernel and compilation tools 
m-a install nvidia-kernel-source # compile the source into a .deb and install it

Building a module with dkms:

apt-get install nvidia-kernel-dkms

Kernel upgrade with module-assistant:

apt-get upgrade # assumed to upgrade kernel
# reboot
m-a prepare
m-a install nvidia-kernel-source

Kernel upgrade with dkms:

apt-get upgrade # assumed to upgrade kernel
Related Question