Re: Using %s{product} and %s{bInterfaceNumber} in UDEV rules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 8 Nov 2011, Uwe Bonnes wrote:

> Hello,
> 
> in a quest to get static name for our devices, I started with following
> rule:
> 
> SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{manufacturer}=="IKDA", \
>                    SYMLINK="%s{product}_%s{serial}"
> 
> This produces links like
> lrwxrwxrwx  1 root root           7  8. Nov 17:07 FTDIJTAG_0002 -> ttyUSB1
> 
> However when the connected device has more interfaces, this doesn't work
> out for interfaces other then the last.
> 
> I tried
> SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{manufacturer}=="IKDA", \
>                    SYMLINK="%s{product}_%s{serial}_%s{bInterfaceNumver}"
> 
> but that only produces a link like:
> lrwxrwxrwx  1 root root           7  8. Nov 17:09 FTDIJTAG_0002_
> 
> Digging deeper with
> udevadm info -a  -p `udevadm info -q path -n /dev/ttyUSB2`
> 
> I find ATTRS{bInterfaceNumber}=="01" on the second level of parents
> while ATTRS{manufacturer}=="IKDA" is on the third level. The Udevadm info
> says:
> > A rule to match, can be composed by the attributes of the device
> > and the attributes from one single parent device.
> 
> So this probably breaks the "one single parent device" rule.
> 
> Is my wish flawed? Udev? Any way to get around?

This would be better off posted to a udev-oriented mailing list, such 
as linux-hotplug.

I don't know much about udev.  Can you get away with using 
"%s{../product}_%s{../serial}_%s{bInterfaceNumber}"?  That would 
satisfy the single-parent-device rule.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux