内核模块与使用新补丁重新编译的内核的兼容性
Kernel module compatibility with kernel recompiled with new patch
我想知道 Linux 内核模块是否可以与 Linux 内核版本一起使用,该内核版本的补丁号(版本中的最后一个数字)比编译内核的补丁号更高。
举个例子:
- 您目前正在为 ARM 目标使用 Linux 4.14.75
- 我给你一个 RPM,其中包含协同工作的应用程序和内核模块。该模块是针对 4.14.75 内核编译的。该模块由应用程序使用 insmod 加载。
- 出现安全问题,您将目标的内核更新为 4.14.100。
这种情况,我给你的RPM里的内核模块能不能和新内核一起工作?有没有可能一次编译一个内核就兼容所有4.14内核?
我不是在问 depmod/modprobe 是否有效,或者这是否是一种好的做法。
"Is it possible to compile a kernel once and have it be compatible with all 4.14 kernels?"
如果安全更新和向后移植没有破坏任何东西,也许吧。
然而内核中没有稳定的内核API/ABI。
只有 userland API/ABI 是稳定的。
https://www.phoronix.com/scan.php?page=news_item&px=Linux-Kernel-Stable-API-ABI
https://github.com/torvalds/linux/blob/master/Documentation/process/stable-api-nonsense.rst
这里有个post自动检测,如果有API/ABI到userland会break/breaks:
Linux kernel API changes/additions
对于内核 ABI,我找到了一个工具(以及您的用例):
https://developers.redhat.com/blog/2018/03/28/analyzing-binary-interface-changes-linux-kernel/
我想知道 Linux 内核模块是否可以与 Linux 内核版本一起使用,该内核版本的补丁号(版本中的最后一个数字)比编译内核的补丁号更高。
举个例子:
- 您目前正在为 ARM 目标使用 Linux 4.14.75
- 我给你一个 RPM,其中包含协同工作的应用程序和内核模块。该模块是针对 4.14.75 内核编译的。该模块由应用程序使用 insmod 加载。
- 出现安全问题,您将目标的内核更新为 4.14.100。
这种情况,我给你的RPM里的内核模块能不能和新内核一起工作?有没有可能一次编译一个内核就兼容所有4.14内核?
我不是在问 depmod/modprobe 是否有效,或者这是否是一种好的做法。
"Is it possible to compile a kernel once and have it be compatible with all 4.14 kernels?" 如果安全更新和向后移植没有破坏任何东西,也许吧。 然而内核中没有稳定的内核API/ABI。 只有 userland API/ABI 是稳定的。 https://www.phoronix.com/scan.php?page=news_item&px=Linux-Kernel-Stable-API-ABI https://github.com/torvalds/linux/blob/master/Documentation/process/stable-api-nonsense.rst
这里有个post自动检测,如果有API/ABI到userland会break/breaks: Linux kernel API changes/additions
对于内核 ABI,我找到了一个工具(以及您的用例): https://developers.redhat.com/blog/2018/03/28/analyzing-binary-interface-changes-linux-kernel/