Bug#509293: [Pkg-phototools-devel] Bug#509293: libgphoto2-2: udev rules broken - use usb_device rather than usb|usb_device
Sarah Sharp saharabe...@gmail.com (20/12/2008): /etc/udev/rules.d/025_libgphoto2.rules includes this skip rule: SUBSYSTEM!=usb|usb_device, GOTO=libgphoto2_rules_end The pipe is not documented to work in the udev manpage, and I think this is the problem. When I change the line to: SUBSYSTEM!=usb_device, GOTO=libgphoto2_rules_end I can access the camera as a normal user. Hello again, Sarah. I've checked again what I wrote for the versioned recommendation on udev, and the upstream commit is as attached. As you can see, there's no documentation update for that. I've also found other packages using that syntax, while learning a bit more about udev: ,-- | $ egrep '!=.*\|' /etc/udev/rules.d/* | /etc/udev/rules.d/025_libgphoto2.rules:SUBSYSTEM!=usb|usb_device, GOTO=libgphoto2_rules_end | /etc/udev/rules.d/60-persistent-input.rules:ACTION!=add|change, GOTO=persistent_input_end | /etc/udev/rules.d/60-persistent-storage.rules:ACTION!=add|change, GOTO=persistent_storage_end | /etc/udev/rules.d/60-persistent-storage.rules:ENV{DEVTYPE}==disk, KERNEL!=sd*|sr*, ATTR{removable}==1, \ | /etc/udev/rules.d/60-persistent-storage-tape.rules:ACTION!=add|change, GOTO=persistent_storage_tape_end | /etc/udev/rules.d/60-persistent-v4l.rules:ACTION!=add|change, GOTO=persistent_v4l_end | /etc/udev/rules.d/65_dmsetup.rules:ACTION!=add|change, GOTO=device_mapper_end | /etc/udev/rules.d/75-cd-aliases-generator.rules: SUBSYSTEMS!=usb|ieee1394, \ | /etc/udev/rules.d/75-persistent-net-generator.rules:KERNEL!=eth*|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*, \ | /etc/udev/rules.d/91-permissions.rules:ACTION!=add|change, GOTO=permissions_end `-- So, it looks like more than just ACTION!='foo|bar' is supported, as expected by the libgphoto2 upstream developers. Maybe some bugs were then introduced in udev, which might explain why it is no longer working? Could you please send to the bugreport the output of “udevinfo -a” on the appropriate device so that we have an idea of what's missing? Happy celebrations, if any. ;) Mraw, KiBi. signature.asc Description: Digital signature
Bug#509293: [Pkg-phototools-devel] Bug#509293: Bug#509293: libgphoto2-2: udev rules broken - use usb_device rather than usb|usb_device
Cyril Brulebois k...@debian.org (24/12/2008): I've checked again what I wrote for the versioned recommendation on udev, and the upstream commit is as attached. As you can see, there's For real, this time, sorry for the noise. Mraw, KiBi. commit 81313e1b48866efb9e40eb88420643de05275b56 Author: Kay Sievers kay.siev...@vrfy.org Date: Sat Mar 31 02:46:32 2007 +0200 make ACTION!=add|change working Thanks to Scott for the suggestion. diff --git a/udev_rules.c b/udev_rules.c index 5078f2d..d77d5ec 100644 --- a/udev_rules.c +++ b/udev_rules.c @@ -584,18 +584,18 @@ static char *key_pair_name(struct udev_rule *rule, struct key_pair *pair) static int match_key(const char *key_name, struct udev_rule *rule, struct key *key, const char *val) { - int match; char value[PATH_SIZE]; char *key_value; char *pos; + int match = 0; if (key-operation != KEY_OP_MATCH key-operation != KEY_OP_NOMATCH) return 0; + /* look for a matching string, parts are separated by '|' */ strlcpy(value, rule-buf + key-val_off, sizeof(value)); key_value = value; - dbg(key %s value='%s', key_name, key_value); while (key_value) { pos = strchr(key_value, '|'); @@ -603,19 +603,23 @@ static int match_key(const char *key_name, struct udev_rule *rule, struct key *k pos[0] = '\0'; pos++; } + dbg(match %s '%s' - '%s', key_name, key_value, val); match = (fnmatch(key_value, val, 0) == 0); - if (match (key-operation != KEY_OP_NOMATCH)) { - dbg(%s is true (matching value), key_name); - return 0; - } - if (!match (key-operation == KEY_OP_NOMATCH)) { - dbg(%s is true (non-matching value), key_name); - return 0; - } + if (match) + break; + key_value = pos; } - dbg(%s is false, key_name); + + if (match (key-operation == KEY_OP_MATCH)) { + dbg(%s is true (matching value), key_name); + return 0; + } + if (!match (key-operation == KEY_OP_NOMATCH)) { + dbg(%s is true (non-matching value), key_name); + return 0; + } return -1; } signature.asc Description: Digital signature
Bug#509293: [Pkg-phototools-devel] Bug#509293: libgphoto2-2: udev rules broken - use usb_device rather than usb|usb_device
Sarah Sharp saharabe...@gmail.com (20/12/2008): Incorrect udev rules in the latest libgphoto2-2 package are not creating USB device files in the plugdev group. That means I can run gphoto2 as root, but not as a normal user. /etc/udev/rules.d/025_libgphoto2.rules includes this skip rule: SUBSYSTEM!=usb|usb_device, GOTO=libgphoto2_rules_end The pipe is not documented to work in the udev manpage, and I think this is the problem. When I change the line to: SUBSYSTEM!=usb_device, GOTO=libgphoto2_rules_end I can access the camera as a normal user. Versions of packages libgphoto2-2 recommends: ii udev 0.125-7/dev/ and hotplug management daemo Hmmm, I'll have to dig this out. I wrote in a previous libgphoto2 changelog entry: ,--[ 2.4.1-2 ]-- | * Version the Recommends on udev (which is conditionally specified | through the ${udev-hotplug} variable in debian/rules), since | libgphoto2 now uses the alternative syntax (that is: key!=a|b), | which apparently was introduced in udev 0.109. Adding “(= 0.113-1)” | since that's the first version in Debian which included this | feature. Many thanks to Jan Echternach for having spotted the problem | as well as its solution (Closes: #491065). `-- So maybe the “|” support went away. Thanks for your report. Mraw, KiBi. signature.asc Description: Digital signature
Bug#509293: libgphoto2-2: udev rules broken - use usb_device rather than usb|usb_device
Package: libgphoto2-2 Version: 2.4.1-3 Severity: important Incorrect udev rules in the latest libgphoto2-2 package are not creating USB device files in the plugdev group. That means I can run gphoto2 as root, but not as a normal user. /etc/udev/rules.d/025_libgphoto2.rules includes this skip rule: SUBSYSTEM!=usb|usb_device, GOTO=libgphoto2_rules_end The pipe is not documented to work in the udev manpage, and I think this is the problem. When I change the line to: SUBSYSTEM!=usb_device, GOTO=libgphoto2_rules_end I can access the camera as a normal user. I have CONFIG_USB_DEVICE_CLASS=y in my kernel config. (I looked because of bug 427963.) I did comment out the /etc/fstab rule to automatically mount usbdevfs because I'm a USB developer and I need to be able to remove the USB core module. gphoto2 info: 0.000222 main(2): ALWAYS INCLUDE THE FOLLOWING LINES WHEN SENDING DEBUG MESSAGES TO THE MAILING LIST: 0.002469 main(2): gphoto2 2.4.0 0.002518 main(2): gphoto2 has been compiled with the following options: 0.002549 main(2): + gcc (C compiler used) 0.002629 main(2): + popt (mandatory, for handling command-line parameters) 0.002659 main(2): + exif (for displaying EXIF information) 0.002688 main(2): + cdk (for accessing configuration options) 0.002716 main(2): + no aa (for displaying live previews) 0.002744 main(2): + jpeg (for displaying live previews in JPEG format) 0.002773 main(2): + readline (for easy navigation in the shell) 0.002813 main(2): libgphoto2 2.4.1 0.002850 main(2): libgphoto2 has been compiled with the following options: 0.002880 main(2): + gcc (C compiler used) 0.002908 main(2): + ltdl (for portable loading of camlibs) 0.002936 main(2): + EXIF (for special handling of EXIF files) 0.002969 main(2): libgphoto2_port 0.8.0 0.003004 main(2): libgphoto2_port has been compiled with the following options: 0.003034 main(2): + gcc (C compiler used) 0.003062 main(2): + ltdl (for portable loading of camlibs) 0.003091 main(2): + USB (libusb, for USB cameras) 0.003118 main(2): + serial (for serial cameras) 0.003146 main(2): + no resmgr (serial port access and locking) 0.003175 main(2): + no baudboy (serial port locking) 0.003203 main(2): + no ttylock (serial port locking) 0.003231 main(2): + no lockdev (serial port locking) 0.003260 main(2): CAMLIBS env var not set, using compile-time default instead 0.003288 main(2): IOLIBS env var not set, using compile-time default instead -- System Information: Debian Release: 4.0 APT prefers testing APT policy: (990, 'testing'), (500, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.6.23-wireless (PREEMPT) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages libgphoto2-2 depends on: ii adduser 3.100 Add and remove users and groups ii libc6 2.7-4 GNU C Library: Shared libraries ii libexif12 0.6.16-2.1 library to parse EXIF files ii libgphoto2-port0 2.4.1-3gphoto2 digital camera port librar ii libjpeg62 6b-14 The Independent JPEG Group's JPEG ii libltdl3 1.5.22-4 A system independent dlopen wrappe Versions of packages libgphoto2-2 recommends: ii udev 0.125-7/dev/ and hotplug management daemo -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org