Currently, when I want to import pictures from my camera with gphoto2, I need to do that as root because the usb devices in /proc/bus/usb/ are owned and writable by root only. I studied the available options and since there already is a group "usb" in /etc/group, I thought that could be used as the group for usb devices and thus users could be allowed access to usb devices by simply including them in the usb group. I thought this solution would be analoguous with other gentoo group usage, for example that users need to be in the "cron" group to be able to use crontab, etc.. Since /etc/init.d/localmount is the script that takes care of mounting the usbfs/usbdevfs filesystem, I would suggest that it could use the following mount options: devmode=0664,devgid=85 (gid 85 is at least in my current baselayout-1.8.6.10-r1 the group "usb") .. which I would allow user (still root) and group (usb) read-write access to the usb devices. I tried this out and it seemed to work as expected. -rw-rw-r-- 1 root usb 18 Dec 15 09:28 001 A bit more flexible but a bit less straightforward way would be to allow users to specify USBFSOPTS="devmode=0664,devgid=85" or whatever they like in /etc/conf.d/localmount and then just use whatever values the users want. Of course the options I presented (or some variation thereof) could be used as the default value unless the user has overridden the value by specifying some other USBFSOPTS value.
This seems like a good idea, but it totally doesn't work for me: 1 mustard /usr/src $ sudo umount /proc/bus/usb 0 mustard /usr/src $ sudo mount -t usbfs none /proc/bus/usb -o devmode=0664,devgid=85 0 mustard /usr/src $ ls -l /proc/bus/usb total 0 dr-xr-xr-x 2 root root 0 May 5 21:50 001/ dr-xr-xr-x 2 root root 0 May 5 21:50 002/ dr-xr-xr-x 2 root root 0 May 5 21:50 003/ dr-xr-xr-x 2 root root 0 May 5 21:50 004/ -r--r--r-- 1 root root 0 May 5 21:50 devices 0 mustard /usr/src $ ls -l /proc/bus/usb/001 total 0 -rw-r--r-- 1 root root 43 May 5 21:50 001 Feel free to re-open if you can figure out what's wrong with this.
perhaps it was a kernel bug ?
root@vapier 0 bus # uname -a Linux vapier 2.6.10-rc3 #23 Mon Dec 6 08:59:04 EST 2004 i686 Intel(R) Pentium(R) 4 CPU 1.80GHz GenuineIntel GNU/Linux root@vapier 0 bus # mount -t usbfs none /proc/bus/usb -o devmode=0664,devgid=85 root@vapier 0 bus # ls -Rl usb usb: total 0 dr-xr-xr-x 2 root root 0 Dec 6 18:31 001 dr-xr-xr-x 2 root root 0 Dec 6 18:31 002 -r--r--r-- 1 root root 0 Dec 6 18:31 devices usb/001: total 0 -rw-rw-r-- 1 root usb 43 Dec 6 18:31 001 -rw-rw-r-- 1 root usb 59 Dec 6 18:31 002 usb/002: total 0 -rw-rw-r-- 1 root usb 43 Dec 6 18:31 001
added back in