根据udev的信息判断设备物理路径

udev会生成by-path路径,根据这个就可以判断

[toybrick@localhost dev]$ find | grep platform-fe3c0000
./disk/by-path/platform-fe3c0000.usb-usb-0:1.2:1.0-scsi-0:0:0:0-part1
./disk/by-path/platform-fe3c0000.usb-usb-0:1.2:1.0-scsi-0:0:0:0
./input/by-path/platform-fe3c0000.usb-usb-0:1.1:1.0-event-mouse
./input/by-path/platform-fe3c0000.usb-usb-0:1.3:1.0-event-kbd
[toybrick@localhost dev]$ find | grep platform-fe380000
./serial/by-path/platform-fe380000.usb-usb-0:1.3:1.0-port0
./serial/by-path/platform-fe380000.usb-usb-0:1.2:1.0-port0
./serial/by-path/platform-fe380000.usb-usb-0:1.1:1.0-port0

猜你喜欢

转载自www.cnblogs.com/cute/p/11325250.html