Dkms tries to solve the problem of updating 3rd party kernel modules when a new kernel is installed.
It might work but it seems on redhat and centos installations there’s also another script called weak-modules.
The purpose of weak-modules is to detect if an existing kernel module built for one kernel is compatible with a newly installed kernel and won’t bother recompiling the module if it thinks the existing build is compatible with the new kernel. It makes a symlink from the new module’s location to the old built copy of the module.
The problem is that weak-modules doesn’t work very well.
What it does is compare the symbol table of the two kernels as they relate to the symbols used by the kernel module. If there are no changes to any of the symbols that the kernel module uses, it assumes they’re compatible and makes a symlink and dkms won’t try and build it against the new kernel headers.
Depending on the kernel module, the result can be that you upgrade your kernel, and when you reboot, you get a kernel panic, with the name of the module as the problem. The module didn’t do anything wrong, the weak-modules script did.
So if you upgrade your kernel and you’re unlucky enough to have a kernel module loaded that isn’t affected by any of the symbols that did change in the new kernel, you could end up with a computer that won’t boot anymore.