我知道 insmod
和 modprobe
用于将模块插入内核。
但是,它们之间有什么区别?
而且,为什么在 modprobe 中使用 force
选项插入模块是危险的?
最佳答案
modprobe
是insmod
的智能版本。 insmod
只是添加一个模块,其中 modprobe
查找任何依赖项(如果该特定模块依赖于任何其他模块)并加载它们。
关于 --force
选项,这里引用手册页中的内容:
Try to strip any versioning information from the module which might otherwise
stop it from loading: this is the same as using both --force-vermagic and
--force-modversion. Naturally, these checks are there for your protection,
so using this option is dangerous unless you know what you are doing.
这表明它被用来跳过内核模块版本检查。如果您使用自己的内核模块或来自任何受信任方,应该没有任何问题。但是你应该知道你在做什么。
关于linux - insmod 和 modprobe 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22891705/