Re: Use GROUP= in a rule matching an interface of the device?

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

 



2010/9/9 Kay Sievers <kay.sievers@xxxxxxxx>:
> On Thu, Sep 9, 2010 at 11:21, Ludovic Rousseau
> <ludovic.rousseau@xxxxxxxxx> wrote:
>> I am trying to write a udev configuration file to change the group
>> ownership of the device if the device contains a CCID interface
>> (bInterfaceClass = 11 or 0x0B).
>>
>> I would like to use something like:
>> ATTR{bInterfaceClass}=="0b", GROUP="pcscd"
>> but that does not work.
>
> That not possible. Udev can only match on properties of the device
> ATTR or a parent device ATTRS.
>
> The device node you want to set the group to is the usb_device, but
> the match you want to do is on the usb_interface. At the moment the
> usb_device event is handled, the usb_interface does not exist, so this
> can never match. And from the usb_interface, which is a children and
> comes after the usb_device, you can not change the parent device node.
>
> Udev parses the usb descriptors and makes them available in a
> property. That's the only way to access usb_interface properties from
> the usb_device event.
>
> Something like:
>  SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}="*:0b0000:*", GROUP= ...
> should do it.

Yes, it does work.

But I find the rule more obscure.

Since performance is not a critical point for me I think I will stay with:
ATTRS{bInterfaceClass}=="0b", RUN+="/bin/chgrp pcscd $root/$parent"

Thanks

-- 
 Dr. Ludovic Rousseau
--
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