Hal feature request
David Zeuthen
david at fubar.dk
Wed Mar 24 15:02:34 EET 2004
On Wed, Mar 24, 2004 at 01:42:21PM +0100, Alexander Larsson wrote:
> On Wed, 2004-03-24 at 13:31, David Zeuthen wrote:
>
> > The way I go about this in hal is to *try* to give a stable UDI - for USB
> > devices, for instance, this is computed by using the vendor_id, product_id
> > and serial number (if available) - if the UDI is not unique I just smack
> > an arbitrary number on the back of it. Data not to use includes slot/port
> > number as well as other parameters known to change if the user re-arranges
> > his device.
>
> Sounds good. Do you do any ids for the media/filesystem? (such as UUID,
> or e.g. MD5SUM on initial sectors for a CD)
>
Not yet, but this might be really useful to do. I suppose having a string
property, say block.quasi_uid, with no semantics other than it being
quasi-unique might be useful. For well-known filesystems (on ext2/ext3
this could be the UUID; on FAT the volume name) something existing,
otherwise just a md5 of the first sectors as you suggest.
I suppose that some desktop environments want to show the volume name
for e.g. an icon for the block device, but I think it's outside of the
scope of hal to provide this information (even though it might coincide
with the block.quasi_uid property).
Reason is that there's a policy decision involved here - for audio CD's
you might want to retrieve it from a CDDB database and for other media
read it somewhere in the filesystem of the media itself (like a photo
collection disc or something).
> > But, no, in general you cannot guarantee unique identifiers, but then again
> > I'm not sure about how important it is to desktop environments other than
> > storing the position of a file-manager window for a block device, the name
> > of the device presented to the user (e.g. "Dad's camera") etc. I haven't
> > given it much thought though.
>
> I'm not sure either, but I know the rhythmbox people expressed interest
> in this.
>
One thing I forgot is that it is certainly useful for having multiple
devices (e.g. with a serial number) of the same kind, so we can make a
distinction between them - but maybe this is just the same as the name.
Cheers,
David
More information about the xdg
mailing list