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
I obtain the kernel source this way
apt source linux
This downloads and extracts the source of the
4.18.0 kernel into the
I copy the
Module.symvers files from
/lib/modules/4.18.0-21-lowlatency/build to the root of my kernel source directory.
make EXTRAVERSION=-21-lowlatency modules_prepare, and then
make EXTRAVERSION=-21-lowlatency M=sound/usb
insmod results in the following error written into
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 '
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
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
VERSION = 4 PATCHLEVEL = 18 SUBLEVEL = 20
If I change the
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
Is this normal or I am missing something?