linux - insmod 和 modprobe 有什么区别?

标签 linux module linux-kernel

我知道 insmodmodprobe 用于将模块插入内核。 但是,它们之间有什么区别?

而且,为什么在 modprobe 中使用 force 选项插入模块是危险的?

最佳答案

modprobeinsmod 的智能版本。 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/

相关文章:

linux - php mail()函数在centos6服务器上执行时间太长

python - 获取 "No Module Named Spotipy"

linux - Linux reboot() 系统调用的魔数(Magic Number)

linux - 从源代码构建 Linux 内核 (linux-4.10.10.tar.xz)

ruby net/sftp 在将文件上传到远程时出现写入错误

linux - 如何将多个输入从文件重定向到正在 gdb 中调试的二进制文件?

linux - 删除特定列后的字符

python - 在 Python 中共享存储在更高目录中的模块和类的最佳实践

eclipse - 在 Eclipse 中定义 Java 9 多模块项目

sockets - 套接字对和成对的未命名管道之间有什么区别吗?