Re: Udev rule $attr substitution

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

 



Hello Josua,

Josua Dietze [2010-12-21 21:25 +0100]:
> I found the man page (well, xml file) in the git tree and just added
> an ATTRS match to the top level USB device.
> 
> This worked:
> KERNEL=="ttyUSB*", ATTRS{bNumConfigurations}=="*", RUN+="myprog %p
> %s{idVendor} %s{idProduct}"

Right, you need to "select" the parent device of which you need the
id* attribute.

> But I might add that there is certainly some documentation lacking
> on this one, practially everything I found was outdated or
> inaccurate ...

This is indeed a common trap, so some time ago I tried to point this
out more clearly in the manpage:

      $attr{file}, %s{file}
           The value of a sysfs attribute found at the device, where all keys
           of the rule have matched. If the matching device does not have such
           an attribute, and a previous KERNELS, SUBSYSTEMS, DRIVERS, or ATTRS
           test selected a parent device, use the attribute from that parent
           device.

This tries to point out that this won't match attributes from any
parent device. Do you think this paragraph is unclear? If so, do you
have a suggestion how to improve it? Or did you not see it in the
first place?

Thank you,

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux