0

After upgrading from Ubuntu 18 to 20.04 I need to patch bluetooth driver in order to make it work. After following How do I get my bluetooth device working? I had issues to complie getting error

kernel: [13632.548685] btusb: version magic '5.4.44 SMP mod_unload ' should be '5.4.0-42-generic SMP mod_unload '

Any ideas how to fix mismatch?

zague
  • 23

1 Answers1

1

The error is telling you that you compiled your driver against 5.4.44 kernel source but you are running 5.4.0. If you do a uname -a on your Linux box you will probably see that you are running 5.4.0-42-generic and if you do a modinfo on your .ko file you will see it is 5.4.44.

For what ever reason the Linux source in Ubuntu is now returning a sublevel of 44 instead of 0. You can see this in the top directory of the linux source tree in the Makefile at line 4. It seemed to change between 20.04 and 20.04.1. I'm not sure if that was intentional since it's based on the 5.4.44 branch. I was doing some performance testing and when I tried to recompile my kernel I couldn't get cpufreq-info to work. I changed my sublevel back to zero recompiled the kernel and cpufreq-info would work.

I'm sure this is not the correct way to fix it but I was able to continue. I tried doing a apt source linux and apt source linux-5.4.0 both had the sublevel set to 44.

  • This is what i did to fix it. Thank you it_might_help by the light in this.

    took reference of https://www.jianshu.com/p/122e6c18e058

    Modify Makefile

    cd ~/build/linux-5.4.0 sudo nano Makefile SUBLEVEL = 0 EXTRAVERSION = -44-generic

    sudo cp /usr/src/linux-headers-$(uname -r)/.config ./ sudo cp /usr/src/linux-headers-$(uname -r)/Module.symvers Module.symvers sudo make prepare sudo make modules_prepare sudo make M=drivers/bluetooth/

    – zague Aug 27 '20 at 18:02