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?
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
For interested readers, the thought of compiling Kernel modules seems daunting at first but, once you get into it you'll feel comfortable.
Thank you all, I solved.
Using the example linked by CelticWarrior, I created this
MAKE="make" CLEAN="make clean" BUILT_MODULE_NAME=acpi_call # BUILT_MODULE_LOCATION=./ DEST_MODULE_LOCATION="/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