Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ?


share|improve this question
Did either of the answers solve your problem? – jrennie May 22 '12 at 13:43
up vote 4 down vote accepted

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.

share|improve this answer

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?

share|improve this answer
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 May 12 '12 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 May 12 '12 at 13:06

You must log in to answer this question.

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