MODPROBE.CONF(5) MODPROBE.CONF(5) 名前 modprobe.conf, modprobe.d - modprobe の設定ファイル・ディレクトリ 説明 modprobe コマンドはモジュールの依存関係に応じて複数のモジュールを追加し たり削除したりできるため、これらのモジュールにどのオプションを使うか を 指 定 す る 手 段 が 必 要である。 /etc/modprobe.conf (または /etc/mod- probe.conf が存在しない場合、 /etc/modprobe.d ディレクトリ以下のすべ て の ファイル) は必要に応じてこれらのオプションを指定する。また、便利なよ うにエイリアス (モジュールの別名) を作成するためにも用いられる。最後 に 、 ( 複数のモジュールを登録するなどの) 特別な要求に応えるために、 mod- probe の通常の振る舞いを完全に無効にして乗っ取ることができる。 モジュール名やエイリアス名には (他のモジュール名と同様に) - や _ を含め る ことができる。ここで、 - と _ はすべてのモジュールコマンドにおいて、 互いに入れ替え可能である (区別されない) ことに注意。 modprobe.conf や modprobe.d 以下のファイルの形式は単純である。 1 行に 1 コマンドで、空行と # で始まる行は無視される (コメントを追加するのに使え る) 。行末の \ は次の行に続くことを意味し、これを使えばファイルが少し見 やすくなる。 書式は 2.4 以前のカーネルで使われていた modules.conf を簡単にしたもので ある。 コマンド alias wildcard modulename モジュ ー ル の 別 名 を 付 け る 。 例 え ば 、 "alias my-mod really_long_modulename" とすると、 "modprobe really_long_module- name" の代わりに "modprobe my-mod" を使うことができる。シェル 形 式 の ワ イ ル ド カ ー ド も 使 う こ とができ、 "alias my-mod* really_long_modulename" とすると "modprobe my-mod-something" も 同じ効果となる。他のエイリアスに対するエイリアスを設定することは できない (正しく動作しない) が、エイリアスにオプションを設定する ことができ、それらは他のオプションに追加される。モジュールはそれ 自身にエイリアスを持つことができる点に注意。それらは modinfo で 見ることができる。これらのエイリアスは最後の望みとして使われる ( つまり、その名前の実モジュールもなく、設定ファイル中にその名前の install, remove, alias コマンドが存在しない場合に使われる) 。 options modulename option... こ のコマンドでモジュール modulename (エイリアスも可) にオプショ ンを追加することができる。ここで設定されたオプションはカーネルに 登録される際に毎回使われ、 (modprobe modulename で) 直接登録され る場合にもそのモジュールに依存するモジュールと一緒に登録される場 合にも使われる。 モジュール自身に対する option 、エイリアスに対する option 、コマ ンドラインのオプションは、全てのオプションがいっしょに渡される。 install modulename command... modprobe.conf の中でもっとも強力なコマンドである。 modprobe は、 通常はカーネルにモジュールを登録するが、 install コマンドを記 述 すると、代わりにここで指定された command を実行する。 command は どんなシェルコマンドでもよい。そのため、どんな複雑な処理でも思い どおりに指定できる。例えば、モジュール "fred" が、 "barney" がイ ンストールされている状態のほうがうまく動作する (が依存関係にない の で modprobe が 自 動的にロードしない) 場合、 "install fred /sbin/modprobe barney; /sbin/modprobe --ignore-install fred" と 書けば、望みどおりのことをさせることができる。ここで、 --ignore- install は 2 番目の modprobe が同じ install コマンドを再び実行し ないようにするためのものである。 remove も参照。 install を使って、実際には存在しないモジュールを作ることもできる 。例え ば 、 "install probe-ethernet /sbin/modprobe e100 || /sbin/modprobe eepro100" と書けば、 "modprobe probe-ethernet" と したときに、まず e100 ドライバを試し、次に eepro100 を試す。 コマンドの中で "$CMDLINE_OPTS" という文字列を使うと 、 modprobe のコマンドラインで指定したオプションに置き換えられる。これを使う と、設定ファイルに install コマンドが存在していても、ユ ー ザ は "modprobe fred opt=1" というコマンドラインでモジュールに "opt=1" というオプションを渡すことができ、便利である。つまり、上の例では 設 定 ファイルに "install fred /sbin/modprobe barney; /sbin/mod- probe --ignore-install fred $CMDLINE_OPTS" のように書けばよい。 remove modulename command... 上の install コマンドと同様であるが、 "modprobe -r" が呼び出され た ときに実行される。上の 2 つの例を削除にあてはめると、 "remove fred /sbin/modprobe -r --ignore-remove fred && /sbin/modprobe -r barney" および "remove probe-ethernet /sbin/modprobe -r eepro100 || /sbin/modprobe -r e100" のようになる。 include filename このコマンドを使うと、他の設定ファイルまたはディレクトリ全体を読 み込むことができ、これが便利なこともある。読み込まれたファイル中 のエイリアスは現在のファイルで定義されたエイリアスを上書きするこ とに注意。 blacklist modulename モジュールはそれ自身にエイリアスを持つことができる。通常、これら は "pci:123..." といったように、サポートするデバイスを表すエイリ ア スである。これらの「内部」エイリアスは通常の "alias" キーワー ドで上書きすることができる。しかし、 2 つ以上のモジュールが同 じ デバイスをサポートする場合や、モジュールがサポートしないデバイス をサポートするとしている場合もある。このような場合 、 blacklist キーワードを使って、あるモジュールのすべての内部エイリアスを無視 させることができる。 下位互換性 現在の (2.4 または 2.2 の) モジュール設定から modprobe.conf を生成し て くれる generate_modprobe.conf というプログラムがある。 書式は以前の /etc/modules.conf と似ているが、多くの機能が削除されている 。これには 2 つの理由がある: まず、 install および remove コマンドで ほ とんど何でもできる。二つ目に、 module-init-tools の modprobe は他のツー ルで簡単に置き換えることができるよう、十分単純になるように設計されて い る。 実 際 の モ ジ ュールの登録の複雑さが 3 つのシステムコール (open, read, init_module) で軽減され、 modules.dep ファイルが単純でオープンである お か げで、もし必要があればもっと強力な改良版の modprobe を作ることも可能 である。 著作権 このマニュアルページの著作権表示は Copyright 2004, Rusty Russell, IBM Corporation. 関連項目 modprobe(8), modules.dep(5) 1 June 2005 MODPROBE.CONF(5)
MODPROBE.CONF(5) MODPROBE.CONF(5) NAME modprobe.d, modprobe.conf - Configuration directory/file for modprobe DESCRIPTION Because the modprobe command can add or remove more than one module, due to module dependencies, we need a method of specifying what options are to be used with those modules. All files underneath the /etc/mod- probe.d directory which end with the .conf extension specify those options as required. (the /etc/modprobe.conf file can also be used if it exists, but that will be removed in a future version). They can also be used to create convenient aliases: alternate names for a module, or they can override the normal modprobe behavior altogether for those with special requirements (such as inserting more than one module). Note that module and alias names (like other module names) can have - or _ in them: both are interchangable throughout all the module com- mands. The format of and files under modprobe.d and /etc/modprobe.conf is sim- ple: one command per line, with blank lines and lines starting with ’#’ ignored (useful for adding comments). A ’\’ at the end of a line causes it to continue on the next line, which makes the file a bit neater. COMMANDS alias wildcard modulename This allows you to give alternate names for a module. For exam- ple: "alias my-mod really_long_modulename" means you can use "modprobe my-mod" instead of "modprobe really_long_modulename". You can also use shell-style wildcards, so "alias my-mod* really_long_modulename" means that "modprobe my-mod-something" has the same effect. You can’t have aliases to other aliases (that way lies madness), but aliases can have options, which will be added to any other options. Note that modules can also contain their own aliases, which you can see using modinfo. These aliases are used as a last resort (ie. if there is no real module, install, remove, or alias com- mand in the configuration). options modulename option... This command allows you to add options to the module modulename (which might be an alias) every time it is inserted into the kernel: whether directly (using modprobe modulename or because the module being inserted depends on this module. All options are added together: they can come from an option for the module itself, for an alias, and on the command line. install modulename command... This is the most powerful primitive: it tells modprobe to run your command instead of inserting the module in the kernel as normal. The command can be any shell command: this allows you to do any kind of complex processing you might wish. For example, if the module "fred" works better with the module "barney" already installed (but it doesn’t depend on it, so modprobe won’t automatically load it), you could say "install fred /sbin/modprobe barney; /sbin/modprobe --ignore-install fred", which would do what you wanted. Note the --ignore-install, which stops the second modprobe from running the same install command again. See also remove below. You can also use install to make up modules which don’t otherwise exist. For example: "install probe-ethernet /sbin/mod- probe e100 || /sbin/modprobe eepro100", which will first try to load the e100 driver, and if it fails, then the eepro100 driver when you do "modprobe probe-ethernet". If you use the string "$CMDLINE_OPTS" in the command, it will be replaced by any options specified on the modprobe command line. This can be useful because users expect "modprobe fred opt=1" to pass the "opt=1" arg to the module, even if there’s an install command in the configuration file. So our above example becomes "install fred /sbin/modprobe barney; /sbin/modprobe --ignore- install fred $CMDLINE_OPTS" remove modulename command... This is similar to the install command above, except it is invoked when "modprobe -r" is run. The removal counterparts to the two examples above would be: "remove fred /sbin/modprobe -r --ignore-remove fred && /sbin/modprobe -r barney", and "remove probe-ethernet /sbin/modprobe -r eepro100 || /sbin/modprobe -r e100". blacklist modulename Modules can contain their own aliases: usually these are aliases describing the devices they support, such as "pci:123...". These "internal" aliases can be overridden by normal "alias" keywords, but there are cases where two or more modules both support the same devices, or a module invalidly claims to support a device: the blacklist keyword indicates that all of that particular mod- ule’s internal aliases are to be ignored. COPYRIGHT This manual page Copyright 2004, Rusty Russell, IBM Corporation. SEE ALSO modprobe(8), modules.dep(5) 2005-06-01 MODPROBE.CONF(5)
コロナウイルスの日ごとの感染者数・死者数をグラフ化してみました。どの国が増加傾向にあり、どの国が終息に向かっているかを視覚化しています。
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa