udevadm은 상위 장치를 추적하지 않습니다.

udevadm은 상위 장치를 추적하지 않습니다.

imx536을 사용하는 맞춤형 보드가 있습니다. 보드에는 2개의 USB 장치가 있습니다. 하나는 OTG 코어에 연결되고 다른 하나는 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"

감사해요.

편집: 약간의 추측 끝에 두 USB 장치를 성공적으로 식별하는 다음 규칙 파일을 작성했지만 장치 노드를 생성할 때 파일은 블록 파일이 아닌 문자 파일입니다. 따라서 "마운트"는 장치를 사용할 수 없습니다. 이것에 대한 생각이 있나요? 블록 장치 대신 컨트롤러를 찾을 수 있습니까?

관련 정보