在重新启动之后,由insmod命令安装的模块会保留吗?

我正在阅读的书是如何描述insmod工具的:

程序将模块代码和数据加载到内核中,而内核又执行类似于ld的function,因为它将模块中的任何未parsing的符号链接到内核的符号表。 但是,与链接器不同,内核不会修改模块的磁盘文件,而是修改内存中的副本。

它看起来不会持续,因为它在内存中,但我不确定。

不,他们不会。 重新启动后,您从头开始。

通常情况下,对于每次重新启动后要加载的模块,都会列出一个configuration文件,列出在启动时自动加载的模块。

看看/etc/modules

man modules

 NAME /etc/modules - kernel modules to load at boot time DESCRIPTION The /etc/modules file contains the names of kernel modules that are to be loaded at boot time, one per line. Arguments can be given in the same line as the module name. Lines beginning with a '#' are ignored. 

当你的系统重新启动时,使用insmod手动加载的模块不会持久存在(对于这种行为,请参阅modules.conf modules的联机帮助手册,它基本上在重新启动时自动运行insmod ,但具有更多的智能)。

ed:modules,而不是modules.conf(后者在编写具有依赖关系的自定义模块时非常有用)