LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Strict Kernel version in Ubuntu (https://www.linuxquestions.org/questions/linux-kernel-70/strict-kernel-version-in-ubuntu-4175729342/)

toregunnar 09-27-2023 02:50 PM

Strict Kernel version in Ubuntu
 
Using Ubuntu 22.04 LTS, an issue is that there seem to be a strict check regarding Kernel version when trying to install a driver.
The driver is compiled with a newer Kernel version and when trying to install the driver, it fails due to incompatible Kernel version.

Can the strict version check be loosened so that installation of the driver will be possible even if the Kernel version is different.

There seems to exist a compiler flag CONFIG_MODVERSIONS,
that could fix this problem, but question is if both the Kernel and the driver need to be compiled with this flag, or is it enough that the driver, or the Kernel is compiled with that flag?

Thanks.

michaelk 09-27-2023 06:04 PM

Welcome to LinuxQuestions.

You didn't post what hardware you are trying to get working but if the driver needs a newer kernel then chances are quite good (like 100%) it isn't going to work. You can force the driver (aka module) to load using modprobe -f which strips versioning information but I take no responsibility for anything bad that happens.

toregunnar 09-28-2023 05:06 AM

Thanks.

An additional question to your answer
- Would it be enough to recompile the driver module using that flag, or do I need also to recompile the target Kernel also with that flag?
I tried the modprobe -f but the Kernel version strictness did not allow to insert that module, but did not recompile the module or the target Kernel.

Hopefully,

michaelk 09-28-2023 01:24 PM

Quote:

- Would it be enough to recompile the driver module using that flag, or do I need also to recompile the target Kernel also with that flag?
I am not a kernel expert but I would say no. If a device is supported in a particular kernel version as far as I know it isn't going to work in a lower version regardless.


All times are GMT -5. The time now is 03:02 AM.