Some time ago Dell introduced the dynamic kernel module support (DKMS) to automatically recompile kernel modules during kernel updates. Now the first average-user apps supporting dkms emerged: VirtualBox and ATI graphics drivers.
The Dynamic Kernel Module Support (DKMS) was introduced around 2003 as a way for Dell’s customers to automatically and sanely recompile kernel modules after kernel updates. This was and is necessary even for small kernel updates and for every module which is not part of the kernel. Previously to DKMS the customers had to use their own scripts or recompile the modules manually after each update.
While today many kernel modules are shipped in the vanilla kernel and some missing ones (like uvc) are added later on by the distributors, some kernel modules are not shipped yet and might never be shipped with the mainline kernel. Common examples are proprietary graphic driver modules, modules written in C++ or drivers in an experimental state.
Now, several years after DKMS was first introduced to the world it finally starts to appear at different places: the newest ATI graphics driver is shipped with DKMS support now. Also VirtualBox (which has a C++ written kernel module afaik) included DKMS support with version 1.6.
The advantage is now that, as soon as a kernel update comes down the pipe, the modules are automatically recompiled – there is no need to take care of that on your own. It is also needless to provide recompiled modules in the repositories: these usually lack behind the main kernel updates (and can also be a bit problematic due to licence reasons in some cases) which can be very annoying for the user. With DKMS the module is compiled on the user side and is available directly after the new kernel was installed.
The technical heart of DKMS is the
dkms command. It is used to build, install, manage and also remove kernel modules. An article at linuxjournal gives a detailed insight into the inner workings of dkms. To check if a given system already utilizes dkms, a status query can be done:
# dkms status vboxdrv, 1.6.0, 126.96.36.199-85.fc8, i686: installed vboxdrv, 1.6.0, 188.8.131.52-92.fc8, i686: installed
In this example the VirtualBox kernel module is managed by dkms, and the need to recompile the module after each kernel update is not existent anymore. Given that dkms is accepted by other projects as well the handling of external kernel modules will be much easier in the future.
Of course, DKMS needs to be included with the distribution, but that is the case for almost all bigger ones. Also, DKMS only works as long as the module can actually be recompiled with the new kernel. Especially graphics drivers might be a problem here. However, most distributions don’t update their kernel during a life cycle of a distribution version, so that shouldn’t be a problem for normal users. Also, the best solution for driver development and management is of course when to develop everything inside the vanilla kernel. But as mentioned above there are several exceptions where that is simply not possible.