0

I have installed a module, acpi_call, with make && sudo make install. The problem is the module is no more installed when I upgrade the kernel, I have to do make install again. Why does it not happen to the other modules, andhow can I avoid this?

1

acpi_call is not a regular program but a kernel module. Kernel modules must be compiled to a specific kernel version, else they are deemed incompatible and will not load.

DKMS (Dynamic Kernel Management System) will manage your custom kernel modules and recompile them within the current running kernel version and do so automatically whenever you download a new version. It will also update initrd which is part of the bootstrap loader process (nick-named boot). A unique initrd is in your /boot directory for each unique kernel version you have installed.

As CelticWarrior pointed out you can read detailed installation instructions for Ubuntu in: help.ubuntu.com/community/DKMS.

The project page itself is at: linux.dell.com/dkms/ and it contains some additional links you will find helpful.

I used DKMS for keeping EnhanceIO (A HDD to SSD caching program previously used for facebook servers) up to date. DKMS automatically compiled for various kernel versions and it works very well. Pay attention to error messages because parameters can change between kernel versions and new source code patches may be required from github.

For interested readers, the thought of compiling Kernel modules seems daunting at first but, once you get into it you'll feel comfortable.

1

Thank you all, I solved.

Using the example linked by CelticWarrior, I created this dkms.conf file:

MAKE[0]="make"
CLEAN="make clean"
BUILT_MODULE_NAME[0]=acpi_call
# BUILT_MODULE_LOCATION[0]=./
DEST_MODULE_LOCATION[0]="/extra"
PACKAGE_NAME=acpi_call
PACKAGE_VERSION=1.0
REMAKE_INITRD=yes

DEST_MODULE_LOCATION is required as documented in man dkms, despite the example.

Then I copied the source code in /usr/src/acpi_call-1.0 and then installed it with:

sudo dkms install -m acpi_call -v 1.0

See also the kernel.org documentation about external modules - it documents the correct way to create a makefile for building and installing an external module, and it says that the correct location for external module is under the extra subdir.

  • 1
    +1 for solving this yourself. If you check off your answer as solution others can see it works. – WinEunuuchs2Unix Oct 6 '16 at 10:35

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.