udev com argumento KERNELS não funciona

0

Estou usando um dispositivo USB < - > Caixa serial e gostaria de ter um symlink personalizado para as portas seriais.

Com base na saída de udevadm , sei que cada porta tem um valor diferente de KERNELS:

KERNELS=="1-3:1.0" (this is labeled as port 1 on the box)
KERNELS=="1-3:1.1" (port 2)
KERNELS=="1-3:1.2" (port 3)
KERNELS=="1-3:1.3" (port 4)

Eu tentei a seguinte regra:

ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", KERNELS=="1-3:1.3", SYMLINK+="my_port"

que não funcionou. Se, no entanto, eu usar KERNELS=="1-3" em vez de KERNELS=="1-3:1.3" , o link simbólico será criado.

Como posso reescrever a regra para diferenciar entre as várias portas seriais?

 $ udevadm info --path=/sys/bus/usb-serial/devices/ttyUSB19 --attribute-walk

  looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.3/ttyUSB19':
    KERNEL=="ttyUSB19"
    SUBSYSTEM=="usb-serial"
    DRIVER=="ftdi_sio"
    ATTR{latency_timer}=="16"
    ATTR{port_number}=="0"

  looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.3':
    KERNELS=="1-3:1.3"
    SUBSYSTEMS=="usb"
    DRIVERS=="ftdi_sio"
    ATTRS{authorized}=="1"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceClass}=="ff"
    ATTRS{bInterfaceNumber}=="03"
    ATTRS{bInterfaceProtocol}=="ff"
    ATTRS{bInterfaceSubClass}=="ff"
    ATTRS{bNumEndpoints}=="02"
    ATTRS{interface}=="USB <-> Serial Cable"
    ATTRS{supports_autosuspend}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-3':
    KERNELS=="1-3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="100mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 4"
    ATTRS{bcdDevice}=="0800"
    ATTRS{bmAttributes}=="80"
    ATTRS{busnum}=="1"
    ATTRS{configuration}==""
    ATTRS{devnum}=="65"
    ATTRS{devpath}=="3"
    ATTRS{idProduct}=="6011"
    ATTRS{idVendor}=="0403"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="FTDI"
    [...]
    
por Sparkler 05.06.2018 / 23:40

0 respostas