How to automate compilation of the Linux kernel module when installing a new kernel?

I am writing a Linux kernel module. It comes with all source files (although the license is the property) to compile with the kernel running. When you install my module (distributed as a package .deb), it compiles and installs automatically. It works.

The problem is that during the normal process of updating all Linux systems, a newer version of the Linux kernel is installed. When such a new version of the kernel starts, it does not have my module compiled for it, and my application crashes. I want my module to be compiled and installed when a new Linux kernel package is installed.

Therefore, my question is: is there a mechanism in dpkgthat can cause something in my package to compile and install my module when installing a new Linux kernel package?

The same question for rpm?

+3
source share
1 answer

You probably want to use DKMS: http://en.wikipedia.org/wiki/Dynamic_Kernel_Module_Support . On the page:

DKMS . DKMS : , ​​ , () .

+5

Source: https://habr.com/ru/post/1775639/


All Articles