Re: Special device information properties

2010-01-27 Thread Martin Pitt
Hello Jannis,

Jannis Pohlmann [2010-01-11 15:11 +]:
> Unfortunately it's implemented on top of HAL and mounts volumes with
> HAL as well which seems to be incompatible with DeviceKit-disks. When a
> volume is mounted with HAL and later someone tries to unmount it with
> DeviceKit-disks (via GIO/GVfs which are used in our file manager
> thunar), users are asked for the root password. 

Right, since hal and dk-disks use separate "mtabs" to record user
mounts.

> So I'm thinking about dropping HAL in favor of DeviceKit-disks.

That's a good idea either way, since HAL is deprecated and not being
maintained any more. :-) Thanks for working on this.

> Now my question is: Are all/most/some the device properties supported by
> HAL (like camera.access_mode, portable_audio_player or pda.platform)
> also available via DeviceKit-disks?

No, as the name says, DK-disks only handles storage devices. Also,
dk-disks does not really have such properties on its own either, it
just provides disk related services/functionality.

> If this information is not available via DeviceKit-disks, what other 
> options do we have; (g)udev for querying device information + GIO for
> mounting? Does udev provide the bits information HAL supported before?

udev and sysfs are indeed the canonical (and only) places for storing
such properties. lib(g)udev should be used for querying attributes and
udev properties, and for getting hotplug events.

If XFCE doesn't want to reimplement all of that again, I recommend
taking a look at gnome-disk-utility (which provides a very convenient
API for handling storage devices and is pretty lightweight in terms of
GNOME dependencies), and to gvfs (which provides "mounting" of
gphoto2, ipod, mtp, and other almost-but-not-quite storage devices.

If you don't want to use gvfs, then you can use gudev to identify
those devices E. g. for libgphoto, the counterpart of hal's "camera"
capability is ID_GPHOTO2, and camera.access_mode is GPHOTO2_DRIVER;
portable_audio_player is ID_MEDIA_PLAYER (set by the media-player-info
package).

Martin

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
devkit-devel mailing list
devkit-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/devkit-devel


Re: Special device information properties

2010-01-27 Thread Jannis Pohlmann
Hey,

On Wed, 27 Jan 2010 09:06:46 +0100
Martin Pitt  wrote:

> Hello Jannis,
> 
> Jannis Pohlmann [2010-01-11 15:11 +]:
> > So I'm thinking about dropping HAL in favor of DeviceKit-disks.
> 
> That's a good idea either way, since HAL is deprecated and not being
> maintained any more. :-) Thanks for working on this.

The thing is: we'd like Xfce to remain portable. We're working together
with BSD folks and for them HAL was quite a pain already. Now that we
have DeviceKit-disks (or rather udisks) it looks like they'll run into
the same incompatibility issues once again.

So, I'd be happy to avoid a direct dependency on udisks for now, which
seems fairly realistic in the case of thunar-volman. udev seems enough
to distinguish device types and GIO seems enough to map udev partitions
to GIO volumes in order to mount them. So udisks would be used
indirectly only in the file manager itself (via GIO, GVfs,
gvfs-gdu-volume-monitor and gnome-disk-utility).

But is udev compatible with BSD at all?

> > If this information is not available via DeviceKit-disks, what
> > other options do we have; (g)udev for querying device information +
> > GIO for mounting? Does udev provide the bits information HAL
> > supported before?
> 
> udev and sysfs are indeed the canonical (and only) places for storing
> such properties. lib(g)udev should be used for querying attributes and
> udev properties, and for getting hotplug events.

Yes, that's what I'm using now (gudev in combination with GIO for
mounting). 

> If XFCE doesn't want to reimplement all of that again, I recommend
> taking a look at gnome-disk-utility (which provides a very convenient
> API for handling storage devices and is pretty lightweight in terms of
> GNOME dependencies), and to gvfs (which provides "mounting" of
> gphoto2, ipod, mtp, and other almost-but-not-quite storage devices.

For this purpose GVfs (used transparently through GIO) doesn't provide
enough information about and control over devices.

> If you don't want to use gvfs, then you can use gudev to identify
> those devices E. g. for libgphoto, the counterpart of hal's "camera"
> capability is ID_GPHOTO2, and camera.access_mode is GPHOTO2_DRIVER;
> portable_audio_player is ID_MEDIA_PLAYER (set by the media-player-info
> package).

Yep, I figured that out in the meantime. I've collected some
information on how to separate device types from each other on 

  http://wiki.xfce.org/dev/thunar-volman-udev

just in case anyone is interested in this stuff. It's not much but in
addition to extracting device information with the help of udev a great
deal of detecting cameras and media players lies in mounting their
volumes and investigating their disk contents (like checking for
DCIM/ folders etc.).

  - Jannis


signature.asc
Description: PGP signature
___
devkit-devel mailing list
devkit-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/devkit-devel