Image

Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Comments on Install locally-compiled kernel module

Parent

Install locally-compiled kernel module

+4
−0

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.)
History

0 comment threads

Post
+2
−0

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

History

1 comment thread

Works for me (2 comments)
Works for me
Michael‭ wrote 6 months ago

It even uses DKMS's signing key!

GeraldS‭ wrote 6 months ago

Well, that explains why I don't remember ever seeing such a warning. I don't think I ever used a kernel module without DKMS.