[pvrusb2] Re: Why sysfs only root-writeable?

Mike Isely isely at isely.net
Fri Sep 2 17:34:35 CDT 2005


On Fri, 2 Sep 2005, Bill Crowell wrote:

> Better than my last reply.

Good, because I still didn't like the idea in your last reply either.
It's still putting distribution specific info into a driver (even if only
at the point when it is compiled)...

>
> put in a modprobe.conf option for pvrusb2:
>
> option pvrusb2 group=video
>
> modprobe runs as root and this would allow setting without a
> compile-time option.

This still has one problem, but it's a good idea and we can do something
that will have a similar effect.  The one problem is that "group=video"
gets passed verbatim into the kernel driver and thus the driver would
still have the very difficult job of trying to translate "video" to
whatever gid your distro is using.  There's no way for modprobe itself to
translate since it can't know what the option is supposed to mean.

But we could still do something like this:

option pvrusb2 group=23

(where 23 is the gid for your video group)

This I have no problem with doing.  In fact I'll even create a user option
as well.  You'd still have to hand-translate the group (or user) name once
when setting up the file, but it keeps the distro specific knowledge out
of the kernel and only in a config file that's part of your installation.

There is precedent for this approach.  I just now realized that the
realtime kernel module implements exactly the same sort of solution for
getting a gid into the kernel.

I'm adding this to my to-do list right now.

  -Mike


-- 
                        |         Mike Isely          |     PGP fingerprint
     Spammers Die!!     |                             | 03 54 43 4D 75 E5 CC 92
                        |   isely @ pobox (dot) com   | 71 16 01 E2 B5 F5 C1 E8
                        |                             |


More information about the pvrusb2 mailing list