八津尾です。
Debian Kernel Handbook 6 章 の翻訳です。
査読をお願いします。
titanpad は http://yyatsuo.titanpad.com/9 になります。
<chapt id="modules">
<!-- Managing the kernel modules -->
<heading>カーネルモジュールの管理</heading>
<!--
Linux device drivers come in the form of kernel modules - object
files which may be loaded into the running kernel to extend its
functionality. The list of currently loaded kernel modules can be
obtained using the <tt>lsmod</tt> command, modules may be loaded
using <tt>modprobe</tt>, and removed using <tt>modprobe -r</tt>.
The <tt>depmod</tt> command may be used to regenerate the list of
available modules (after installation of the new modules, for
example), even though it is pretty unlikely that you will ever
need to invoke it by hand.
-->
<p>
Linux デバイスドライバはカーネルモジュール形式 - 機能拡張の
ために動作中のカーネルにロード可能なオブジェクトファイル - で配布
されます。現在カーネルにロードされているモジュールの一覧は <tt>ls
mod</tt> コマンドで取得できます。モジュールは <tt>modprobe</tt> コ
マンドでロードし、<tt>modprobe -r</tt> コマンドで取り外すことがで
きます。<tt>depmod</tt> コマンドは、手動で起動する必要はほとんどあ
りませんが、利用可能なモジュール一覧の再生成 (例えば新しいモジュー
ルをインストールした直後など) に使用することができます。
</p>
<!--
Normally, the devices are detected and neccessary kernel modules
are loaded by <tt>udev</tt> during boot time. Occasionally, one
may need finer control over the loading of kernel modules, for
example to pass the additional parameters to the module, force
loading of some modules on startup, or prevent certain module(s)
from being loaded.
-->
<p>
通常、起動時にデバイスが検出され必要なカーネルモジュールが <tt>u
dev</tt> によってロードされます。稀に、カーネルモジュールのロード
をより細かくコントロールする必要のある人がいます。例えば、追加の
パラメータをモジュールに渡したり、スタートアップ時にいくつかのモ
ジュールをロードしたり、特定のモジュールがロードされないようにし
たり、などです。
</p>
<!--
If some modules are not loaded automatically by <tt>udev</tt>, but
you would like them to be loaded during boot, it is possible to force
it by listing the names of the modules in <tt>/etc/modules</tt>.
This will be scanned for the names of
the modules (one name per line), which will then be loaded using
<tt>modprobe</tt>. You can also specify the arguments for the modules.
For example, a typical <tt>/etc/modules</tt> might look like that
<example>
loop max_int2
sbp2
</example>
To find out what parameters are accepted by a given module, you can
use the <tt>modinfo</tt> command, for example:
-->
<p>
もし、<tt>udev</tt> で自動的にロードされないモジュールを、起動時
にロードしたければ、そのモジュールを<tt>/etc/modules</tt>に列挙す
ることで、強制的にロードさせることも可能です。このファイルはライ
ン毎にモジュール名をスキャンされ (各ラインに1 モジュール) 、その
モジュールは <tt>modprobe</tt> でロードされます。モジュールの引数
を指定することもできます。例えば、典型的な <tt>/etc/modules</tt>
ファイルは以下のようになっています。
<example>
loop max_int2
sbp2
</example>
与えられたモジュールに対して有効なパラメータを知りたい場合は、
<tt>modinfo</tt> コマンドを使います。以下に例を示します。
<example>
# modinfo loop
filename: /lib/modules/3.2.0-2-686-pae/kernel/drivers/block/loop.ko
alias: devname:loop-control
alias: char-major-10-237
alias: block-major-7-*
license: GPL
depends:
intree: Y
vermagic: 3.2.0-2-686-pae SMP mod_unload modversions 686
parm: max_loop:Maximum number of loop devices (int)
parm: max_part:Maximum number of partitions per loop device (int)
</example>
</p>
<!--
To add custom arguments to the modules loaded by <tt>udev</tt>
early in the boot process, you need to create a custom
configuration file for <tt>modprobe</tt>, which <tt>udev</tt>
uses to load the modules. For example, to pass an
<tt>atapi_enabled=1</tt> argument to the <tt>libata</tt> kernel
module, create <tt>/etc/modprobe.d/local</tt> file with a
following line:
<example>
options libata atapi_enabled=1
</example>
You can choose arbitrary names for the configuration files in
<tt>/etc/modprobe.d</tt> and put multiple <tt>options</tt> lines in
the same file.
-->
<p>
ブートプロセスの初期段階で<tt>udev</tt>によってロードされるモジュ
ールに特別な引数を渡すには、<tt>udev</tt>がモジュールのロードに使
用する <tt>modprobe</tt> 用のカスタム設定ファイルを作らなければな
りません。例えば、引数 <tt>atapi_enabled=1</tt> を <tt>libata</tt>
カーネルモジュールへ渡すには、次の行を含む<tt>/etc/modprobe.d/lo
cal</tt>ファイルを作成します。
<example>
options libata atapi_enabled=1
</example>
<tt>/etc/modprobe.d</tt> 内の設定ファイルには、任意の名前を使用でき、
複数の <tt>options</tt> 行を同一ファイル内に記述できます。
</p>
<!--
Sometimes two different modules claim support for the same
device, usually because two slightly different versions of the
device exist, requiring different kernel modules to operate. In
such situation <tt>udev</tt> loads both kernel modules, with
unpredictable results. To avoid this problem, you can prevent
any module (let's say, <tt>tulip</tt>) from loading by creating
an arbitrarily named file, containing a line
<example>
blacklist tulip
</example>
in <tt>/etc/modprobe.d</tt> directory. See the <tt>modprobe</tt>
manual page (<tt>man modprobe</tt>) for much more information on
configuring and using modprobe.
-->
<p>
時として、2 つの異なるモジュールが同じデバイスのサポートを宣言し
ていることがあります。たいていの場合、2 つのやや異なるバージョン
のデバイスが存在し、動作に異なるカーネルモジュールを要求している
ことが原因です。そのような状況では、<tt>udev</tt> が両方のカーネ
ルモジュールをロードし、予期しない結果になります。この問題を避け
るため、任意のモジュール (例えば <tt>tulip</tt> だとしましょう)
のロードを防ぐには、<tt>/etc/modprobe.d</tt> ディレクトリ内に
<example> blacklist tulip </example> という行を記述した任意の名前
のファイルを作成します。modprobe の使い方や設定方法に関するより詳
しい情報は、<tt>modprobe</tt> のマニュアルページ (<tt>man modprob
e</tt>) を参照してください。
</p>
</chapt>
Attachment:
signature.asc
Description: Digital signature