Re: How do I allow automatic non root access to my non standard USB device ?

2009-01-16 Thread Linuxguy123
On Fri, 2009-01-16 at 09:39 -0500, Todd Denniston wrote:
> suggestion: find the udev|hal rules for allowing the console logged in
> user to 
> use the sound card, and mimic them for your device.

I agree with the approach, although reading an article that outlined how
it works these days in F10 would be better. 

Where would I start looking for how a comparable USB device is handled ?
I looked in /etc/udev/rules.d, but I don't see any specific handlers for
devices and the hal-rules.d file has this:

# pass all events to the HAL daemon
RUN+="socket:/org/freedesktop/hal/udev_event"

Have things changed ?

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: hal rules (was: How do I allow automatic non root access to my non standard USB device ?)

2009-01-16 Thread Linuxguy123
On Fri, 2009-01-16 at 09:59 -0500, Tom Horsley wrote:
> On Fri, 16 Jan 2009 09:39:36 -0500
> Todd Denniston wrote:
> 
> > suggestion: find the udev|hal rules for allowing the console logged in user 
> > to 
> > use the sound card, and mimic them for your device.
> 
> I always wonder about how to fiddle hal rules. I have found hal rules
> in the past I wanted to change (like putting different permissions
> on the device file it creates), but I know if I change the actual
> rule file, then the next time there is a hal update that file
> will get updated and my changes will disappear.
> 
> Is there some magic way to properly define hal rules that override
> existing rules in the installed system files?
> 
> I usually wind up huddled in a corner in tears when I try to understand
> this stuff :-).


It used to be that you edited or created a new rule
in /etc/udev/rules.d.

The lower the number the earlier in the process the rule got looked at. 

However, it appears to me that things have changed.  I no longer see
explicit USB rules in that directory and the hal.rules file has this:

# pass all events to the HAL daemon
RUN+="socket:/org/freedesktop/hal/udev_event"

I set this device up a couple years ago and now I don't remember how.
Or things have changed. 

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: How do I allow automatic non root access to my non standard USB device ?

2009-01-16 Thread Mikkel L. Ellertson
Linuxguy123 wrote:
> I'm doing some embedded development and my flash programmer has a USB
> interface.  Everything works fine if I program the device as root, but
> I'd like to be able to do it as a regular user.  I get port permission
> errors if I try to run the programmer as a regular user.
> 
> $ lsusb
> Bus 002 Device 003: ID 064e:a101 Suyin Corp. Laptop integrated WebCam
> Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 007 Device 006: ID 15ba:0003 Olimex Ltd. OpenOCD JTAG
> Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 006 Device 002: ID 046d:c512 Logitech, Inc. LX-700 Cordless Desktop
> Receiver
> Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 005 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial
> Port
> Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 001 Device 004: ID 07ca:a321 AVerMedia Technologies, Inc.
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 003 Device 003: ID 03f0:171d Hewlett-Packard Wireless (Bluetooth +
> WLAN) Interface [Integrated Module]
> Bus 003 Device 002: ID 08ff:2580 AuthenTec, Inc. AES2501 Fingerprint
> Sensor
> Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> 
> 
> My programmer is the Olimex Ltd. OpenOCD JTAG device on bus 7.
> 
> The documentation for the device says it needs access to /proc/bus/usb.
> 
> I can allow regular user access by manually issuing a chown command for
> the port, but then I'd have to do it every time I reboot or unplug the
> programmer.   How do I set it up to happen automatically in F10 ?
> 
> Thanks !
> 
One way is to create a udev rule that sets the permission for the
device. You may also want to create a symlink to a consistant device
name at the same time.

If there isn't a device created for it, it gets a bit more
interesting. I have a small script that I call from the udev rule
that sets the permissions for the specific device in /proc/bus/usb.
I actually wrote it for use with VirtualBox, but it should work for you.



# Rules for VirtualBox USB devices.

ACTION!="add",SUBSYSTEM!="usb", GOTO="vbox_rules_end"

# eBookwise eBook reader.
ATTR{idVendor}=="0993", ATTR{idProduct}=="0002",
run="/lib/udev/set-usb-group %s{uevent}"

LABEL="vbox_rules_end"



#! /bin/sh
ret=false
if [ "$DEVICE" != "" ]; then
 if [ -e $DEVICE ]; then
  chgrp vboxusers $DEVICE && \
  chmod g+rw $DEVICE && \
  logger udev/set-usb-group: $(ls -l $DEVICE)
ret=true
 fi
fi



The group is hard coded in the script, and it only give group
permissions, but that is easy to change. One of these days I will
get around to cleaning it up, and let it get the
user/group/permissions as input.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!



signature.asc
Description: OpenPGP digital signature
-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

hal rules (was: How do I allow automatic non root access to my non standard USB device ?)

2009-01-16 Thread Tom Horsley
On Fri, 16 Jan 2009 09:39:36 -0500
Todd Denniston wrote:

> suggestion: find the udev|hal rules for allowing the console logged in user 
> to 
> use the sound card, and mimic them for your device.

I always wonder about how to fiddle hal rules. I have found hal rules
in the past I wanted to change (like putting different permissions
on the device file it creates), but I know if I change the actual
rule file, then the next time there is a hal update that file
will get updated and my changes will disappear.

Is there some magic way to properly define hal rules that override
existing rules in the installed system files?

I usually wind up huddled in a corner in tears when I try to understand
this stuff :-).

-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


Re: How do I allow automatic non root access to my non standard USB device ?

2009-01-16 Thread Todd Denniston

Linuxguy123 wrote, On 01/15/2009 04:04 PM:

I'm doing some embedded development and my flash programmer has a USB
interface.  Everything works fine if I program the device as root, but
I'd like to be able to do it as a regular user.  I get port permission
errors if I try to run the programmer as a regular user.

$ lsusb



Bus 007 Device 006: ID 15ba:0003 Olimex Ltd. OpenOCD JTAG




My programmer is the Olimex Ltd. OpenOCD JTAG device on bus 7.

The documentation for the device says it needs access to /proc/bus/usb.

I can allow regular user access by manually issuing a chown command for
the port, but then I'd have to do it every time I reboot or unplug the
programmer.   How do I set it up to happen automatically in F10 ?



suggestion: find the udev|hal rules for allowing the console logged in user to 
use the sound card, and mimic them for your device.


--
Todd Denniston
Crane Division, Naval Surface Warfare Center (NSWC Crane)
Harnessing the Power of Technology for the Warfighter

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines


How do I allow automatic non root access to my non standard USB device ?

2009-01-15 Thread Linuxguy123
I'm doing some embedded development and my flash programmer has a USB
interface.  Everything works fine if I program the device as root, but
I'd like to be able to do it as a regular user.  I get port permission
errors if I try to run the programmer as a regular user.

$ lsusb
Bus 002 Device 003: ID 064e:a101 Suyin Corp. Laptop integrated WebCam
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 006: ID 15ba:0003 Olimex Ltd. OpenOCD JTAG
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 002: ID 046d:c512 Logitech, Inc. LX-700 Cordless Desktop
Receiver
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial
Port
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 07ca:a321 AVerMedia Technologies, Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 03f0:171d Hewlett-Packard Wireless (Bluetooth +
WLAN) Interface [Integrated Module]
Bus 003 Device 002: ID 08ff:2580 AuthenTec, Inc. AES2501 Fingerprint
Sensor
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub


My programmer is the Olimex Ltd. OpenOCD JTAG device on bus 7.

The documentation for the device says it needs access to /proc/bus/usb.

I can allow regular user access by manually issuing a chown command for
the port, but then I'd have to do it every time I reboot or unplug the
programmer.   How do I set it up to happen automatically in F10 ?

Thanks !





-- 
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines