Henry Vermaak wrote:
On 27/02/12 10:07, Mark Morgan Lloyd wrote:

I'd be happy to be proven wrong, but my understanding is that you do
since there is one specific kernel call (in effect, telling the kernel
to release an unrecognised device to an unprivileged program) that won't
work otherwise.

You need root permissions because libusb accesses the file /dev/bus/usb/%d/%d. The default permissions to these files are restricted to root by default, so udev is used so that known devices can be used by less-privileged users. E.g. usb printers, which will set the group to "lp" on my system (Debian). This is what I use at work for development with a Cypress FX2 board:

hcv@technical09:~$ lsusb
...
Bus 001 Device 003: ID 04b4:8613 Cypress Semiconductor Corp. CY7C68013 EZ-USB FX2 USB 2.0 Development Kit
...

hcv@technical09:~$ ls -l /dev/bus/usb/001/
total 0
crw-rw-r-- 1 root root    189, 0 Feb 27 09:15 001
crw-rw-r-- 1 root plugdev 189, 2 Feb 27 10:26 003

hcv@technical09:~$ cat /etc/udev/rules.d/55-hcv.rules
ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="8613", MODE="0664", GROUP="plugdev"

I belong to the "plugdev" group, so I can use the device without running as root.

Thanks for the example.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to