:: [DNG] How to build a kernel module?
Top Page
Delete this message
Reply to this message
Author: Dr. Nikolaus Klepp
To: dng
Subject: [DNG] How to build a kernel module?

I am trying to build a patched thinkpad_acpi module for 4.19 kernel (the patch removes the spaming error message from the battery charge/discharge levels BCTG/BCSG on thinkpads T60/T61/X61). I can build the module, but the creaded module won't load.

This is what I did to compile the modules:

# aptitude install linux-source-4.19
# cd /usr/src
# tar xJf linux-source-4.19.tar.xz
# cd linux-source-4.19/
# cp /boot/config-4.19.0-2-amd64 .config
# make modules_prepare
# make modules

This succeeds, but the created modules won't load:

root@t61:/usr/src/linux-source-4.19# insmod ./drivers/platform/x86/thinkpad_acpi.ko
insmod: ERROR: could not insert module ./drivers/platform/x86/thinkpad_acpi.ko: Invalid module format
root@t61:/usr/src/linux-source-4.19# file ./drivers/platform/x86/thinkpad_acpi.ko
./drivers/platform/x86/thinkpad_acpi.ko: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), BuildID[sha1]=571675351aecfb803c56549d218d85d53f60b8d7, with debug_info, not stripped

Any idea what I missed?


Please do not email me anything that you are not comfortable also sharing with the NSA, CIA ...