[pvrusb2] sysfs, usdev and udevinfo

xavier.gnata at free.fr xavier.gnata at free.fr
Mon Apr 21 17:01:25 CDT 2008


Selon Bjorn Danielsson <pvr-usb2 at dax.nu>:

> xavier.gnata at free.fr wrote:
> >[...]
> > The only pb is the /sys/.../pvrusb2/... owner is root. That is why I need
> udev
> > to change the permission.
>
> I just started playing with the sysfs interface, and I tried the following
> approach for changing the permissions. Each time a video device is added
> (any video device) udev runs the following script that adds group-write
> permissions to the entire /sys/class/pvrusb2 tree.
>
> #!/bin/sh
> GROUP=video
> CLASSDIR=/sys/class/pvrusb2
> if [ "$ACTION" = "add" -a -d $CLASSDIR ]; then
>     GLOB=$CLASSDIR/*/
>     chgrp -R $GROUP $GLOB
>     find $GLOB -perm -u+w -print | xargs chmod g+w
> fi
>
> Not very elegant since it doesn't care about which device was attached,
> but it works.
>
> --
> Bjorn Danielsson  <pvr-usb2 at dax.nu>

Hi,

Indeed it works and I'm using something quite similar but we should be able to
know which device is the pvrusrb2 related once.
I have tried to understand who the info should be provided reading the sources
of a simple usb drivers but I just failed because the strings I was looking for
were not present...

Mike, do you I a clever idea??

Xavier


More information about the pvrusb2 mailing list