1

I have the following device that udevadm lists as:

looking at device '/devices/pci0000:00/0000:00:1c.7/0000:09:00.0/usb6/6-2/6-2:1.0/ttyUSB0/tty/ttyUSB0': KERNEL=="ttyUSB0" SUBSYSTEM=="tty" DRIVER==""

looking at parent device '/devices/pci0000:00/0000:00:1c.7/0000:09:00.0/usb6/6-2/6-2:1.0/ttyUSB0': KERNELS=="ttyUSB0" SUBSYSTEMS=="usb-serial" DRIVERS=="pl2303" ATTRS{port_number}=="0"

looking at parent device '/devices/pci0000:00/0000:00:1c.7/0000:09:00.0/usb6/6-2/6-2:1.0': KERNELS=="6-2:1.0" SUBSYSTEMS=="usb" DRIVERS=="pl2303" ATTRS{bInterfaceNumber}=="00" ATTRS{bAlternateSetting}==" 0" ATTRS{bNumEndpoints}=="03" ATTRS{bInterfaceClass}=="ff" ATTRS{bInterfaceSubClass}=="00" ATTRS{bInterfaceProtocol}=="00" ATTRS{supports_autosuspend}=="1"

So I created the rule:

KERNEL=="ttyUSB0", SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="pl2303", KERNELS=="6-2:1.0", SYMLINK+="cc128serial"

this doesn't work.

However if I do:

KERNEL=="ttyUSB0", SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="pl2303", SYMLINK+="cc128serial"

then it works. I tried with KERNELS=="6*" etc.. to no available

any ideas ?

thanks

2

2 Answers 2

5

This article on writing udev scripts (look for "invalid") indicates that the rule you would like to use is invalid because you try to match against attributes from two different parent levels: SUBSYSTEMS=="usb-serial" (parent), and KERNELS=="6-2:1.0" (grandparent).

...while it is legal to combine the attributes from the device in question and a single parent device, you cannot mix-and-match attributes from multiple parent devices - your rule will not work.

0

The parent device has KERNELS=="ttyUSB0" which I bet takes precedence over the parent's parent device KERNELS=="6-2:1.0".

Any reason not to use the rule that works?

2
  • My understanding is that it should look for all combination going up. I should add that this rule was working perfectly fine with linux 2.6 (ubuntu 10.04). Rules stopped working when I upgraded to ubuntu 12.04 (kernel 3.2). The reason I can't use the rule that "works" is because I have 3 identical USB device, and I can only distinguish them via the USB port they are plugged to
    – jyavenard
    Commented May 12, 2012 at 2:04
  • Let me suggest noting that you have 3 identical devices and must identify based on port in the original question. That will help people understand what the underlying issue is.
    – jrennie
    Commented May 12, 2012 at 13:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .