[PATCH] read drive serial number

David Zeuthen david at fubar.dk
Mon Aug 2 08:30:21 PDT 2004


On Mon, 2004-08-02 at 15:11 +0200, Kay Sievers wrote:
> On Mon, 2004-08-02 at 14:19 +0200, David Zeuthen wrote: 
> > On Mon, 2004-08-02 at 14:11 +0200, Kay Sievers wrote:
> > > > It might be easier to put in some partition table detect code ourselves
> > > > in HAL - would be more portable as well. 
> > > 
> > > Yes, I can do this. But the kernel scans the main device for any known
> > > partition table and creates subdevices if it finds volumes described by
> > > any patition table.
> > > Isn't it enough to watch if the kernel has creates sub devices for the
> > > main device. If we get a hda1 or a sda1, we can be sure, that there is a
> > > valid partition table on the disk.
> > > 
> > 
> > Might be, but it involves some timeout when looking for subdevices,
> > right? And I'd rather not have this.
> 
> Yes, sounds reasonable. We may change 'no_partitons' to 'has_partitons' and
> add this to the main device from the subdevice discovery call?
> 

We already call it block.no_partitions today and at least the update-
fstab.sh script uses it. We'll see, perhaps we should change it, a
number of things may need to change now that we will support removable
media with and without partition tables.

> > Perhaps, maybe what we should do is to just try to identify a filesystem
> > on the top-level block device, e.g. /dev/sda, right away when handling
> > it? And if we find one we set block.no_partitions to TRUE and things
> > should ''just work'' [1].
> 
> Yes, sounds good. But the hfs_probe() returns the first valid partition
> on the main device now. We just need to add a flag to struct volume_id',
> that indicates that a partiton table was found. I will do this anyway.
> 

Good catch, yeah, sounds good. Let me know.

Cheers,
David

_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list