udevadm は親デバイスを追跡しません。

udevadm は親デバイスを追跡しません。

imx536を使用するカスタムボードがあります。ボードには2つのUSBデバイスがあります。 1 つは OTG コアに接続され、もう 1 つは ixm53 の Host1 コアに接続されます。 Linux BSP、カーネル2.6.35、およびudevバージョン167では、「udevadm info」を使用して、どのデバイスがどのハブ/ポートに接続されているかを判断できません。ブートプロセス中に、Linuxは最初に確認するデバイスによってデバイスを別々に列挙します。 USBチェーンをさらに追跡するためにudevadm情報を取得する方法は?私はそれを各USBデバイスがどのハブ/ポートに接続されているかを追跡することによってカスタマイズされたudevルールを作成できるTI am3352と比較しました。

imx53 カスタムボードの両方のデバイスで「udevadm info」を実行します。

# udevadm info -a -n /dev/sda1

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

looking at device '/block/sda/sda1':
KERNEL=="sda1"
SUBSYSTEM=="block"
DRIVER==""
ATTR{partition}=="1"
ATTR{start}=="2048"
ATTR{size}=="3909632"
ATTR{alignment_offset}=="0"
ATTR{discard_alignment}=="4293918720"
ATTR{stat}=="       6        0       42        7        1        0        8       64        0       71       71"
ATTR{inflight}=="       0        0"

looking at parent device '/block/sda':
KERNELS=="sda"
SUBSYSTEMS=="block"
DRIVERS==""
ATTRS{range}=="16"
ATTRS{ext_range}=="256"
ATTRS{removable}=="1"
ATTRS{ro}=="0"
ATTRS{size}=="3911680"
ATTRS{alignment_offset}=="0"
ATTRS{discard_alignment}=="0"
ATTRS{capability}=="51"
ATTRS{stat}=="       7        0       50       24        1        0        8       64        0       88       88"
ATTRS{inflight}=="       0        0"

# udevadm info -a -n /dev/sdb1

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

looking at device '/block/sdb/sdb1':
KERNEL=="sdb1"
SUBSYSTEM=="block"
DRIVER==""
ATTR{partition}=="1"
ATTR{start}=="20480"
ATTR{size}=="681984"
ATTR{alignment_offset}=="0"
ATTR{discard_alignment}=="4284481536"
ATTR{stat}=="       0        0        0        0        0        0        0        0        0        0        0"
ATTR{inflight}=="       0        0"

looking at parent device '/block/sdb':
KERNELS=="sdb"
SUBSYSTEMS=="block"
DRIVERS==""
ATTRS{range}=="16"
ATTRS{ext_range}=="256"
ATTRS{removable}=="1"
ATTRS{ro}=="0"
ATTRS{size}=="15523840"
ATTRS{alignment_offset}=="0"
ATTRS{discard_alignment}=="0"
ATTRS{capability}=="51"
ATTRS{stat}=="       1        0        8        2        0        0        0        0        0        2        2"
ATTRS{inflight}=="       0        0"

ありがとうございます。

編集:少し推測の終わりに2つのUSBデバイスを正常に識別する次のルールファイルを作成しましたが、デバイスノードを作成したときにファイルはブロックファイルではなく文字ファイルです。したがって、「マウント」はデバイスを使用できません。これについて考えていますか?ブロックデバイスの代わりにコントローラを見つけることができますか?

ベストアンサー1

おすすめ記事