1 .\" Copyright (c) 1996 Free Software Foundation, Inc.
2 .\" This program is distributed according to the Gnu General Public License.
3 .\" See the file COPYING in the kernel source directory.
4 .\" $Id: insmod.8,v 1.10 2004/07/30 13:11:10 nakano Exp $
6 .\" Translated Sun Aug 15 10:54:37 JST 1999
7 .\" by FUJIWARA Teruyoshi <fujiwara@linux.or.jp>
8 .\" Updated Thu 12 Oct 2000 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
9 .\" Updated Sun 28 Jan 2001 by Kentaro Shirakata <argrath@ub32.org>
11 .\" WORD: persistent data 永続データ
12 .\" WORD: prefix プレフィックス
14 .TH INSMOD 8 "October 2, 2001" Linux "Linux Module Support"
16 .\"O insmod \- install loadable kernel module
18 insmod \- ローダブルカーネルモジュールをインストールする
23 [\-fhkLmnpqrsSvVxXyY] [\-e\ persist_name] [\-o\ module_name]
24 [\-O\ blob_name] [\-P\ prefix] module [\ symbol=value\ ...\ ]
28 .\"O installs a loadable module in the running kernel.
30 は実行中のカーネルにローダブルモジュールをインストールする。
33 .\"O tries to link a module into the running kernel by resolving all symbols
34 .\"O from the kernel's exported symbol table.
37 カーネルがエクスポートしているシンボルテーブルにある
40 .\"O If the module file name is given without directories or extension,
42 .\"O will search for the module in some common default directories.
43 .\"O The environment variable MODPATH can be used to override this default.
44 .\"O If a module configuration file such as /etc/modules.conf exists,
45 .\"O it will override the paths defined in MODPATH.
46 ディレクトリや拡張子なしでモジュールファイル名を与えると、
48 は標準のデフォルトディレクトリ(複数)からモジュールを探す。環境変数
49 MODPATH を使って、このデフォルト値を上書きすることができる。
50 /etc/modules.conf のようなモジュール設定ファイルがあれば、
51 こちらの内容が MODPATH での指定を上書きする。
54 .\"O The environment variable MODULECONF can also be used to select a
55 .\"O different configuration file from the default /etc/modules.conf (or
56 .\"O /etc/conf.modules (deprecated)).
57 .\"O This environment variable will override all the definitions above.
58 環境変数 MODULECONF によって、 /etc/modules.conf
59 (あるいは /etc/conf.modules (使わないほうが良い))
61 この環境変数は、上記の指定すべてより優先される。
66 .\"O Attempt load the module even if the version of the running kernel and
67 .\"O the version of the kernel for which the module was compiled do not match.
68 .\"O This only overrides the kernel version check, it has no effect on
69 .\"O symbol name checks. If the symbol names in the module do not match the
70 .\"O kernel then there is no way to force
72 .\"O to load the module.
74 モジュールに組み込まれているカーネルの対象バージョンが異なっても、
76 これはカーネルバージョンチェックだけを無効にし、
78 モジュールのシンボル名がカーネルのものと一致しない場合、
80 に強制的にモジュールをロードさせる方法はない。
83 .\"O Print the help text.
87 .\"O Set the auto-clean flag on the module. This flag will be used by
88 .\"O \fBkerneld\fP(8) to remove modules that have not been used in some
89 .\"O period of time \(em usually one minute.
90 モジュールの auto-clean フラグを設定する。このフラグは
91 \fBkerneld\fP(8) が使用し、
92 一定期間(普通は 1 分)使われなかったモジュールを削除する。
95 .\"O Use \fBflock\fR(2) to prevent simultaneous loads of the same module.
96 同じモジュールを同時にロードすることを防ぐために、\fBflock\fR(2) を用いる。
99 .\"O Output a load map on stdout, making it easier to debug the module in
100 .\"O the event of a kernel panic.
101 ロード時のメモリマップを標準出力に出力する。これにより、
102 カーネルパニックの際のモジュールのデバッグが容易になる。
104 デフォルトでは ksymoops シンボルを定義する。
105 このオプションは \-X/\-x オプションとは独立である。
109 .\"O ksymoops symbols add approximately 260 bytes per loaded module. Unless
110 .\"O you are really short on kernel space and are trying to reduce ksyms to
111 .\"O its minimum size, take the default and get more accurate Oops
113 ksymoops シンボルは、各ローダブルモジュールごとに、
114 約 260 バイトを余分に必要とする。カーネル空間がキツキツで、
115 ksyms を最小にしたいような場合を除き、
116 デフォルトのままにして詳しい Oops デバッグを有効にするほうが良い。
118 .I "-o \fRmodule_name\fI --name\fR=module_name\fI"
119 .\"O Explicitly name the module, rather than deriving the name from the
120 .\"O base name of the source object file.
123 basename に基づいた名前が用いられる。
125 .I "-O \fRblob_name\fI --blob\fR=blob_name\fI"
126 .\"O Save the binary object in
131 .\"O The result is a binary blob (no ELF headers) showing exactly what is
132 .\"O loaded into the kernel, after section manipulation and relocation.
133 このファイルは カーネルにロードされ、セクション操作と再配置が行われた後の
134 状態を正確に表しているバイナリ blob (ELF ヘッダなし)である。
137 .\"O is recommended to get a map of the object.
138 オブジェクトのマッピング情報を得るためには
142 .I "-P \fRprefix\fI --prefix\fR=prefix\fI"
143 .\"O This option can be used with versioned modules for an SMP or bigmem
144 .\"O kernel, since such modules have an extra prefix added in their symbol
146 このオプションは SMP カーネルや bigmem カーネル向けの、
147 バージョン付きモジュールを使うときに利用できる。
148 これらのモジュールには、シンボル名に余分な prefix がつくからである。
149 .\"O If the kernel was built with symbol versions then
151 .\"O will automatically extract the prefix from the definition of
152 .\"O "get_module_symbol" or "inter_module_get", one of which must exist in
153 .\"O any kernel that supports modules. If the kernel has no symbol versions
154 .\"O but the module was built with symbol versions then the user must supply
156 カーネルがシンボルバージョンつきでビルドされると、
157 insmod は自動的に prefix を "get_module_symbol" か "inter_module_get" の定義から取得する
158 (モジュールをサポートする全てのカーネルにはこのどちらかが存在しなければならない)。
160 しかしモジュールがシンボルバージョン付きでビルドされた場合は、
161 ユーザーは \-P を指定する必要がある。
163 .I "-e \fRpersist_name\fI --persist\fR=persist_name\fI"
164 .\"O Specifies where any persistent data for the module is read from on load
165 .\"O and written to when this instantiantion of the module is unloaded.
166 .\"O This option is silently ignored if the module has no persistent data.
167 モジュールの永続データを保存するファイル名を指定する。
168 これはモジュールがロードされた時に読み込まれ、
169 モジュールの実体がアンロードされた時に書き込まれる。
170 モジュールに永続データがない場合はこのオプションは暗黙に無視される。
171 .\"O Persistent data is only read by
173 .\"O if this option is present, by default
175 .\"O does not process persistent data.
178 にこのオプションが指定された場合にのみ読み込まれる。
182 .\"O As a shorthand form,
184 .\"O "" (an empty string) is interpreted by
189 .\"O .BR modules.conf (5))
190 .\"O followed by the filename of the module, relative to the module search
191 .\"O path it was found in, minus any trailing \'.gz', \'.o' and \'.mod'. If
193 .\"O .IR persistdir =
194 .\"O (i.e. persistdir is an empty field) then this shorthand form is
195 .\"O silently ignored.
204 参照)の後ろに、モジュールのファイル名から末尾の \'.gz', \'.o' and \'.mod' を
205 取ったもの(そのモジュールが見つかったモジュール検索パスからの相対パス)が
208 (つまり persistdir に 空フィールド)が指定されていると、
210 .\"O .SS "MODULE PARAMETERS"
212 .\"O Some modules accept load-time parameters to customize their operation.
213 .\"O These parameters are often I/O port and IRQ numbers that vary from
214 .\"O machine to machine and cannot be determined from the hardware.
215 一部のモジュールではロード時にパラメータを指定して、
217 このようなパラメータは I/O ポートや IRQ 番号であることが多い。
219 しかもハードウェアから求めることができないからである。
221 .\"O In modules built for 2.0 series kernels, any integer or character pointer
222 .\"O symbol may be treated as a parameter and modified. Beginning in the
223 .\"O 2.1 series kernels, symbols are explicitly marked as parameters so that
224 .\"O only specific values may be changed. Furthermore type information is
225 .\"O provided for checking the values provided at load time.
226 2.0 系列のカーネル用に構築したモジュールでは、
227 全ての整数と文字ポインタシンボルはパラメータとして扱われ、
229 2.1 系列のカーネルからは、特定の値だけが変更されるように、
230 シンボルにはパラメータかどうかの印が明示的に付けられる。
231 また、ロード時に与えられた値をチェックするために、
234 .\"O In the case of integers, all values may be in decimal, octal or
235 .\"O hexadecimal a la C: 17, 021 or 0x11. Array elements are specified
236 .\"O sequence separated by commas; elements can be skipped by omitting
238 整数の場合には、全ての値は 10 進値、8 進値, 16 進値で
239 C 言語と同じように指定できる (17, 021, 0x11 等)。
240 配列の要素は、値をコンマで区切って並べることにより指定する。
241 値を省略することにより、要素を飛ばすことができる。
243 .\"O In 2.0 series modules, values that do not begin with a number are
244 .\"O considered strings. Beginning in 2.1, the parameter's type information
245 .\"O indicates whether to interpret the value as a string. If the value
246 .\"O begins with double-quotes (\fI"\fP), the string is interpreted as
247 .\"O in C, escape sequences and all. Do note that from the shell prompt,
248 .\"O the quotes themselves may need to be protected from shell interpretation.
249 2.0 系列のモジュールでは、数字で始まらない値は文字列と解釈される。2.1
250 以降では、値を文字列と解釈するかどうかはパラメータの型情報によって判断する。
251 値が二重引用符(\fI"\fP)で始まる場合は、
252 エスケープシーケンスも含めて全て C 言語と同じように文字列として解釈される。
253 シェルのプロンプトで使う場合にはクォート自体もシェルが解釈するため、
255 .\"O .SS "GPL LICENSED MODULES AND SYMBOLS"
256 .SS GPL ライセンスのモジュールとシンボル
257 .\"O Starting with kernel 2.4.10, modules should have a license string,
258 .\"O defined using MODULE_LICENSE(). Several strings are recognised as
259 .\"O being GPL compatible, any other license string or no license at all
260 .\"O means that the module is treated as proprietary. See
261 .\"O include/linux/module.h for a list of GPL compatible license strings.
262 カーネル 2.4.10 からモジュールはライセンス文を含むことになり、
263 MODULE_LICENSE() によって定義されることになった。
264 いくつかの文字列は GPL 互換であると認識される。
265 それ以外のライセンス文字列だったり、そもそもライセンスがない場合は、
266 そのモジュールはプロプラエタリなものとして扱われる。
267 GPL 互換とされるライセンス文字列については
268 include/linux/module.h を参照すること。
270 .\"O If the kernel supports the
271 .\"O .I /proc/sys/kernel/tainted flag
274 .\"O will OR the tainted flag with '1' when loading a module without a GPL
275 .\"O license. A warning is issued if the kernel supports tainting and a
276 .\"O module is loaded without a license; a warning is always issued for
277 .\"O modules which have a MODULE_LICENSE() that is not GPL compatible, even
278 .\"O on older kernels that do not support tainting. This minimizes warnings
279 .\"O when a new modutils is used on older kernels.
281 .I /proc/sys/kernel/tainted flag
284 は GPL ライセンスを持たないモジュールのロード時に、
285 tainted (汚染) フラグを '1' と OR する。
286 カーネルが tainting をサポートしていると、
287 ライセンスのないモジュールがロードされる際には警告が発せられる。
288 警告は GPL 互換でない MODULE_LICENSE() を持つモジュールに対しては
289 (tainting をサポートしていない古いカーネルでも)、
291 これによって、新しいモジュールが古いカーネルで利用されるときも、
295 .\"O (force) mode will OR the tainted flag with '2' on kernels
296 .\"O that support tainting, it always issues a warning.
298 (強制) モードでは、tainting をサポートするカーネルなら
299 tainted フラグが '2' と OR され、常に警告が発せられる。
301 .\"O Some kernel developers require that symbols exported by their code must
302 .\"O only be used by modules with a GPL compatible license. These symbols
303 .\"O are exported by EXPORT_SYMBOL_GPL instead of the normal EXPORT_SYMBOL.
304 .\"O GPL only symbols exported by the kernel and by other modules are only
305 .\"O visible to modules with a GPL compatible license, these symbols appear
306 .\"O in /proc/ksyms with a prefix of 'GPLONLY_'.
308 .\"O ignores the GPLONLY_ prefix on symbols while loading a GPL licensed
309 .\"O module so the module just refers to the normal symbol name, without the
310 .\"O prefix. GPL only symbols are not made available to modules without a
311 .\"O GPL compatible license, this includes modules with no license at all.
312 カーネル開発者の中には、彼らのコードがエクスポートするシンボルは、
313 GPL 互換なライセンスのモジュールからしか利用できないようにしたい、
314 と考えている人たちがいる。これらのシンボルは
315 EXPOET_SYMBOL の代わりに EXPORT_SYMBOL_GPL でエクスポートされる。
316 カーネルや、別のモジュールによってエクスポートされた
317 GPL オンリーのシンボルは、GPL 互換なライセンスのモジュールからしか見えない。
319 /proc/ksyms において 'GPLONLY_' というプレフィックスが付く。
321 は GPL ライセンスのモジュールをロードするときは、
322 シンボルの 'GPLONLY_' プレフィックスを無視し、
325 GPL 互換なライセンスを持たないモジュールに対しては利用可能とならない。
326 ライセンスを全く持たないモジュールに対しても同様である。
327 .\"O .SS "KSYMOOPS ASSISTANCE"
329 .\"O To assist with debugging of kernel Oops when using modules, insmod
330 .\"O defaults to adding some symbols to ksyms, see the \fB-Y\fP option.
331 .\"O These symbols start with \fB__insmod_\fP\fImodulename\fP\fB_\fP. The
332 .\"O \fImodulename\fP is required to make the symbols unique, it is legal to
333 .\"O load the same object more than once under different module names.
334 .\"O Currently defined symbols are
335 モジュール利用時のカーネル Oops のデバッグを支援するため、
336 insmod はデフォルトではいくつかのシンボルを ksyms に追加する
340 .BI __insmod_ modulename _
343 はシンボルを他と重ならないようにするために必要である。
344 同じオブジェクトを、別のモジュール名で複数回ロードするのは許されている。
349 __insmod_\fImodulename\fP_O\fIobjectfile\fP_M\fImtime\fP_V\fIversion\fP
353 .\"O \fIobjectfile\fP is the name of the file that the object was loaded
354 .\"O from. This ensures that ksymoops can match the code to the correct
355 .\"O object. \fImtime\fP is the last modified timestamp on that file in
356 .\"O hex, zero if stat failed. \fIversion\fP is the kernel version that
357 .\"O the module was compiled for, -1 if no version is available. The
358 .\"O _O symbol has the same start address as the module header.
360 は、オブジェクトのロード元のファイルの名前である。
362 ksymoops がコードを正しいオブジェクトにマッチさせることが可能となる。
364 はそのファイルの最終修正タイムスタンプを 16 進で表したものである。
367 はモジュールのコンパイル時に指定されたカーネルのバージョンで、
368 バージョンが取得できなければ \-1 となる。
369 .\"NAKANO ちょっと意訳気味ですけれども。
370 シンボル _O はモジュールヘッダと同じスタートアドレスになる。
374 __insmod_\fImodulename\fP_S\fIsectionname\fP_L\fIlength\fP
378 .\"O This symbol appears at the start of selected ELF sections,
379 .\"O currently .text, .rodata, .data and .bss. It only appears if the
380 .\"O section has a non-zero size. \fIsectionname\fP is the name of the ELF
381 .\"O section, \fIlength\fP is the length of the section in decimal. These
382 .\"O symbols help ksymoops map addresses to sections when no symbols are
384 このシンボルは指定された ELF セクションの先頭に現れる。
385 現在は .text, .rodata, .data, .bss である。
386 これが現れるのは、セクションの長さが 0 以上の場合だけである。
390 は各セクションの長さの 10 進表記である。
391 これらのシンボルにより、 ksymoops はシンボルが使えない場合でも
392 アドレスをセクションにマップできるようになる。
396 __insmod_\fImodulename\fP_P\fIpersistent_filename\fP
400 .\"O Only created by insmod if the module has one or more parameters that
401 .\"O are marked as persistent data and a filename to save persistent data
404 .\"O above) is available.
405 モジュールが永続データとしてマークされたパラメータを持ち、
406 永続データを保存するファイル名が有効な場合 (上述の
408 参照) にのみ、insmod によって作成される。
410 .\"O The other problem with debugging kernel Oops in modules is that the
411 .\"O contents of /proc/ksyms and /proc/modules can change between the Oops
412 .\"O and when you process the log file. To help overcome this problem, if
413 .\"O directory /var/log/ksymoops exists then insmod and rmmod will
414 .\"O automatically copy /proc/ksyms and /proc/modules to /var/log/ksymoops
415 .\"O with a prefix of `date\ +%Y%m%d%H%M%S`.
416 .\"O The system administrator can tell ksymoops which snapshot files to use
417 .\"O when debugging an Oops. There is no switch to disable this automatic
418 .\"O copy, if you do not want it to occur, do not create /var/log/ksymoops.
419 .\"O If that directory exists, it should be owned by root and be mode 644 or
420 .\"O 600 and you should run this script every day or so. The script below
421 .\"O is installed as insmod_ksymoops_clean.
422 モジュールにおけるカーネル Oops のデバッグにおける別の問題として、
423 /proc/ksyms と /proc/modules の内容が Oops とログファイル処理の間で
426 /var/log/ksymoops があると、insmod と rmmod は自動的に
427 /proc/ksyms と /proc/modules を /var/log/ksymoops
428 に `date\ +%Y%m%d%H%M%S` の prefix を付けてコピーする。
429 システム管理者は ksymoops に対して、
430 Oops のデバッグ時にどのスナップショットファイルを利用するか伝えることができる。
431 この自動コピーを無効にするスイッチは存在しない。
432 これを望まない場合は、 /var/log/ksymoops を作ってはならない。
433 このディレクトリを置くときには、所有者は root とし、
434 モードは 644 または 600 にして、
435 以下のスクリプトを一日一回程度実行すると良い。
436 このスクリプトは insmod_ksymoops_clean としてインストールされる。
441 # Delete saved ksyms and modules not accessed in 2 days
442 if [ -d /var/log/ksymoops ]
445 # Make sure there is always at least one version
446 d=`date +%Y%m%d%H%M%S`
447 cp -a /proc/ksyms /var/log/ksymoops/${d}.ksyms
448 cp -a /proc/modules /var/log/ksymoops/${d}.modules
449 find /var/log/ksymoops -type f -atime +2 -exec rm {} \\;
454 \fBrmmod\fP(8), \fBmodprobe\fP(8), \fBdepmod\fP(8), \fBlsmod\fP(8),
455 \fBksyms\fP(8), \fBmodules\fP(2), \fBgenksyms\fP(8), \fBkerneld\fP(8),
456 \fBksymoops\fP(kernel).
459 .\"O Module support was first conceived by Anonymous
460 モジュール対応を誰が最初に考えたのかは不明である。
462 .\"O Initial Linux version by Bas Laarhoven <bas@vimec.nl>
463 Linux 用の最初のバージョンは Bas Laarhoven <bas@vimec.nl> が作成した。
465 .\"O Version 0.99.14 by Jon Tombs <jon@gtex02.us.es>
466 バージョン 0.99.14 は Jon Tombs <jon@gtex02.us.es> が作成した。
468 .\"O Extended by Bjorn Ekwall <bj0rn@blox.se>
469 Bjorn Ekwall <bj0rn@blox.se> が拡張を行った。
471 .\"O Original ELF help from Eric Youngdale <eric@aib.com>
472 元々の ELF 対応は Eric Youngdale <eric@aib.com> の助力によるものである。
474 .\"O Rewritten for 2.1.17 by Richard Henderson <rth@tamu.edu>
475 バージョン 2.1.17 への更新は Richard Henderson <rth@tamu.edu> が行った。
477 .\"O Extended by Bjorn Ekwall <bj0rn@blox.se> for modutils-2.2.*, March 1999
478 modutil-2.2.* での拡張は 1999 年 3 月に Bjorn Ekwall <bj0rn@blox.se> が行った。
480 .\"O Assistance for ksymoops by Keith Owens <kaos@ocs.com.au>, May 1999
481 ksymoops の補助は 1999 年 5 月に Keith Owens <kaos@ocs.com.au> が行った。
483 .\"O Maintainer: Keith Owens <kaos@ocs.com.au>.
484 メンテナ: Keith Owens <kaos@ocs.com.au>.