When I plug my camera "Canon PowerShot A430", the script /etc/hotplug/usb/usbcam changes permissions and group of what is called in it "${DEVICE}". This happens to be /proc/bus/usb/003/0?? on my machine, while the device that should be modified is /dev/bus/usb/003/0?? (at least this is what gphoto2 is using). If I manually do what is performed by the script on the "right" device (in /dev), all works fine and I can access my camera as a normal user. If I let the script do its job, I get: > strace gphoto2 --summary <snip> open("/dev/bus/usb/003/003", O_RDWR) = -1 EACCES (Permission denied) <snip> I have dbus and hal installed and running if that makes a difference.
*** Bug 153474 has been marked as a duplicate of this bug. ***
I had the same problem here, everything in /proc seemed ok, but not in /dev, and after some time playing with usbcam script, if seemed that the if branch was not executed because ${DEVICE} was empty. I cannot figure if it was the case before I tried about a hundred different things. As I dont know were does this $DEVICE come from, I cannot say more...
I've got the same issue. I'm using sys-fs/udev-103 sys-apps/hotplug-20040923-r2 sys-apps/hotplug-base-20040401 media-libs/libgphoto2-2.2.1-r1 sys-kernel/ck-sources-2.6.17_p1-r3 I removed /etc/hotplug and /etc/hotplug.d before re-emerging it. Is it possible that currently *all* PTP cameras are broken in Gentoo? Here's hotplug's debugging output when DEBUG is enabled: in /etc/hotplug.d/default/default.hotplug. Dec 2 21:00:24 somehost kernel: usb 4-1: new full speed USB device using uhci_hcd and address 8 Dec 2 21:00:24 somehost kernel: usb 4-1: configuration #1 chosen from 1 choice Dec 2 21:00:24 somehost default.hotplug[1655]: arguments (usb) env (SUBSYSTEM=usb DRIVER=usb OLDPWD=/ DEVPATH=/devices/pci0000:00/0000:00:10.2/usb4/4-1 ACTION=add PWD=/etc/hotplug UDEV_LOG=3 UDEVD_EVENT=1 SHLVL=1 PHYSDEVDRIVER=usb DEBUG=yes PHYSDEVBUS=usb SEQNUM=1771 _=/bin/env) Dec 2 21:00:24 somehost default.hotplug[1655]: invoke /etc/hotplug/usb.agent () Dec 2 21:00:24 somehost default.hotplug[1670]: arguments (usb) env (SUBSYSTEM=usb OLDPWD=/ DEVPATH=/devices/pci0000:00/0000:00:10.2/usb4/4-1/4-1:1.0 ACTION=add MODALIAS=usb:v04A9p30F9d0001dc00dsc00dp00ic06isc01ip01 PWD=/etc/hotplug UDEV_LOG=3 UDEVD_EVENT=1 SHLVL=1 DEVICE=/proc/bus/usb/004/008 INTERFACE=6/1/1 PRODUCT=4a9/30f9/1 TYPE=0/0/0 DEBUG=yes PHYSDEVBUS=usb SEQNUM=1772 _=/bin/env) Dec 2 21:00:24 somehost default.hotplug[1670]: invoke /etc/hotplug/usb.agent () Dec 2 21:00:24 somehost usb.agent[1670]: Setup usbcam usbcam usbcam for USB product 4a9/30f9/1 Dec 2 21:00:24 somehost usb.agent[1670]: Module setup usbcam for USB product 4a9/30f9/1 Dec 2 21:00:24 somehost last message repeated 2 times Dec 2 21:00:24 somehost default.hotplug[1748]: arguments (usb_device) env (PHYSDEVPATH=/devices/pci0000:00/0000:00:10.2/usb4/4-1 SUBSYSTEM=usb_device OLDPWD=/ DEVPATH=/class/usb_device/usbdev4.8 MINOR=391 ACTION=add PWD=/etc/hotplug UDEV_LOG=3 MAJOR=189 UDEVD_EVENT=1 DEVNAME=/dev/bus/usb/004/008 SHLVL=1 PHYSDEVDRIVER=usb DEBUG=yes PHYSDEVBUS=usb SEQNUM=1773 _=/bin/env) Dec 2 21:00:24 somehost default.hotplug[1748]: no runnable /etc/hotplug/usb_device.agent is installed
Here's a possible fix. I used "/usr/lib/libgphoto2/print-camera-list udev-rules" to create a rules file which I put in /etc/udev/rules.d. Unfortunately this didn't help. So I edited the rules file and changed all the rules to something like SYSFS{idVendor}=="093a", SYSFS{idProduct}=="010f", GROUP="plugdev", MODE="660" (setting group and mode instead of running /etc/hotplug/usb/usbcam). If these rules are called after the default udev rules everything works fine. Just name the rule file "/etc/udev/rules.d/99-gphoto2.rules" to ensure that they are called at the right moment.
Created attachment 103620 [details, diff] Backports the idea of the newer udev-rules form libgphoto-svn That patch, plus the next ebuild-changes should allow libgphoto-2.2.1 to generate correct udev-rules for udev-0.98 and above (works with udev-103).
Created attachment 103621 [details, diff] ebuild changes to apply above patch and create udev-rules These ebuild changes apply the before posted patch and also generate udev-rules based on use-flag udev. It also contains my changes for Bug #147346 as they are closely related. (It will not work without those LD_LIBRARY_PATH and CAMLIBS magic).
(In reply to comment #6) > Created an attachment (id=103621) [edit] > ebuild changes to apply above patch and create udev-rules Is the RDEPEND on sys-apps/hotplug still necessary?
Added patch to ebuild.