Insert modules (*.ko) that have circular dependencies
I have three Linux kernel modules (*.ko
files). They have circular dependencies like this:
mod1.ko
uses functions exported bymod3.ko
mod2.ko
uses functions exported bymod1.ko
mod3.ko
uses functions 开发者_开发知识库exported bymod1.ko
andmod2.ko
I cannot load the first mod1.ko
file because of "Unknown symbol" error. I also tried two other methods but I got the same error:
load all modules at a time
insmod mod1.ko mod2.ko mod3.ko
Put these files in
/lib/modules/kernel_version/my_modules
, and rundepmod kernel_version modprobe mod3
Can anyone help me please! Any suggestions are appreciated. Thanks in advance :)
Well, how about merge those three modules into one?
I encountered the same problem. Merging the modules was not a good solution in my case.
What I eventaully did was to add use callback function instead of the original function. And to registrate the function in the other module using registration routines (need to use function pointer for that).
This has eliminated the dependency between the modules.
You can then insert the non-dependent module first, and the dependent module afterwards.
精彩评论