hal -> udev migration for libgphoto2

Martin Pitt martin.pitt at ubuntu.com
Thu Jun 4 07:14:45 PDT 2009


Hello all,

Martin Pitt [2009-06-03 12:39 +0200]:
> Hello Marcus, hello DeviceKitters,
> 
> one part of the "Halsectomy" [1] is the migration of the libgphoto
> integration from hal.

I wrote a first patch against libgphoto2 to add a new "udev 136" mode
to print-camera-list. Patch and details on 

  https://sourceforge.net/tracker/?func=detail&aid=2801117&group_id=8874&atid=308874

I simplified the design a bit:

> MTP/PTP cameras
> ---------------
> Extend the current udev-extras rule [2] to set a "type" flag such as
> 
>   ENV{ID_CLASS}="camera"
> 
> and
> 
>   ENV{PROTOCOL}="PTP"

Not done/necessary. To avoid tight coupling, the udev-extras rule can
stay as it is, and the new libgphoto rules will just mark cameras for
ACL_MANAGE.

> Proprietary protocol
> --------------------
> Add a new mode to print-camera-list which generates an udev rules file
> for all non-PTP/MTP cameras which looks roughly like:
> 
>   ATTR{idVendor}=="0553", ATTR{idProduct}=="0202", ENV{ID_CLASS}="camera", ENV{PROTOCOL}="gphoto2"

This now looks like

ATTRS{idVendor}=="0d64", ATTRS{idProduct}=="1001", ENV{GPHOTO2_DRIVER}="proprietary"
[...]
ENV{ID_USB_INTERFACES}=="*:060101:*", ENV{GPHOTO2_DRIVER}="PTP"

> and extend udev-extras [2] with a rule to set ACL_MANAGE for "camera"
> ID_CLASS. This needs to ensure that the libgphoto rules come before
> 70-acl.rules.

Doing the other way round, libgphoto generates a rule at the end:

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

> FDI properties
> --------------
> 
>   info.capabilities → ENV{ID_CLASS}="camera"

Replaced with ENV{GPHOTO2_DRIVER}=="?*"

>   camera.access_method → ENV{PROTOCOL}="gphoto2"/"PTP"

Replaced with value of ENV{GPHOTO2_DRIVER}

>   camera.libgphoto2.name → from USB db (product name)

Clients can just query the name from libudev.

>   camera.libgphoto2.support → ENV{PROTOCOL} == "gphoto" || "PTP" || "MTP"

Replaced with ENV{GPHOTO2_DRIVER}=="?*"

Questions, comments? David, do you see anything missing for a gvfs gphoto
conversion to libudev?

Thanks,

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/devkit-devel/attachments/20090604/36ad1cd2/attachment.pgp 


More information about the devkit-devel mailing list