[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



On Tue, 2009-01-20 at 17:54 -0700, Linuxguy123 wrote:
> On Mon, 2009-01-19 at 17:20 -0700, 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 !
> 
> Anyone ?
> 

I did the following for accessing my jtag device.
Created /usr/share/hal/fdi/information/20thirdparty/10-olimex-programmer.fdi containing :-

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
  <device>

    <!-- Grant access to program the Olimex devices to uucp group. -->

  <!-- <match key="info.subsystem" contains="usb_device"> -->
      <match key="usb_device.vendor_id" int="0x15ba">
         <append key="info.capabilities"
type="strlist">olimex-device</append>
          <append key="info.capabilities"
type="strlist">access_control</append>
          <merge key="access_control.file"
type="copy_property">linux.device_file</merge>
          <merge key="access_control.type"
type="string">olimex-device</merge>
          <merge key="access_control.grant_group"
type="strlist">uucp</merge>
     </match>
    <!-- </match> -->
  </device>
</deviceinfo>

I then added myself to the uucp group and rebooted, for some reason
restarting haldaemon did not work correctly. Now openocd works without
having to be root. Hope this helps.

I do wish this udev/hal/policykit magic was better documented.

Kevin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]