hal/hald/linux block_class_device.c,1.28,1.29

David Zeuthen david at pdx.freedesktop.org
Sun Jun 6 09:59:04 PDT 2004


Update of /cvs/hal/hal/hald/linux
In directory pdx:/tmp/cvs-serv21646/hald/linux

Modified Files:
	block_class_device.c 
Log Message:
2004-06-06  David Zeuthen  <david at fubar.dk>

	* hald/linux/block_class_device.c (block_class_visit): Add the
	block.no_partitions boolean property and set it to FALSE by
	default. If this is TRUE it means that media for this toplevel
	block device will appear as children but there can be at maximum
	one child and the block.device will be the same. This applies to
	floppy and cdrom media. This property have been introduced such
	that a callout can update the fstab in advance of media insertion
	on e.g. floppy drives and optical drives.
	(block_class_pre_process): Set block.no_partitions to TRUE for
	optical drives.

	* tools/callouts/fstab-update.sh: When block.no_partitions is TRUE
	create entry only for top-level block device.



Index: block_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/block_class_device.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- a/block_class_device.c	1 Jun 2004 21:10:02 -0000	1.28
+++ b/block_class_device.c	6 Jun 2004 16:58:58 -0000	1.29
@@ -109,6 +109,8 @@
 	hal_device_property_set_string (d, "linux.sysfs_path", path);
 	hal_device_property_set_string (d, "linux.sysfs_path_device", path);
 
+	hal_device_property_set_bool (d, "block.no_partitions", FALSE);
+
 	if (class_device->sysdevice == NULL) {
 		parent_sysfs_path = get_parent_sysfs_path (path);
 		hal_device_property_set_bool (d, "block.is_volume", TRUE);
@@ -1157,6 +1159,7 @@
 	if (hal_device_has_property (stordev, "storage.drive_type") &&
 	    strcmp (hal_device_property_get_string (stordev, "storage.drive_type"), 
 		    "cdrom") == 0) {
+		hal_device_property_set_bool (d, "block.no_partitions", TRUE);
 		cdrom_check (stordev, device_file);
 		hal_device_add_capability (stordev, "storage.cdrom");
 	}





More information about the hal-commit mailing list