You are not logged in.
Pages: 1
Is it possible to compile a module without the entire kernel?
Here's what m trying to achieve.
Download kernel source matching my current from kernel
Modify btrtl.c for fix a bluetooth issue I'm having
Recompile that module.
Put it back in my existing kernel
Here's what I've tried so far, but I just get 'exec' error when moving it back to the existing drivers.
I have had success by rebuilding the entire kernel and booting into it. At that point, rebuilding just the modules appeared to work
make -j16 mrproper
zcat /proc/config.gz > .config
make -j16 oldconfig
make -j16 modules_prepare
make -j16 modules M=drivers/bluetooth
sudo make -j16 modules_install M=drivers/bluetooth
sudo cp /lib/modules/5.15.2/extra/btrtl.ko.zst /lib/modules/5.15.2-arch1-1/kernel/drivers/bluetooth/
Last edited by burny02 (2021-11-19 17:02:42)
Offline
The exec error is from modprobe or from cp? Did you run depmod after you installed the module?
Offline
The exec error is from modprobe. I didn't run depmod.
None of the sites I've been using mentioned it?
Offline
Any related output from dmesg? Was the module already loaded when you tried to modprobe it?
make modules_install should have called depmod, this assumes the build system is the same as the target system.
Did the build generate a new private key? Which the packaged kernel reject.
Last edited by loqs (2021-11-18 01:54:08)
Offline
I finally got to the bottom of it
The .config line CONFIG_LOCALVERSION="" needs to be set to match the kernel that you want to use the module other it will not work
Many thanks for all your help
Offline
Pages: 1