[help needed] how to recompile a single kernel module

Christian Stadelmann chris.privat at genodeftest.de
Tue Nov 26 14:10:53 UTC 2013


Hi

I'd like to run a test provided by a kernel developer (diff/patch file
for a single .c file in ath9k module) [1]
How do I do that?

I tried these steps (following [2] though the module is not out of
tree):
1. installed kernel-devel package
2. got a git pull on Linus' kernel git from [3]
3. rebased the kernel to v3.11 (the one I use)
4. cd'ed to drivers/net/wireless/ath/ath9k/
5. applied the changes from [1]
6. ran
$ make -C /lib/modules/3.11.9-300.fc20.x86_64/build/ M=`pwd` modules
(compiled successfully)
7. ran
$ sudo make -C /lib/modules/3.11.9-300.fc20.x86_64/build/ M=`pwd`
modules_install
output (I don't really understand that)
~~~~~
make: Entering directory `/usr/src/kernels/3.11.9-300.fc20.x86_64'

INSTALL /home/christian/src/KERNEL/linux/drivers/net/wireless/ath/ath9k/ath9k.ko
Can't read private key

INSTALL /home/christian/src/KERNEL/linux/drivers/net/wireless/ath/ath9k/ath9k_common.ko
Can't read private key

INSTALL /home/christian/src/KERNEL/linux/drivers/net/wireless/ath/ath9k/ath9k_htc.ko
Can't read private key

INSTALL /home/christian/src/KERNEL/linux/drivers/net/wireless/ath/ath9k/ath9k_hw.ko
Can't read private key
  DEPMOD  3.11.9-300.fc20.x86_64
make: Leaving directory `/usr/src/kernels/3.11.9-300.fc20.x86_64'
~~~~~

8. ran (with output)
# modprobe -r ath9k_htc
rmmod ath9k_htc
rmmod mac80211
rmmod ath9k_common
rmmod ath9k_hw
rmmod ath
rmmod cfg80211

and made sure that
# lsmod | grep ath9k
listed no more modules

9. loaded cfg80211 and ath using modprobe (ath9k module requires them)
# modprobe cfg80211
# modprobe ath
# modprobe mac80211

10. tried to load newly built ath9k modules
(from /usr/lib/modules/3.11.9-300.fc20.x86_64/extra where the *.ko files
were installed to in step 7. )
# modprobe -a ./ath9k*
builtin ./ath9k_common.ko
builtin ./ath9k_htc.ko
builtin ./ath9k_hw.ko
builtin ./ath9k.ko

This looks very strange to me.
I tried to manually insert those modules using insmod (according to the
dependencies listet in $ modinfo).
# insmod ./ath9k_hw.ko
# insmod ./ath9k_common.ko
and so on worked fine.


Did I do it right? Is 10. a bug?

regards
Chris



[1] https://bugzilla.kernel.org/show_bug.cgi?id=61111
[2]
https://fedoraproject.org/wiki/Building_a_custom_kernel#Building_Only_Kernel_Modules_.28Out_Of_Tree_Modules.29

Additional info:
$ uname -a
Linux chstpc-2 3.11.9-300.fc20.x86_64 #1 SMP Wed Nov 20 22:23:25 UTC
2013 x86_64 x86_64 x86_64 GNU/Linux

before changing anything:
$ lsmod | grep ath
ath9k_htc              65868  0 
ath9k_common           13503  1 ath9k_htc
ath9k_hw              439078  2 ath9k_common,ath9k_htc
ath                    23142  3 ath9k_common,ath9k_htc,ath9k_hw
mac80211              564847  1 ath9k_htc
cfg80211              460310  3 ath,mac80211,ath9k_htc


More information about the kernel mailing list