0

-PROBLEM DESCRITION
I’ve compiled a new uvcdriver.ko https://github.com/Giuliano69/uvc_driver-for-Quanta-HD-User-Facing-0x0408-0x4035- but I’m facing this error once I try to install the module

giuliano@Astra2A:~$ sudo rmmod uvcvideo && sudo modprobe uvcvideo
modprobe: ERROR: could not insert 'uvcvideo': Exec format error

        

and dmesg shows:

[25961.151982] usbcore: registered new interface driver uvcvideo   
[26323.125534] usbcore: deregistering interface driver uvcvideo   
[26323.189294] uvcvideo: disagrees about version of symbol module_layout

Googling on internet, the problem seems to happens when we want to use a module compiled for a different kernel version.

These are the TWO modinfo from the old and new uvcvideo modules https://pastebin.com/tSj8Exm6

Basically
OLD module: vermagic: 5.15.0-56-generic SMP mod_unload modversions
NEW module: vermagic: 5.15.64 SMP mod_unload modversions

-HOST CONFIGURATION

I’m using this kernel

giuliano@Astra2A:~$ cat /proc/version_signature
Ubuntu 5.15.0-56.62-generic 5.15.64

BUT on the closest kernel I found on Ubuntu archive is 5,15 and seems to be different: https://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/linus--linux/refs/tags

to allow Eclipse to compile the kernel, I had to pass this commands:

scripts/config --disable CONFIG_SYSTEM_REVOCATION_KEYS  
scripts/config --disable SYSTEM_REVOCATION_KEYS  
scripts/config --disable SYSTEM_TRUSTED_KEYS 

the kernel is compiling without errors and the uvcvideo.ko is produced

-kindly ASK

-WHERE cane I found an Ubuntu kernel SOURCE to exactly match the version I’m running ?
-HOW can FORCE the uvcdriver.c to match mi kernel version ?
-Have I got OTHER ways to make the kernel module I’m compiling, match my running system ?

Giuliano69
  • 11
  • 4
  • You need to get understanding why you have some custom version of the kernel. Ubuntu as any other disttro has a package manger that is capable of install the kernel and necessary toolchain with required headers, etc. I would recommend to start from understanding how `apt` works. – 0andriy Jan 03 '23 at 10:00
  • You shouldn't need to compile a kernel. Installing the `linux-headers-generic` package will install the headers required to compile for the latest generic kernel version. If you are not running the latest generic kernel, you can install the headers for a specific kernel version if the packages are still available, e.g. `linux-headers-5.15.0-56-generic`. If not available, upgrade to the latest kernel first. Then build the module for the kernel source directory "/lib/modules/$(uname -r)/build". – Ian Abbott Jan 03 '23 at 17:39
  • @0andriy you can test that the lnux source verion available on apt is NOT updated with the system: apt search linux-s* linux-source-5.15.0 - Linux kernel source for version 5.15.0 with Ubuntu patches. The current installation shows instead giuliano@Astra2A:~$ cat /proc/version_signature Ubuntu 5.15.0-56.62-generic 5.15.64 – Giuliano69 Jan 04 '23 at 20:26
  • @IanAbbott unfortunately the linux-source* avaliable in apt is "5.15.0 with Ubuntu patches", AND the source available on https://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/linus--linux/commit/?h=v5.15 is 5.15 rc7...STILL different from the one the 22.04LTS is using.... this is the deadlock I'm facing.... The same result will happen using only the headers: the compiled module (compiled with an header that has a version different from the running system) will show a different version from the running system, and it will be prevented from installation.. – Giuliano69 Jan 04 '23 at 20:29
  • Just install the kernel sources via `apt`. What you are pointing is a repository with a kernel which has no relation to the official that users get. See my first comment here. – 0andriy Jan 05 '23 at 08:25
  • You shouldn't need the full kernel sources to build the driver for the running kernel. The linux-headers package that matches the running kernel should be sufficient. – Ian Abbott Jan 05 '23 at 13:57
  • I got the solution for the right source to compile from @jeremy at https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2000947. The source to download for the uvc module is NOT inside "normal" source, BUT inside the **module-extra** one: apt-get source linux-modules-extra-$(uname -r) The downloaded source version is aligned with the kernel and got installed, BUT the signature is not verified so the kernel is tainted... – Giuliano69 Jan 16 '23 at 17:49

0 Answers0