「Modalias」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(序文・1章を飜訳)
(→‎See also: 翻訳)
 
(同じ利用者による、間の6版が非表示)
12行目: 12行目:
 
}}
 
}}
   
== What is a modalias file? ==
+
== modalias ファイルとは何か? ==
   
  +
上述の通り、modalias ファイルは、特定のハードウェアがすでにカーネルに伝えている情報を単純に公開します。このファイルは、この情報を公開するための構造を単純に指定します。上記の例に戻りましょう:
As described above, a modalias file simply exposes the information that a given piece of hardware already tells the kernel. This file simply specifies a structure for exposing this information. Let us return to the example above:
 
   
 
{{hc|$ cat /sys/devices/pci0000:00/0000:00:1f.1/modalias|pci:v00008086d000024DBsv0000103Csd0000006Abc01sc01i8A}}
 
{{hc|$ cat /sys/devices/pci0000:00/0000:00:1f.1/modalias|pci:v00008086d000024DBsv0000103Csd0000006Abc01sc01i8A}}
   
Let us take it apart piece-by-piece. First, the file name, {{ic|/sys/devices/pci0000:00/0000:00:1f.1/modalias}}:
+
それを 1 つずつ分解してみましょう。まず、ファイル名、{{ic|/sys/devices/pci0000:00/0000:00:1f.1/modalias}}:
   
  +
* '''pci0000:00'''は最初の PCI バスの id です。ほとんどのマシンではこれが唯一の PCI バスになりますが、'''pci0000:01''' や '''pci0000:02''' に拡張する可能性があります - 具体的な数字は重要ではなく、おそらく PCI バスは 1 つしか持っていないと推測されます(''ヒント:''{{ic|ls /sys/devices/pci*}} で確認してみてください)
* '''pci0000:00''' is the id for the first PCI bus. For most machines this will be the only PCI bus you have, but it is possible this can extend to '''pci0000:01''' or '''pci0000:02''' - the exacts are unimportant, as it is a good guess that you only have one PCI bus (''HINT:'' try {{ic|ls /sys/devices/pci*}} to check)
 
  +
* '''0000:00:1f.1''' は PCI バス上の特定のデバイスのインデックスです。具体的には、これはバス 0000:00 上にあり、インデックス '''1f.1''' を持っています。
* '''0000:00:1f.1''' is the index of the given device on the PCI bus. Specifically, this is on bus 0000:00 and has index '''1f.1'''
 
  +
* これらの数値がどこから来たのか知りたいのでなければ、これらはすべて重要なことではありません。 完全を期すために、{{ic|lspci}} の出力をチェックすると、同じ情報が表示されます:
* All this is rather unimportant, unless you want to know where all these numbers come from. For completeness, if you check the output of {{ic|lspci}} you will see the same information:
 
   
 
{{hc|$ lspci|00:1f.1 IDE interface: Intel Corp.: Unknown device 24db (rev 02)}}
 
{{hc|$ lspci|00:1f.1 IDE interface: Intel Corp.: Unknown device 24db (rev 02)}}
   
  +
さて、デバイス 00:1f.1 のこの modalias ファイルの内容を覗いてみましょう:
Now, let us take a peek at the contents of this modalias file for device 00:1f.1:
 
   
 
pci:v00008086d000024DBsv0000103Csd0000006Abc01sc01i8A
 
pci:v00008086d000024DBsv0000103Csd0000006Abc01sc01i8A
   
  +
ほれ、この通り、PCI を見ることができます!それはわかるけど、その後の全ての意味不明な部分は何でしょうか?
Well, hey, I can see pci! I recognize that, but what's all this gibberish at the end?
 
  +
この意味不明な部分は実際には構造化されたデータです。繰り返しの文字/数字のパターンに気付くでしょう。これを分解して読みやすくします:
This gibberish is actually structured data. You will notice a repeating letter/number scheme. Let us split this apart to make it easier to read:
 
   
 
v 00008086
 
v 00008086
41行目: 41行目:
 
i 8A
 
i 8A
   
  +
これらの識別子と、対応する 16 進数は、特定のデバイスが公開する情報の一部を表します。始めに、'''v''' は ''ベンダー ID'' であり、'''d''' は ''デバイス ID'' です - これらは非常に標準的な数字です。事実、[[hwdetect]] のようなツールはこれら、そして他の sysfs ファイルを使用して、デバイスに関する情報を提供します。ベンダー ID やデバイス ID を基に特定のハードウェアの識別を調べるウェブサイトさえ見つけることができます、例えば、https://devicehunt.com/
Each of these identifiers, and corresponding hex numbers represent some of the info that a given device exposes. For starters, '''v''' is the ''vendor id'' and '''d''' is the ''device id'' - these are very standard numbers. In fact, tools like [[hwdetect]] uses these, and other sysfs files, to give information for a device. You can even find websites to look up specific hardware identification based on the vendor and device ids, for instance, https://devicehunt.com/
 
   
  +
これらの数字をここでも見ることができます:
We can also see these numbers here:
 
   
 
{{hc|$ lspci -n|00:1f.1 Class 0101: 8086:24db (rev 02)}}
 
{{hc|$ lspci -n|00:1f.1 Class 0101: 8086:24db (rev 02)}}
   
  +
上記に列挙した ''v'' と ''d'' トークンに 8086:24db が一致しているのが分かりますか?
See how the 8086:24db matches to the ''v'' and ''d'' tokens listed above?
 
   
  +
言及しておくべきは、'''sv''' と '''sd''' はベンダーとデバイスの "サブシステム" バージョンです。これらは大半の時間無視されます。主に、ハードウェア開発者が全体としてのデバイスを変えない内部の微妙な違いを区別するために使用されます。
For the record, '''sv''' and '''sd''' are "subsystem" versions of both vendor and device. A majority of the time these are ignored. They are mainly used by the hardware developers to distinguish slight differences in the inner workings which do not change the device as a whole.
 
   
'''bc''' (base class) and '''sc''' (sub class) are used to create the "Class" listed by {{ic|lspci}}, in order "bcsc". This is the device class, which is fairly generic. In this case, the "class" is looked up in the normal {{ic|lspci}} output. We can see that "Class 0101" maps to "IDE Interface" ({{ic|lspci}} also looks up the vendor and device id's - 8086 maps to "Intel Corp." and 24DB maps to 'Unknown Device', hehe)
+
'''bc'''(基本クラス)と '''sc'''(サブクラス)は、{{ic|lspci}} に表示される "クラス" を作成するために使用されます。順番に "bcsc" です。これはデバイスクラスで、かなり一般的です。この場合、"クラス" は通常の {{ic|lspci}} 出力で調べられます。"Class 0101" "IDE Interface" にマップされているのが見て取れます ({{ic|lspci}} はベンダーとデバイスの id も調べます - 8086 "Intel Corp." にマップされ、24DB 'Unknown Device' にマップされます、へへ)
   
  +
'''i''' は "プログラミングインターフェース" で、これはいくつかのデバイスクラスに対してのみ意味を持ちます。
'''i''' is the "Programming interface", which is only meaningful for a few devices classes.
 
   
  +
== この情報はどのように使われますか? ==
== How is this information used? ==
 
   
  +
さて、これでこの情報が何であるかを皆さんは理解しました。各デバイスが公開する一群の奇妙な数字です。それは大したことではないように思えますが、モジュールについて話すとき、この情報がどういう意味を持つのでしょうか?
Ok, now we all know what this information is. A bunch of obscure numbers that each device exposes. Big deal. How does this matter when talking about modules?
 
   
  +
人々が無視しがちなのは、{{ic|depmod}} が行うすべての作業です。{{ic|depmod}} を実行すると、{{ic|/lib/modules/uname -r}} 内にいくつかの "マップ" ファイルが生成されます。これらのファイルは、[[modprobe]] が行う必要がある特定の操作をどのように処理するかを指示します。今回のケースでは、それらのほとんどを無視することができます。重要なのは {{ic|modules.alias}} です。このファイルには、モジュールのエイリアス、つまり二次的な名前が含まれています。デモンストレーションとして、例えば、snd_intel8x0m のエイリアスを見てみましょう:
One thing which people tend to ignore, is all the work {{ic|depmod}} does. When you run {{ic|depmod}}, it builds a series of "map" files in {{ic|/lib/modules/`uname -r`}} which tell [[modprobe]] how to handle certain things it needs to do. In this case we can ignore most of them. The important one is {{ic|modules.alias}}. This file contains aliases, or secondary names for modules. Just for a demonstration, let us look at aliases for, say, snd_intel8x0m:
 
   
 
{{hc|$ grep snd_intel8x0m /lib/modules/$(uname -r)/modules.alias|
 
{{hc|$ grep snd_intel8x0m /lib/modules/$(uname -r)/modules.alias|
79行目: 79行目:
 
}}
 
}}
   
  +
ちょっと待って!これは前に出てきたベンダー/デバイス ID の情報ではないですか!
Hey, wait! I recognize that! That's the vendor/device id information from before!
 
   
  +
はい、その通りです。これは「alias <何か> <実際のモジュール>」という非常にシンプルなフォーマットです。実際、あなたが望むほとんど何でもエイリアスにすることができます。例えば、"alias boogabooga snd_intel8x0m" を追加すれば、安全に "modprobe boogabooga" を実行することができます。
Yes, it is. It is a rather simple format of "alias <something> <actual module>". In fact, you can alias just about anything you want. I can add "alias boogabooga snd_intel8x0m" and then safely "modprobe boogabooga".
 
   
  +
"" は何でもマッチすることを示しており、これはファイルシステムの globbing({{ic|ls somedir/}})に似ています。前述のとおり、ほとんどのエイリアスは、"*" がマッチングすることにより、sv、sd、bc、sc、および i を無視します。
The "*" indicates it will match anything, much like filesystem globbing ({{ic|ls somedir/*}}). As stated before, most aliases ignore sv, sd, bc, sc, and i by way of the "*" matching.
 
   
== Where does this modules.alias file come from? ==
+
== この modules.alias ファイルはどこから来るのですか? ==
   
  +
さて、今、あなたは「おや、[[hardware probe]] はデバイステーブルに基づいてものを調べるために使用されていたが、これはどう違うのだろう?」と思っているかもしれません。
Ok, now you may be thinking "Well, [[hardware probe]] used to look things up based on a device table, what makes this any different?"
 
   
  +
違いは、このルックアップテーブルが静的ではないことです。これは手動で維持されているわけではありません。実際、{{ic|depmod}} を実行するたびに、動的に構築されます。 "この情報はどこから来るのか?" とあなたが尋ねるなら、それは[[カーネルモジュール]]それ自体からきています。考えてみると、各特定のモジュールは、そのハードウェアのために特にコード化されているので、それがサポートするハードウェアを知っているべきです。つまり、 ''nvidia'' モジュールの開発者は、そのモジュールがNvidia(ベンダー)のグラフィックスカード(クラス)でのみ動作することを知っています。実際、モジュールはこの情報をエクスポートします。それは「ねえ、私はこれをサポートできるよ」と言っています。
The difference is that this lookup table is not static. It is not maintained by hand. In fact, it is built dynamically whenever you run {{ic|depmod}}. "Where does this information come from?", you ask? Why, from the [[kernel modules]] themselves. When you think about it, each specific module should know what hardware it supports, as it is coded specifically for that hardware. I mean, the ''nvidia'' module developers know that their module only work with Nvidia (vendor) Graphics Cards (class). In fact, the module actually exports this information. It says "Hey, I can support this:".
 
 
$ modinfo nvidia
 
$ modinfo nvidia
 
filename: /lib/modules/2.6.14-ARCH/kernel/drivers/video/nvidia.ko
 
filename: /lib/modules/2.6.14-ARCH/kernel/drivers/video/nvidia.ko
98行目: 98行目:
 
alias: pci:v000010DEd*sv*sd*bc03sc00i00*
 
alias: pci:v000010DEd*sv*sd*bc03sc00i00*
   
  +
リストされているエイリアスを見ると、特にベンダー "10DE"(Nvidia)と bc/sc 0300(おそらく「グラフィックスカード」を指している)を特定して検索していることがわかります。実際、'''snd_intel8x0m''' の modinfo を見てみます:
As you can see by the alias listed, it looks specifically for vendor "10DE" (Nvidia) and bc/sc 0300 (which is most likely 'graphics cards'). In fact, if you look at the modinfo for '''snd_intel8x0m''':
 
 
$ modinfo snd_intel8x0m
 
$ modinfo snd_intel8x0m
 
filename: /lib/modules/2.6.14-ARCH/kernel/sound/pci/snd-intel8x0m.ko
 
filename: /lib/modules/2.6.14-ARCH/kernel/sound/pci/snd-intel8x0m.ko
122行目: 122行目:
 
alias: pci:v000010DEd000000D9sv*sd*bc*sc*i*
 
alias: pci:v000010DEd000000D9sv*sd*bc*sc*i*
   
  +
それは、エイリアスファイルを 'grep' で検索して見つけたエイリアスと一致します。各モジュールによってエクスポートされるこれらのエイリアスは、{{ic|depmod}} によって収集され、動的に {{ic|modules.alias}} ファイルにマージされます。ルックアップテーブルを手動で変更することはありません、なぜならそれは即座に構築されるからです。各モジュールは、それがサポートするものを正確に知っているため、{{ic|depmod}} はその情報を使用してモジュールの読み込みを支援することができます。
It matches the aliases found by 'grep'ing the alias file. These aliases exported by each module, are gathered by {{ic|depmod}} and merged into the {{ic|modules.alias}} file dynamically. There is no hand-changing of a lookup table, as it is built on-the-fly. Each module knows exactly what it supports, and therefore {{ic|depmod}} can use that information to help load modules.
 
   
  +
== udev はどのように動作するの? ==
== How does udev work? ==
 
   
  +
[[udev]] は sysfs(最初に modalias を公開するファイルシステム)と密接に関連しています。実際、新しいデバイスが追加されたとき(または起動時に初めて udev が起動されたとき)に modalias に基づいてモジュールをロードするためには、驚くほどシンプルです:
[[udev]] is closely tied with sysfs (the filesystem which exposes the modalias in the firstplace). In fact, to load modules based on the modalias when a new device is added (or when udev is first started on boot), it is insanely simple:
 
   
 
DRIVER!="?*", ENV{MODALIAS}=="?*", RUN{builtin}="kmod load $env{MODALIAS}"
 
DRIVER!="?*", ENV{MODALIAS}=="?*", RUN{builtin}="kmod load $env{MODALIAS}"
   
  +
はい、それだけです。それは一行です。このシンプルな行は、デフォルトの udev ルールの一部であり、hotplug を置き換えます。驚くべきことではありませんか?
Yep, that's it. It is a one-liner. This simple line, which is part of the default udev rules replace hotplug. Amazing, is it not?
 
   
== See also ==
+
== 参照 ==
   
  +
この記事は、usb、dmi、acpi のサブタイプなど、他の modalias テンプレートを示しています。
This article shows others modalias templates, i.e. for usb, dmi and acpi subtypes
 
*[http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html Modalias strings - a practical way to map "stuff" to hardware] by Petter Reinholdtsen
+
* [http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html Modalias 文字列 - ハードウェアに "もの" をマッピングする実用的な方法] by Petter Reinholdtsen

2023年8月19日 (土) 19:12時点における最新版

この文書は、Linux カーネルとモジュールがハードウェアをどのように認識し理解し、それがどのように sysfs の 'modalias' に変換されるかの入門ガイドです。

modalias とは何か

Modalias は、ハードウェア情報を 'modalias' という名前のファイルにエクスポートする小さな sysfs のトリックです。このファイルは、通常のハードウェアが公開する情報のフォーマットされた形式を単純に含んでいます。

$ cat /sys/devices/pci0000:00/0000:00:1f.1/modalias
pci:v00008086d000024DBsv0000103Csd0000006Abc01sc01i8A

modalias ファイルとは何か?

上述の通り、modalias ファイルは、特定のハードウェアがすでにカーネルに伝えている情報を単純に公開します。このファイルは、この情報を公開するための構造を単純に指定します。上記の例に戻りましょう:

$ cat /sys/devices/pci0000:00/0000:00:1f.1/modalias
pci:v00008086d000024DBsv0000103Csd0000006Abc01sc01i8A

それを 1 つずつ分解してみましょう。まず、ファイル名、/sys/devices/pci0000:00/0000:00:1f.1/modalias:

  • pci0000:00は最初の PCI バスの id です。ほとんどのマシンではこれが唯一の PCI バスになりますが、pci0000:01pci0000:02 に拡張する可能性があります - 具体的な数字は重要ではなく、おそらく PCI バスは 1 つしか持っていないと推測されます(ヒント:ls /sys/devices/pci* で確認してみてください)
  • 0000:00:1f.1 は PCI バス上の特定のデバイスのインデックスです。具体的には、これはバス 0000:00 上にあり、インデックス 1f.1 を持っています。
  • これらの数値がどこから来たのか知りたいのでなければ、これらはすべて重要なことではありません。 完全を期すために、lspci の出力をチェックすると、同じ情報が表示されます:
$ lspci
00:1f.1 IDE interface: Intel Corp.: Unknown device 24db (rev 02)

さて、デバイス 00:1f.1 のこの modalias ファイルの内容を覗いてみましょう:

pci:v00008086d000024DBsv0000103Csd0000006Abc01sc01i8A

ほれ、この通り、PCI を見ることができます!それはわかるけど、その後の全ての意味不明な部分は何でしょうか? この意味不明な部分は実際には構造化されたデータです。繰り返しの文字/数字のパターンに気付くでしょう。これを分解して読みやすくします:

v  00008086
d  000024DB
sv 0000103C
sd 0000006A
bc 01
sc 01
i  8A

これらの識別子と、対応する 16 進数は、特定のデバイスが公開する情報の一部を表します。始めに、vベンダー ID であり、dデバイス ID です - これらは非常に標準的な数字です。事実、hwdetect のようなツールはこれら、そして他の sysfs ファイルを使用して、デバイスに関する情報を提供します。ベンダー ID やデバイス ID を基に特定のハードウェアの識別を調べるウェブサイトさえ見つけることができます、例えば、https://devicehunt.com/

これらの数字をここでも見ることができます:

$ lspci -n
00:1f.1 Class 0101: 8086:24db (rev 02)

上記に列挙した vd トークンに 8086:24db が一致しているのが分かりますか?

言及しておくべきは、svsd はベンダーとデバイスの "サブシステム" バージョンです。これらは大半の時間無視されます。主に、ハードウェア開発者が全体としてのデバイスを変えない内部の微妙な違いを区別するために使用されます。

bc(基本クラス)と sc(サブクラス)は、lspci に表示される "クラス" を作成するために使用されます。順番に "bcsc" です。これはデバイスクラスで、かなり一般的です。この場合、"クラス" は通常の lspci 出力で調べられます。"Class 0101" が "IDE Interface" にマップされているのが見て取れます (lspci はベンダーとデバイスの id も調べます - 8086 は "Intel Corp." にマップされ、24DB は 'Unknown Device' にマップされます、へへ)

i は "プログラミングインターフェース" で、これはいくつかのデバイスクラスに対してのみ意味を持ちます。

この情報はどのように使われますか?

さて、これでこの情報が何であるかを皆さんは理解しました。各デバイスが公開する一群の奇妙な数字です。それは大したことではないように思えますが、モジュールについて話すとき、この情報がどういう意味を持つのでしょうか?

人々が無視しがちなのは、depmod が行うすべての作業です。depmod を実行すると、/lib/modules/uname -r 内にいくつかの "マップ" ファイルが生成されます。これらのファイルは、modprobe が行う必要がある特定の操作をどのように処理するかを指示します。今回のケースでは、それらのほとんどを無視することができます。重要なのは modules.alias です。このファイルには、モジュールのエイリアス、つまり二次的な名前が含まれています。デモンストレーションとして、例えば、snd_intel8x0m のエイリアスを見てみましょう:

$ grep snd_intel8x0m /lib/modules/$(uname -r)/modules.alias
alias pci:v00008086d00002416sv*sd*bc*sc*i* snd_intel8x0m
alias pci:v00008086d00002426sv*sd*bc*sc*i* snd_intel8x0m
alias pci:v00008086d00002446sv*sd*bc*sc*i* snd_intel8x0m
alias pci:v00008086d00002486sv*sd*bc*sc*i* snd_intel8x0m
alias pci:v00008086d000024C6sv*sd*bc*sc*i* snd_intel8x0m
alias pci:v00008086d000024D6sv*sd*bc*sc*i* snd_intel8x0m
alias pci:v00008086d0000266Dsv*sd*bc*sc*i* snd_intel8x0m
alias pci:v00008086d000027DDsv*sd*bc*sc*i* snd_intel8x0m
alias pci:v00008086d00007196sv*sd*bc*sc*i* snd_intel8x0m
alias pci:v00001022d00007446sv*sd*bc*sc*i* snd_intel8x0m
alias pci:v00001039d00007013sv*sd*bc*sc*i* snd_intel8x0m
alias pci:v000010DEd000001C1sv*sd*bc*sc*i* snd_intel8x0m
alias pci:v000010DEd00000069sv*sd*bc*sc*i* snd_intel8x0m
alias pci:v000010DEd00000089sv*sd*bc*sc*i* snd_intel8x0m
alias pci:v000010DEd000000D9sv*sd*bc*sc*i* snd_intel8x0m

ちょっと待って!これは前に出てきたベンダー/デバイス ID の情報ではないですか!

はい、その通りです。これは「alias <何か> <実際のモジュール>」という非常にシンプルなフォーマットです。実際、あなたが望むほとんど何でもエイリアスにすることができます。例えば、"alias boogabooga snd_intel8x0m" を追加すれば、安全に "modprobe boogabooga" を実行することができます。

"" は何でもマッチすることを示しており、これはファイルシステムの globbing(ls somedir/)に似ています。前述のとおり、ほとんどのエイリアスは、"*" がマッチングすることにより、sv、sd、bc、sc、および i を無視します。

この modules.alias ファイルはどこから来るのですか?

さて、今、あなたは「おや、hardware probe はデバイステーブルに基づいてものを調べるために使用されていたが、これはどう違うのだろう?」と思っているかもしれません。

違いは、このルックアップテーブルが静的ではないことです。これは手動で維持されているわけではありません。実際、depmod を実行するたびに、動的に構築されます。 "この情報はどこから来るのか?" とあなたが尋ねるなら、それはカーネルモジュールそれ自体からきています。考えてみると、各特定のモジュールは、そのハードウェアのために特にコード化されているので、それがサポートするハードウェアを知っているべきです。つまり、 nvidia モジュールの開発者は、そのモジュールがNvidia(ベンダー)のグラフィックスカード(クラス)でのみ動作することを知っています。実際、モジュールはこの情報をエクスポートします。それは「ねえ、私はこれをサポートできるよ」と言っています。

$ modinfo nvidia
  filename:       /lib/modules/2.6.14-ARCH/kernel/drivers/video/nvidia.ko
  license:        NVIDIA
  alias:          char-major-195-*
  vermagic:       2.6.14-ARCH SMP preempt 686 gcc-4.1
  depends:        agpgart
  alias:          pci:v000010DEd*sv*sd*bc03sc00i00*

リストされているエイリアスを見ると、特にベンダー "10DE"(Nvidia)と bc/sc 0300(おそらく「グラフィックスカード」を指している)を特定して検索していることがわかります。実際、snd_intel8x0m の modinfo を見てみます:

$ modinfo snd_intel8x0m
  filename:       /lib/modules/2.6.14-ARCH/kernel/sound/pci/snd-intel8x0m.ko
  author:         Jaroslav Kysela <perex@suse.cz>
  description:    Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; SiS 7013; NVidia MCP/2/2S/3 modems
  license:        GPL
  vermagic:       2.6.14-ARCH SMP preempt 686 gcc-4.1
  depends:        snd-ac97-codec,snd-pcm,snd-page-alloc,snd
  alias:          pci:v00008086d00002416sv*sd*bc*sc*i*
  alias:          pci:v00008086d00002426sv*sd*bc*sc*i*
  alias:          pci:v00008086d00002446sv*sd*bc*sc*i*
  alias:          pci:v00008086d00002486sv*sd*bc*sc*i*
  alias:          pci:v00008086d000024C6sv*sd*bc*sc*i*
  alias:          pci:v00008086d000024D6sv*sd*bc*sc*i*
  alias:          pci:v00008086d0000266Dsv*sd*bc*sc*i*
  alias:          pci:v00008086d000027DDsv*sd*bc*sc*i*
  alias:          pci:v00008086d00007196sv*sd*bc*sc*i*
  alias:          pci:v00001022d00007446sv*sd*bc*sc*i*
  alias:          pci:v00001039d00007013sv*sd*bc*sc*i*
  alias:          pci:v000010DEd000001C1sv*sd*bc*sc*i*
  alias:          pci:v000010DEd00000069sv*sd*bc*sc*i*
  alias:          pci:v000010DEd00000089sv*sd*bc*sc*i*
  alias:          pci:v000010DEd000000D9sv*sd*bc*sc*i*

それは、エイリアスファイルを 'grep' で検索して見つけたエイリアスと一致します。各モジュールによってエクスポートされるこれらのエイリアスは、depmod によって収集され、動的に modules.alias ファイルにマージされます。ルックアップテーブルを手動で変更することはありません、なぜならそれは即座に構築されるからです。各モジュールは、それがサポートするものを正確に知っているため、depmod はその情報を使用してモジュールの読み込みを支援することができます。

udev はどのように動作するの?

udev は sysfs(最初に modalias を公開するファイルシステム)と密接に関連しています。実際、新しいデバイスが追加されたとき(または起動時に初めて udev が起動されたとき)に modalias に基づいてモジュールをロードするためには、驚くほどシンプルです:

DRIVER!="?*", ENV{MODALIAS}=="?*", RUN{builtin}="kmod load $env{MODALIAS}"

はい、それだけです。それは一行です。このシンプルな行は、デフォルトの udev ルールの一部であり、hotplug を置き換えます。驚くべきことではありませんか?

参照

この記事は、usb、dmi、acpi のサブタイプなど、他の modalias テンプレートを示しています。