kmod.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-system-kmod" role="wrap">
  8. <?dbhtml filename="kmod.html"?>
  9. <sect1info condition="script">
  10. <productname>kmod</productname>
  11. <productnumber>&kmod-version;</productnumber>
  12. <address>&kmod-url;</address>
  13. </sect1info>
  14. <title>Kmod-&kmod-version;</title>
  15. <indexterm zone="ch-system-kmod">
  16. <primary sortas="a-Kmod">Kmod</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>Kmod 软件包包含用于加载内核模块的库和工具。</para>
  21. <segmentedlist>
  22. <segtitle>&buildtime;</segtitle>
  23. <segtitle>&diskspace;</segtitle>
  24. <seglistitem>
  25. <seg>&kmod-ch6-sbu;</seg>
  26. <seg>&kmod-ch6-du;</seg>
  27. </seglistitem>
  28. </segmentedlist>
  29. </sect2>
  30. <sect2 role="installation">
  31. <title>安装 Kmod</title>
  32. <para>准备安装 Kmod:</para>
  33. <screen><userinput remap="configure">./configure --prefix=/usr \
  34. --bindir=/bin \
  35. --sysconfdir=/etc \
  36. --with-rootlibdir=/lib \
  37. --with-xz \
  38. --with-zlib</userinput></screen>
  39. <variablelist>
  40. <title>配置选项的含义:</title>
  41. <varlistentry>
  42. <term><parameter>--with-xz, --with-zlib</parameter></term>
  43. <listitem>
  44. <para>它们允许 Kmod 处理压缩过的内核模块。</para>
  45. </listitem>
  46. </varlistentry>
  47. <varlistentry>
  48. <term><parameter>--with-rootlibdir=/lib</parameter></term>
  49. <listitem>
  50. <para>该选项保证一些和库有关的文件被放置在正确的目录中。</para>
  51. </listitem>
  52. </varlistentry>
  53. </variablelist>
  54. <para>编译该软件包:</para>
  55. <screen><userinput remap="make">make</userinput></screen>
  56. <para>该软件包不包含能在 LFS chroot 环境下运行的测试套件。
  57. 测试套件至少需要 git 程序的支持,且有些测试在 git 仓库外不会运行。
  58. </para>
  59. <!--
  60. <para>运行以下命令以测试编译结果:</para>
  61. <screen><userinput remap="test">make check</userinput></screen>
  62. -->
  63. <para>安装该软件包,并创建与 Module-Init-Tools (曾经用于处理 Linux
  64. 内核模块的软件包)兼容的符号链接:</para>
  65. <screen><userinput remap="install">make install
  66. for target in depmod insmod lsmod modinfo modprobe rmmod; do
  67. ln -sfv ../bin/kmod /sbin/$target
  68. done
  69. ln -sfv kmod /bin/lsmod</userinput></screen>
  70. </sect2>
  71. <sect2 id="contents-kmod" role="content">
  72. <title>Kmod 的内容</title>
  73. <segmentedlist>
  74. <segtitle>安装的程序</segtitle>
  75. <segtitle>安装的库</segtitle>
  76. <seglistitem>
  77. <seg>depmod (到 kmod 的链接), insmod (到 kmod 的链接), kmod,
  78. lsmod (到 kmod 的链接), modinfo (到 kmod 的链接), modprobe (到 kmod 的链接),
  79. 以及 rmmod (到 kmod 的链接)</seg>
  80. <seg>libkmod.so</seg>
  81. </seglistitem>
  82. </segmentedlist>
  83. <variablelist>
  84. <bridgehead renderas="sect3">简要描述</bridgehead>
  85. <?dbfo list-presentation="list"?>
  86. <?dbhtml list-presentation="table"?>
  87. <varlistentry id="depmod">
  88. <term><command>depmod</command></term>
  89. <listitem>
  90. <!--para>Creates a dependency file based on the symbols it finds in the
  91. existing set of modules; this dependency file is used by
  92. <command>modprobe</command> to automatically load the required
  93. modules</para-->
  94. <para>根据现有模块的符号信息创建依赖关系文件;
  95. <command>modprobe</command>
  96. 使用依赖关系文件自动加载需要的模块。</para>
  97. <indexterm zone="ch-system-kmod depmod">
  98. <primary sortas="b-depmod">depmod</primary>
  99. </indexterm>
  100. </listitem>
  101. </varlistentry>
  102. <varlistentry id="insmod">
  103. <term><command>insmod</command></term>
  104. <listitem>
  105. <para>在正在运行的内核中安装可加载模块</para>
  106. <indexterm zone="ch-system-kmod insmod">
  107. <primary sortas="b-insmod">insmod</primary>
  108. </indexterm>
  109. </listitem>
  110. </varlistentry>
  111. <varlistentry id="kmod">
  112. <term><command>kmod</command></term>
  113. <listitem>
  114. <para>加载或卸载内核模块</para>
  115. <indexterm zone="ch-system-kmod kmod">
  116. <primary sortas="b-kmod">kmod</primary>
  117. </indexterm>
  118. </listitem>
  119. </varlistentry>
  120. <varlistentry id="lsmod">
  121. <term><command>lsmod</command></term>
  122. <listitem>
  123. <para>列出当前加载的模块</para>
  124. <indexterm zone="ch-system-kmod lsmod">
  125. <primary sortas="b-lsmod">lsmod</primary>
  126. </indexterm>
  127. </listitem>
  128. </varlistentry>
  129. <varlistentry id="modinfo">
  130. <term><command>modinfo</command></term>
  131. <listitem>
  132. <para>检验与某个内核模块相关的目标文件,
  133. 打印它能够收集到的一切信息</para>
  134. <indexterm zone="ch-system-kmod modinfo">
  135. <primary sortas="b-modinfo">modinfo</primary>
  136. </indexterm>
  137. </listitem>
  138. </varlistentry>
  139. <varlistentry id="modprobe">
  140. <term><command>modprobe</command></term>
  141. <listitem>
  142. <para>使用一个 <command>depmod</command> 创建的依赖关系文件,
  143. 自动加载相关模块</para>
  144. <indexterm zone="ch-system-kmod modprobe">
  145. <primary sortas="b-modprobe">modprobe</primary>
  146. </indexterm>
  147. </listitem>
  148. </varlistentry>
  149. <varlistentry id="rmmod">
  150. <term><command>rmmod</command></term>
  151. <listitem>
  152. <para>从正在运行的内核中卸载模块</para>
  153. <indexterm zone="ch-system-kmod rmmod">
  154. <primary sortas="b-rmmod">rmmod</primary>
  155. </indexterm>
  156. </listitem>
  157. </varlistentry>
  158. <varlistentry id="libkmod">
  159. <term><filename class="libraryfile">libkmod</filename></term>
  160. <listitem>
  161. <para>这个库被其他程序用于加载和卸载内核模块</para>
  162. <indexterm zone="ch-system-kmod">
  163. <primary sortas="c-libkmod">libkmod</primary>
  164. </indexterm>
  165. </listitem>
  166. </varlistentry>
  167. </variablelist>
  168. </sect2>
  169. </sect1>