[pvrusb2] sysfs, usdev and udevinfo
Mike Isely
isely at isely.net
Tue Apr 22 21:28:16 CDT 2008
On Mon, 21 Apr 2008, Bjorn Danielsson wrote:
> 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.
Actually I think it's entirely appropriate that all video
capture-related nodes like this be associated with the video group - so
I think it's perfectly fine. This is exactly what I was suggesting a
long while back. Thanks for figuring out the details!
-Mike
--
Mike Isely
isely @ pobox (dot) com
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
More information about the pvrusb2
mailing list