I am trying to recompile the sound/usb module on Ubuntu 18.10 against the running kernel. I get no compilation errors but when I try to load the module I get this error:

Invalid module format

I am running the 4.18.0-21-lowlatency kernel.

I obtain the kernel source this way

apt source linux

This downloads and extracts the source of the 4.18.0 kernel into the linux-4.18.0 folder.

I copy the .config and Module.symvers files from /lib/modules/4.18.0-21-lowlatency/build to the root of my kernel source directory.

I run make EXTRAVERSION=-21-lowlatency modules_prepare, and then make EXTRAVERSION=-21-lowlatency M=sound/usb

Running insmod results in the following error written into syslog

snd_usb_audio: version magic '4.18.20-21-lowlatency SMP preempt mod_unload ' should be '4.18.0-21-lowlatency SMP preempt mod_unload '

Running modinfo /lib/modules/uname -r/kernel/sound/usb/snd-usb-audio.ko | grep vermagic returns this

vermagic:       4.18.0-21-lowlatency SMP preempt mod_unload

Running modinfo on my newly compiled module returns this

vermagic:       4.18.20-21-lowlatency SMP preempt mod_unload

I traced back the issue to the first few lines of the Makefile


If I change the SUBLEVEL to 0 and then compile, I can successfully load the module.

So even though I am running the 4.18.0 kernel, and the apt source linux seems to download the 4.18.0 kernel, the downloaded files are versioned 4.18.20.

Is this normal or I am missing something?

New contributor
szszoke is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

szszoke is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.