uTools-Manuals/docs/linux/insmod.html
2019-04-21 11:50:48 +08:00

28 lines
1.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="insmod">insmod</h1>
<p>将给定的模块加载到内核中</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>insmod命令</strong> 用于将给定的模块加载到内核中。Linux有许多功能是通过模块的方式在需要时才载入kernel。如此可使kernel较为精简进而提高效率以及保有较大的弹性。这类可载入的模块通常是设备驱动程序。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">insmod(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-f不检查目前kernel版本与模块编译时的kernel版本是否一致强制将模块载入
-k将模块设置为自动卸除
-m输出模块的载入信息
-o&lt;模块名称&gt;:指定模块的名称,可使用模块文件的文件名;
-p测试模块是否能正确地载入kernel
-s将所有信息记录在系统记录文件中
-v执行时显示详细的信息
-x不要汇出模块的外部符号
-X汇出模块所有的外部符号此为预设置。</code></pre>
<h3 id="参数">参数</h3>
<p>内核模块:指定要加载的内核模块文件。</p>
<h3 id="实例">实例</h3>
<p>加载RAID1阵列级别模块如下所示</p>
<pre><code class="language-bash">[root@localhost boot]# insmod /lib/modules/2.6.
18-8.el5/kernel/drivers/md/raid1.ko
[root@localhost boot]# lsmod | grep raid1
raid1 25153 0</code></pre>
<p>从以上显示结果可知RAID1模块已加载成功。只是在使用insmod命令加载模块时需要使用绝对路径方能加载且加载时无法自动解决依赖关系。</p>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->