Special device information properties

Martin Pitt martin.pitt at ubuntu.com
Wed Jan 27 00:06:46 PST 2010

Hello Jannis,

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

> 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


Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

More information about the devkit-devel mailing list