I'd like to recompile one of the wifi modules, namely drivers/net/wireless/realtek/rtl8xxxu/. I'm using ubuntu 16.04.3.
My kernel version :
Linux fisk 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
I have the necessary headers in linux-headers-4.10.0-38-generic as well as the linux source in /usr/src/linux-source-4.10.0
I can build the module just fine in /usr/src/linux-source-4.10.0
if I do make -j8 SUBDIRS=drivers/net/wireless/realtek/rtl8xxxu/, however the vermagic doesn't match that of my kernel and as a result the module cannot be loaded:
modinfo drivers/net/wireless/realtek/rtl8xxxu//rtl8xxxu.ko | grep vermagic
vermagic: 4.10.17 SMP mod_unload
As a result when loading I get in dmesg:
rtl8xxxu: version magic '4.10.17 SMP mod_unload ' should be '4.10.0-38-generic SMP mod_unload '
So my question is what is the correct way to build the module and being able to load it on my kernel?