Plebian-Linux / quartz64-images

GitHub Actions Repository for automatically generated images for the Quartz64 family of single board computers
https://plebian.org
GNU General Public License v3.0
41 stars 10 forks source link

Compiling an in-tree module gives version mismatch #41

Closed tapir closed 1 year ago

tapir commented 1 year ago
# uname -a 
Linux plebian-soquartz-model-a 6.1.0-10-arm64 #1 SMP Debian 6.1.38-1 (2023-07-14) aarch64 GNU/Linux

# apt search linux-source-6.1
linux-source-6.1/stable,now 6.1.38-1 all [installed,automatic]

# apt search linux-headers-6.1.0-10-arm64   
linux-headers-6.1.0-10-arm64/stable,now 6.1.38-1 arm64 [installed]

I'm using the linux source from the repos to build an in-tree kernel module which succeeds. When I try to load this module however I get below

modprobe: ERROR: could not insert 'snd_soc_nau8822': Exec format error

According to google this is an error when the kernel I'm on and the source I've used mismatch. Could you point me to the correct source?

CounterPillow commented 1 year ago

That's Debian's problem, we don't mess with the kernel package at all.

What does the output of file say about the .ko?

tapir commented 1 year ago

It says

snd-soc-nau8822.ko: ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV), BuildID[sha1]=35287feef77276111f3daadd376376800670d637, with debug_info, not stripped

But I also noticed when I try to do "make modules_install" by default the modules get installed to /lib/modules/6.1.38 whereas the default modules of the plebian is under /lib/modules/6.1.0-10-arm64

CounterPillow commented 1 year ago

Judging by this StackOverflow answer maybe you have to run depmod?

Either way, the source you're using should be the correct one; we ship Debian's kernel package, and those are Debian's kernel sources.

tapir commented 1 year ago

is there no patches applied for the board itself? can I just compile the full kernel (as I believe it might be related to my problem) and expect it to work?

CounterPillow commented 1 year ago

The only patches for the board are those applied by Debian itself. You can compile the full kernel package, from the sources Debian ships, and it will work.

tapir commented 1 year ago

thanks