Install locally-compiled kernel module
I'm trying to get a hardware driver working. Someone seems to have a kernel module project, but I have to compile it locally and install it.
I can install dependencies and make just fine, but installing the module complains about missing signatures.
- How much trouble am I in if I don't sign the module?
- How much trouble am I signing up for in order to sign the module?
- Will I have to re-install and/or re-sign every time there is a kernel update in my package manager? (I read about something called DKMS, but I'm not sure if that helps me.)
1 answer
The following users marked this post as Works for me:
| User | Comment | Date |
|---|---|---|
| Michael |
Thread: Works for me It even uses DKMS's signing key! |
Aug 15, 2025 at 15:40 |
I never bothered signing kernel modules, so I can't say anything about that part except that I never had problems with unsigned modules. TBH the thought to do so never even occurred to me.
But yes, you will need to recompile the module every time a new kernel module is installed, which is quite often, since this also includes updates of the kernel package by the distribution maintainer. DKMS (Dynamic Kernel Module Support) is the way to go here, since it will do that automatically whenever the kernel is updated.
To do so you will need to create a file called dkms.conf inside the directory you extracted from the module source code tarball:
cd awesome-20091211-v1.1/
texteditorofyourchoice dkms.conf
The config file should look something like this:
MAKE="make -C src/ KERNELDIR=/lib/modules/${kernelver}/build"
CLEAN="make -C src/ clean"
BUILT_MODULE_NAME=awesome
BUILT_MODULE_LOCATION=src/
PACKAGE_NAME=awesome
PACKAGE_VERSION=1.1
REMAKE_INITRD=yes
You will need to check the README file of the module for the correct commands to build the module and replace awesome with the module name, and of course set the proper version number.
Then you will need to copy into the kernel source tree at /usr/src/<modulename>-<version>. Again, replace the placeholders with the module name and the version number.
ls
README dkms.conf lib src
sudo cp -R . /usr/src/awesome-1.1
sudo dkms add -m awesome -v 1.1
dkms does its thing...
Now we can test if building the module works.
sudo dkms build -m awesome -v 1.1
dkms does its thing.... watch for build errors... you may need to tweak dkms.conf
If everything works, install the module.
sudo dkms install -m awesome -v 1.1
dkms does its thing.... module is copied into current kernel module tree
Now every time the kernel is updated by the package manager the module will be recompiled with the corresponding header files and installed automatically.
Instructions taken from: https://help.ubuntu.com/community/DKMS

0 comment threads