udev rule with few parent device attributes

后端 未结 2 518
逝去的感伤
逝去的感伤 2021-02-10 00:07

I need complex and universal udev rule to determine USB-device plugged in certain port of the any USB hub. so, i have to combine parent attributes of different laye

2条回答
  •  说谎
    说谎 (楼主)
    2021-02-10 00:30

    worked percect for me on my openhabian-system. I have two identical usb/modbus-adapters and now I can give them different symlinks: added these lines in my /etc/udev/rules.d/99-com.rules:

    KERNEL=="ttyUSB[0-9]*", SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", ENV{USB_HUB_TYPE}="1a86:7523"
    #
    ENV{USB_HUB_TYPE}=="1a86:7523", KERNEL=="ttyUSB[0-9]*",SUBSYSTEM=="tty", KERNELS=="1-1.3:1.0", SYMLINK+="tty4800"
    ENV{USB_HUB_TYPE}=="1a86:7523", KERNEL=="ttyUSB[0-9]*",SUBSYSTEM=="tty", KERNELS=="1-1.2:1.0", SYMLINK+="tty9600"
    

提交回复
热议问题