开发者

How to reload modified kernel modules

开发者 https://www.devze.com 2023-02-03 15:33 出处:网络
How can I instruct the system to reload all kernel modules that have changed? (I am developing a driver with several modules. I want a quick and error-free method to reload all the modules that cha开发

How can I instruct the system to reload all kernel modules that have changed? (I am developing a driver with several modules. I want a quick and error-free method to reload all the modules that cha开发者_运维知识库nge.)


There is no simple, error-free way since a bug in the code that adds/removes the driver from the kernel can make it impossible to get rid of a module. In a similar way, a bug in the driver can cause a deadlock in some interrupt handler so the kernel can never unload the module.

Also, there is no automatic way to do it since the kernel doesn't check the modules files for changes.

All you can do is write a small script that calls rmmod in the correct order to remove the modules and then modprobe's the new versions into the kernel.


Using rmmod to remove the added modules and using modprobe to load the debugged modules again is the only effective solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消