2

If I have a Linux module that was compiled for kernel x, can I expect the compiled module to also work with kernel y or is that generally not the case?

4
  • 5
    You can't expect anything. it may work if nothing it uses changed in the kernel, it may not, if something did change. It's strictly empirical, nobody can answer this question for you, it's not a generic situation. – Lizardx Aug 31 '17 at 3:37
  • 1
    It depends. Some Linux distributions such as Red Hat support a kABI (Kernel Application Binary Interface.) Others do not. – fpmurphy Aug 31 '17 at 5:42
  • 3
    You generally can't expect it to work, which is why there is dkms. – atype Aug 31 '17 at 7:41
  • 1
    @Lizardx I agree a specific answer would depend on the specific kernel versions, but it’s not “strictly empirical”: there are kernel ABI rules which can be used to determine whether two kernels can share modules (see the RHEL and Debian kernels for examples of this). – Stephen Kitt Sep 6 '17 at 5:16
1

In general, kernel modules are not loaded for other versions.
You can check the module information with the modinfo command.
The kernel version information of modinfo's vermagic and uname commands will help.

But if you really want to, the -f option of the modprobe command will help.(modprobe man page)
This option allows you to ignore the version information when you load the kenrel module.
This option is not a panacea.
You should be familiar with the kernel module and kernel version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.