Page 1 of 1

Get exact running kernel's source

Posted: 2021-12-03 15:26
by oT2
Hi,

I am trying to compile DRBD with my kernel source. I ran `apt-get source linux`, `apt-get install linux-source` I tried them with `-$(uname -r)` at the end but none of them give me the exact source.

cat /proc/version and uname -r give me the following version: Linux version 4.19.0-18-amd64

all my source download attempts gave me version 4.19.208 or 4.19.194. Once I build DRBD with those and run make install, drbd.ko ends up in /lib/modules/4.19.208/... and not /lib/modules/4.19.0-18-amd64/...

I tried to copy the build to /lib/modules/4.19.0-18-amd64, but then modprobe drbd throws an error
root@linux-vm:~# modprobe drbd
modprobe: ERROR: could not insert 'drbd': Exec format error

Is there no way to get exact sources for a specific debian release ?

Thank you,
Gab

Re: Get exact running kernel's source

Posted: 2022-01-24 15:38
by jby
Update your running kernel to one of the ones you find sources for, then it ought to be easy to install the sources and build DRBD for that kernel.

Re: Get exact running kernel's source

Posted: 2022-01-24 16:15
by p.H
If you want to build a foreign module for your running kernel you need to install the matching linux-headers-$(uname -r), not linux-source.