#122 more modern udev rules with DB tagging (hal replacement)

closed-fixed
None
5
2009-07-08
2009-06-04
Martin Pitt
No

Hal is in the process of being deprecated [1]. Yesterday I started a discussion about how this transition could look like for libgphoto2 desktop integration [2].

I now created a patch for libgphoto2 to add a new udev mode to achieve this:

* Add a new udev mode "136" to avoid changing current behaviour of the 0.98/pre-0.98 modes. "136" was choosen because from this version on, rules go into /lib/udev/rules.d/ and thus the help text could point this out.

* More contemporary rules header, using ENV{DEVTYPE} and usb_id instead of the custom check_ptp_camera shell script (mode 136 does not need this script any more).

* Set GPHOTO2_DRIVER environment variable, to "proprietary" or "PTP" accordingly. This property can then be queried by e. g. gvfs or KDE via libudev, instead of querying hal.

* Do not require specifying mode/owner or a script for udev mode 136 onwards. If none is specified, add a rule for managing ACLs automatically (with current udev-extras).

It works well with my Canon PowerShot A75 (which supports both proprietary and PTP).

Output:

$ print-camera-list udev-rules version 136

# udev rules file for libgphoto2 devices (for udev 136 version)
# Created from this library:
# libgphoto2 2.4.6 gcc, ltdl, EXIF
# libgphoto2_port 0.8.0 gcc, ltdl, USB, serial without locking
#
# this file is autogenerated, local changes will be LOST on upgrades
SUBSYSTEM!="usb", GOTO="libgphoto2_rules_end"
ENV{DEVTYPE}!="usb_device", GOTO="libgphoto2_rules_end"
ACTION!="add", GOTO="libgphoto2_rules_end"

ENV{ID_USB_INTERFACES}=="", IMPORT{program}="usb_id --export %p"

ATTRS{idVendor}=="0553", ATTRS{idProduct}=="0202", ENV{GPHOTO2_DRIVER}="proprietary"
[...]
ENV{ID_USB_INTERFACES}=="*:060101:*", ENV{GPHOTO2_DRIVER}="PTP"

# mark for automatic ACL management
ENV{GPHOTO2_DRIVER}=="?*", ENV{ACL_MANAGE}="1"

LABEL="libgphoto2_rules_end"

[1] https://wiki.ubuntu.com/Halsectomy
[2] http://lists.freedesktop.org/archives/devkit-devel/2009-June/000191.html

Discussion

  • Marcus Meissner

    Marcus Meissner - 2009-06-04
    • assigned_to: nobody --> marcusmeissner
     
  • Marcus Meissner

    Marcus Meissner - 2009-06-04

    i have applied it to svn

    lets see how this progresses onwards ;)

     
  • Marcus Meissner

    Marcus Meissner - 2009-07-08
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks