No problem. Attached is an outline for the same process using udev.

- Peter


On 11/30/06, Paul Alfille <[EMAIL PROTECTED]> wrote:
See: http://www.owfs.org/index.php?page=hotplug

 Can I suggest a separate page for udev -- it would be less overwhelming.

 Paul Alfille


On 11/30/06, Peter Kropf <[EMAIL PROTECTED]> wrote:
> Hold off a bit on putting it on the web site. I'm updating it with
> instructions on also using udev. Hopefully this'll cover more users...
>
> - Peter
>
>
> On 11/30/06, Paul Alfille < [EMAIL PROTECTED]> wrote:
> > Very nicely summarized.
> >
> >  I'll add it to the web wite. Is hotplug for 2.6 kernels as well as 2.4?
> >
> >  Paul Alfille
> >
> > On 11/30/06, Jan Kandziora < [EMAIL PROTECTED]> wrote:
> > > Am Donnerstag, 30. November 2006 20:03 schrieb Peter Kropf:
> > > > I've written up a preliminary guide to extending the hotplug
subsystem
> > > > to automatically change the file owner and permissions on 1-Wire
> > > > controller.
> > > >
> > > >
> > > > Comments? Thought?
> > > >
> > > Shouldn't / Couldn't the same thing be achieved by adding some udev
rules?
> > >
> > > Kind regards
> > >
> > >         Jan
> > > --
> > > "...Deep Hack Mode -- that mysterious and frightening state of
> > > consciousness where mortal users fear to tread.
> > >                 -- Matt Welsh
> > >
> > >
> >
-------------------------------------------------------------------------
> > > Take Surveys. Earn Cash. Influence the Future of IT
> > > Join SourceForge.net's Techsay panel and you'll get the chance to
share
> > your
> > > opinions on IT & business topics through brief surveys - and earn cash
> > >
> >
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > > _______________________________________________
> > > Owfs-developers mailing list
> > > [email protected]
> > >
> >
https://lists.sourceforge.net/lists/listinfo/owfs-developers
> > >
> >
> >
> >
-------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share
your
> > opinions on IT & business topics through brief surveys - and earn cash
> >
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> >
> > _______________________________________________
> > Owfs-developers mailing list
> > [email protected]
> >
https://lists.sourceforge.net/lists/listinfo/owfs-developers
> >
> >
> >
>
>
-------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
your
> opinions on IT & business topics through brief surveys - and earn cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Owfs-developers mailing list
> [email protected]
>
https://lists.sourceforge.net/lists/listinfo/owfs-developers
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers



Overview
========

There are times when access to the 1-Wire USB controller has to be
modified to allow a user other than root to have write access. This
article presents a simple way to use the Linux udev subsystem to
change the file ownership and permissions on the file associated with
a 1-Wire controller.


Udev Subsystem
--------------

The notes presented here are specific to the Linux udev subsystem and
it must be installed for it to work. Several leading-edge Linux
distributions have udev installed as part of the base system including
FedoraCore 6 and Suse 10.

If it's not installed on your system, see the documentation for that
version Linux for more details on how to install the udev subsystem.


USB Vendor and Product IDs
--------------------------

The USB vendor and product ids can be used by the udev subsystem to
identify which program is to be run when the device is plugged in.

If you don't know the vendor and product ids for the 1-Wire USB
controller you'll be using, you can use the lsusb program to find
them. If lsusb isn't installed (typically in /usr/sbin or /sbin)
you'll need to install the appropiate package for your Linux
distribution. 

Once installed, run lsusb with the 1-Wire USB controlled plugged in:

    $ /sbin/lsusb
    Bus 001 Device 005: ID 04fa:2490 Dallas Semiconductor DS1490F 2-in-1 Fob, 
1-Wire adapter
    Bus 001 Device 001: ID 0000:0000  
    $

The 04fa is the vendor id and 2490 is the product id.

Unplug the 1-Wire USB controller.


Customize udev
--------------

With the vendor and product ids in hand, the udev subsystem can be
modified to change the file permissions and file ownership.

Create a new file called /etc/udev/rules.d/46_ds2490.rules. This will
contain the mapping of vendor / product id and the program to run. The
file should contain the following:


BUS=="usb", SYSFS{idVendor}=="04fa", SYSFS{idProduct}=="2490",
GROUP="users", MODE="0774", \
        PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i 
$${K%%%%.*} $${K#*.}'", \
        NAME="%c", RUN="/bin/sh -c 'chgrp ow /proc/%c && chmod g+rw /proc/%c && 
logger ow udev: group set to ow and permission g+rw on /proc/%c'"


Change the 0x04fa to the vendor id and 0x2490 to the product id for
your 1-Wire USB controller.

Don't forget to add a group called ow and add users to the group.

Once this is setup, you can plug the 1-Wire USB controller into the
computer. After a bit, you should see a message in the system log file
that looks like:

    Nov 30 14:29:52 localhost logger: ow udev: group set to ow and permission 
g+rw on /proc/bus/usb/001/006

and that can be verified by

    $ ls -l /proc/bus/usb/001/006
    -rw-rw-r-- 1 root ow 147 Nov 30 14:29 /proc/bus/usb/001/006
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to