Skip to content

Install module into the kernel module tree - #156

Open
dhrm1k wants to merge 2 commits into
frederik-h:mainfrom
dhrm1k:install-module-and-wmi-id-table
Open

Install module into the kernel module tree#156
dhrm1k wants to merge 2 commits into
frederik-h:mainfrom
dhrm1k:install-module-and-wmi-id-table

Conversation

@dhrm1k

@dhrm1k dhrm1k commented Jun 28, 2026

Copy link
Copy Markdown

Add install and uninstall targets for the module.

The install target copies the built .ko into /lib/modules/<kernel>/extra
and runs depmod, so the module can be found normally by tools like
modprobe, modinfo, and modules-load.d. Without this, users have to load
the local build artifact directly with insmod.

I ran into this while testing on an Acer Aspire A315-58. I had a
modules-load.d entry for acer-wmi-battery, but each boot still logged a
module load failure because the module had only been built locally and was not
installed into the kernel module tree. After installing it under
/lib/modules/<kernel>/extra and running depmod, both
modinfo acer-wmi-battery and modprobe acer-wmi-battery resolve it correctly.

This also attaches the existing WMI device ID table to the wmi_driver
definition so the generated modalias metadata matches the GUID supported by the
driver.

I tested this with make, sudo make install, modinfo acer-wmi-battery,
and modprobe --show-depends acer-wmi-battery.

dhrm1k added 2 commits June 28, 2026 19:08
Add install and uninstall targets so the built module can be placed under /lib/modules/<kernel>/extra and indexed with depmod. This lets modprobe, modinfo, and modules-load.d find the module after it is built, instead of requiring users to load the local .ko with insmod.

Also wire the existing WMI device ID table into the wmi_driver definition so the driver's modalias metadata matches the GUID it supports.

Signed-off-by: dharmik <dharmikparmar2004@yahoo.com>
Add a dkms.conf so the module can be rebuilt and installed automatically when new kernels are installed. This avoids requiring users to manually rerun the local install flow after each kernel update.

Document the DKMS install and removal commands, and stop ignoring dkms.conf now that it is project configuration rather than a build artifact.

Signed-off-by: dharmik <dharmikparmar2004@yahoo.com>
@dhrm1k

dhrm1k commented Jul 2, 2026

Copy link
Copy Markdown
Author

@shadowhexer I ran into a related install/reinstall problem and was working on it. Your comment made me realize that the same work can also cover the kernel-update behavior you mentioned.

I have added a normal make install target and DKMS support: #156

The install target fixes the normal modprobe/modinfo/modules-load.d path, and the DKMS config so rebuilding/installing the module when new kernels are installed.

@shadowhexer

Copy link
Copy Markdown

@shadowhexer I ran into a related install/reinstall problem and was working on it. Your comment made me realize that the same work can also cover the kernel-update behavior you mentioned.

I have added a normal make install target and DKMS support: #156

The install target fixes the normal modprobe/modinfo/modules-load.d path, and the DKMS config so rebuilding/installing the module when new kernels are installed.

Thanks for noticing the issue and delivering a fix. I hope the module author merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants