Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#3639 - Udev: removing hotplug breaks gphoto2 permissions

Attached to Project: Arch Linux
Opened by Tom Killian (tomk) - Monday, 19 December 2005, 18:56 GMT
Last edited by Judd Vinet (judd) - Tuesday, 10 January 2006, 22:55 GMT
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7 Wombat
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I installed udev 078-1 from testing, and removed hotplug, as required. Previously, gphoto2 required the following hotplug script, /etc/hotplug/usb/usbcam:

<snip>
GROUP=users

if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
then
chmod o-rwx "${DEVICE}"
chgrp "${GROUP}" "${DEVICE}"
chmod g+rw "${DEVICE}"
fi
</snip>

to permit non-root operation. The result of this script could be seen in /proc/bus/usb, for example:

/proc/bus/usb/001:
total 0
-rw-r--r-- 1 root root 43 2005-12-19 14:05 001
-rw-r--r-- 1 root root 43 2005-12-19 14:11 003
-rw-r--r-- 1 root root 57 2005-12-19 14:12 004
-rw-r--r-- 1 root users 57 2005-12-19 18:24 012

Without hotplug, the usbcam script is not run, ownership of all usb devices remains root:root, and user operation is no longer possible.

I tried adding a local udev rule to change ownership of the relevant device to root:users, e.g.

/dev/u*
cr--r--r-- 1 root root 1, 9 2005-12-18 11:01 /dev/urandom
crw-rw---- 1 root root 189, 0 2005-12-19 14:05 /dev/usbdev1.1
crw-rw---- 1 root users 189, 11 2005-12-19 18:24 /dev/usbdev1.12
crw-rw---- 1 root root 189, 2 2005-12-19 14:11 /dev/usbdev1.3
crw-rw---- 1 root root 189, 3 2005-12-19 14:12 /dev/usbdev1.4

but it made no difference.

TIA.
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Wednesday, 11 January 2006, 18:44 GMT
Reason for closing:  Fixed
Comment by Tobias Powalowski (tpowa) - Monday, 19 December 2005, 20:11 GMT
ahh thanks, just missed that, for sane i have already a helper script that fixes libusb stuff, will add this soon.
Comment by Tom Killian (tomk) - Monday, 19 December 2005, 20:29 GMT
Thanks - I look forward to it.
Comment by Tobias Powalowski (tpowa) - Monday, 19 December 2005, 22:37 GMT
could you please try this:
install 'sane' package, add yourself to scanner group and check if your camera starts working again, thanks
Comment by Tom Killian (tomk) - Tuesday, 20 December 2005, 00:24 GMT
Done, tpowa, but no change - /proc/bus/usb ownership is still all root:root.

Thanks.
Comment by Tobias Powalowski (tpowa) - Tuesday, 20 December 2005, 07:10 GMT
ok then sane rule doesn'T cover the camera's, good on the one side,
bad on the other, so i have to find a rule that covers cameras.
Comment by Tobias Powalowski (tpowa) - Tuesday, 20 December 2005, 07:17 GMT
does changing this line in udev.rules help?
SUBSYSTEM="usb_device", PROGRAM="/bin/sh -c 'X=%k X=$${X#usbdev} B=$${X%%%%.*} D=$${X#*.}; echo bus/usb/$$B/$$D'", SYMLINK+="%c", MODE="0664"

please try also MODE="0666"
attention this is a one line thing!
thanks
Comment by Tobias Powalowski (tpowa) - Tuesday, 20 December 2005, 09:40 GMT
ok my suggestion will probably not work,
if you want to do me a favour, libgphoto2 needs to be changed to include a udev rule
i need the usermap from hotplug for all cameras then it will make sense to include the rule.
i can't look at it until tomorrow afternoon, so if you know where i can find these usermap, i have less work and fix will sooner appear, thanks
greetings
tpowa
Comment by Tom Killian (tomk) - Tuesday, 20 December 2005, 10:09 GMT
Here's the usermap.

Always glad to do a dev a favour. :)
Comment by Tobias Powalowski (tpowa) - Tuesday, 20 December 2005, 16:12 GMT
where is this file from is it in libgphoto2?
Comment by Tobias Powalowski (tpowa) - Tuesday, 20 December 2005, 17:37 GMT
please try new libgphoto from testing repository, it should fix your problems,
add your user to camera group and permission should work.
Comment by Tom Killian (tomk) - Wednesday, 21 December 2005, 01:29 GMT
I've installed testing/libgphoto2, added myself to the 'camera' group, and it's all working fine now. Thanks very much, and apologies for not responding to your earlier question.
Comment by Judd Vinet (judd) - Tuesday, 10 January 2006, 22:55 GMT
Re-opened by tomk:

Bug fix changed permissions to root:camera for ALL usb devices, not just camera devices. Subsequent fix for this new problem reverts all devices to root:root, so we're back where we started.
Comment by Tobias Powalowski (tpowa) - Wednesday, 11 January 2006, 07:09 GMT
not reproducable here, perhaps you have a wrong gphoto.rules file with the SYSFS=0000 thing enabled.
Comment by Tom Killian (tomk) - Wednesday, 11 January 2006, 09:51 GMT
Please close again. After requesting re-opening, tpowa and Greg Meyer educated me on the mailing list, but I couldn't find any way to cancel the request.

My camera is not in gphoto's list, which was OK for hotplug, but causes problems for udev. I added a rule, and all is now OK.

Thanks again to all concerned.

Loading...