hal/tools/callouts fstab-update.sh,1.10,1.11

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


Update of /cvs/hal/hal/tools/callouts
In directory pdx:/tmp/cvs-serv21646/tools/callouts

Modified Files:
	fstab-update.sh 
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: fstab-update.sh
===================================================================
RCS file: /cvs/hal/hal/tools/callouts/fstab-update.sh,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- a/fstab-update.sh	18 May 2004 21:14:45 -0000	1.10
+++ b/fstab-update.sh	6 Jun 2004 16:58:58 -0000	1.11
@@ -24,9 +24,16 @@
     exit 0
 fi
 
-if test "$HAL_PROP_BLOCK_IS_VOLUME" != "true"; then
-    echo "not a volume"
-    exit 0
+if test "$HAL_PROP_BLOCK_NO_PARTITIONS" != "true"; then
+    if test "$HAL_PROP_BLOCK_IS_VOLUME" != "true"; then
+	echo "not a volume"
+	exit 0
+    fi
+else
+    if test "$HAL_PROP_BLOCK_IS_VOLUME" = "true"; then
+	echo "volume, but on a block.no_partition device"
+	exit 0
+    fi
 fi
 
 # NOTE: We could use HAL_PROP_BLOCK_VOLUME_LABEL (which may or may not be 
@@ -76,7 +83,7 @@
         cp /etc/fstab /etc/fstab-hal
 	echo -ne "$HAL_PROP_BLOCK_DEVICE\t" >> /etc/fstab-hal
 	echo -ne "$MOUNTPOINT\t" >> /etc/fstab-hal
-	# HAL might have autodetected the filesystem type for us - in that
+        # HAL might have autodetected the filesystem type for us - in that
         # case use it...
 	if test $HAL_PROP_VOLUME_FSTYPE; then
 	    if test $HAL_PROP_VOLUME_FSTYPE = "msdos"; then





More information about the hal-commit mailing list