I am trying to build and install kernel modules for a network card, from source. The module sources seem very picky in terms of which kernel version they can compile against.
I have managed to build the modules against the LTS kernel headers for my distribution, Arch Linux, which at the moment are linux-lts-headers 5.10.37-1
. Does this mean that I need to actually install and boot this exact same kernel version, to use the modules? Or do the modules have some tolerance between the booted version and the version they were compiled against?
I realise this is dependent on what exactly I'm building but I'm interested in common practice, do's and don'ts. For example, for a rolling release distro it would be a lot of work to rebuild the module with every minor mainline kernel update, for example right now linux-headers 5.12.3
-> linux-headers 5.12.4
. Pointers appreciated.
That's why you usually never find prebuilt kernel module distributed somewhere. You have to build kernel module with kernel headers of your running kernel. Common practice is always having the right kernel headers in your /usr/src