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?

  • 1
    I already read the given answer here askubuntu.com/questions/168279/… However, it's producing a driver with invalid vermagic Nov 13, 2017 at 12:50
  • Isn’t rtl8xxxu already included in kernel version 4.10? You may only need a slight tweak. Please post the result of: lsmod | grep rtl. Welcome to Ask Ubuntu.
    – chili555
    Nov 13, 2017 at 13:04
  • Is secureboot enable on your system?
    – pim
    Nov 13, 2017 at 13:05
  • Secure boot is not enabled. rtl8xxxu is part of the kernel, however it's missing a commit which adds the usb vendor/product ids for my product. Nov 13, 2017 at 18:04

1 Answer 1


So eventually I answered my question. The command which I needed to execute was :

make -C /lib/modules/`uname -r`/build M=/home/foo/projects/kernel/linux-hwe-4.10.0/drivers/net/wireless/realtek/rtl8xxxu/

After that doing modinfo shows the correct thing and the module can be inserted:

modinfo /home/foor/projects/kernel/linux-hwe-4.10.0/drivers/net/wireless/realtek/rtl8xxxu//rtl8xxxu.ko | grep vermagic
vermagic:       4.10.0-38-generic SMP mod_unload 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .