Special device information properties

Jannis Pohlmann jannis at xfce.org
Wed Jan 27 01:29:02 PST 2010


On Wed, 27 Jan 2010 09:06:46 +0100
Martin Pitt <martin.pitt at ubuntu.com> wrote:

> Hello Jannis,
> Jannis Pohlmann [2010-01-11 15:11 +0000]:
> > 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

> 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 


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/devkit-devel/attachments/20100127/680ae63d/attachment.pgp 

More information about the devkit-devel mailing list