开发者

How to automate linux kernel module compilation when installing a new kernel?

开发者 https://www.devze.com 2023-01-25 22:53 出处:网络
I am writing a Linux kernel module. It is released with all the source files (although the license is proprietary) to be compiled against the running kernel. Whe开发者_JAVA百科n installing my module (

I am writing a Linux kernel module. It is released with all the source files (although the license is proprietary) to be compiled against the running kernel. Whe开发者_JAVA百科n installing my module (distributed as a .deb package) it is compiled and installed automatically. This works.

The issue is that during the regular upgrade process of the whole Linux systems, newer version of the Linux kernel are installed. When such a new version of the kernel starts to run, it does not have my module compiled for it, and my application fails. I'd like my module to be compiled and installed whenever a new Linux kernel package is installed.

Hence my question: is there a mechanism in dpkg that could trigger something in my package to compile and install my module when a new Linux kernel package is installed?

Same question for rpm?


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

DKMS enables kernel device drivers to be automatically rebuilt when a new kernel is installed. DKMS can be used in both directions: To automatically recompile all modules if a new kernel version is installed, or to install new module (driver) versions on an existing system without any need for manual compilation or precompiled packages.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号