You are not logged in.

#1 2016-12-15 19:08:01

temach
Member
Registered: 2016-02-11
Posts: 5

[Solved] Patched kernel module is shown to be loaded, but isnt?

I am patching a kernel module to make a non compliant hardware device work with usb hid driver.
Everything is great, but the module is not being picked up by the kernel after it is put into modules directory.

After reboot modinfo can see the new modules I placed in "updates" folder (it was not there before, I created it):

modinfo hid-generic
filename:       /lib/modules/4.8.13-1-ARCH/updates/hid-generic.ko.gz
license:        GPL
description:    HID generic driver
author:         Henrik Rydberg
alias:          hid:b*g0001v*p*
depends:        hid
vermagic:       4.8.13-ARCH SMP preempt mod_unload modversions 

and

modinfo hid
filename:       /lib/modules/4.8.13-1-ARCH/updates/hid.ko.gz
license:        GPL
author:         Jiri Kosina
author:         Vojtech Pavlik
author:         Andreas Gal
depends:        
vermagic:       4.8.13-ARCH SMP preempt mod_unload modversions 
parm:           debug:toggle HID debugging messages (int)
parm:           ignore_special_drivers:Ignore any special drivers and handle all devices by generic driver (int)

Thouse modules contain the patched source. However when I connect my usb device in dmesg it still shows the error given by the standard driver
And this is the crazy part: I have deleted the line that contained this error string when I was patching the source!

So I thougth that the error was coming from another file, but grepping linux source tree shows that it only exists  in the file I patched (and I removed it from there).
So it seems that for whatever reason the kernel does not load the module that I patched and keeps on using the standard module.

Any ideas on what settings to check?


Extra info:
I was changing code in drivers/hid/hid-core.c
The unique error was "invalid report_size"
and all the while I was following instructions in https://wiki.archlinux.org/index.php/Co … nel_module

Last edited by temach (2016-12-16 03:59:27)

Offline

#2 2016-12-16 00:20:37

loqs
Member
Registered: 2014-03-06
Posts: 18,963

Re: [Solved] Patched kernel module is shown to be loaded, but isnt?

If the module was included in initramfs did you remember to rebuild it?

Offline

#3 2016-12-16 03:54:51

temach
Member
Registered: 2016-02-11
Posts: 5

Re: [Solved] Patched kernel module is shown to be loaded, but isnt?

Exactly! I had to run

mkinitcpio -p linux

after this, everything worked.
Thanks

Offline

Board footer

Powered by FluxBB