hal/doc/spec hal-spec.html,1.30,1.31

David Zeuthen david at freedesktop.org
Thu Oct 14 11:37:30 PDT 2004


Update of /cvs/hal/hal/doc/spec
In directory gabe:/tmp/cvs-serv19112/doc/spec

Modified Files:
	hal-spec.html 
Log Message:
2004-10-14  David Zeuthen  <davidz at redhat.com>

	* configure.in: Add fstab-sync.8 to AC_OUTPUT
	
	* doc/conf/storage-non-fixed.fdi: New file, example

	* doc/conf/storage-skip-all.fdi: New file, example

	* doc/conf/Makefile.am: Dist and install two new .fdi files

	* fdi/90defaultpolicy/storage-policy.fdi: Fix a typo in a comment

	* hald/device_info.c:
	(my_alphasort): New function 
	(scan_fdi_files): Use my_alphasort to sort in the right order. Process
	all .fdi files instead of bailing out on the first match.

	* hald/linux/osspec.c:
	(get_selinux_removable_context): New function, copied over from 
	tools/fstab-sync.c (not currently used)
	(osspec_probe): Use get_selinux_removable_context (not currently used)

	* libhal-storage/libhal-storage.c:
	(hal_drive_policy_get_mount_options): Check if mount_option property
	is actually FALSE.
	(hal_volume_policy_get_mount_options): Same

	* libhal/libhal.c:
	(hal_free_property_set): Check if object to free is NULL and just
	return. Allows hal_free_property_set (NULL).

	* tools/Makefile.am: Add rules for building fstab-sync.8 man page

	* tools/fstab-sync.8.in: New file

	* tools/fstab-sync.c: Much rewritten to use libhal-storage and the new
	policy properties. See diff for details.



Index: hal-spec.html
===================================================================
RCS file: /cvs/hal/hal/doc/spec/hal-spec.html,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- hal-spec.html	13 Oct 2004 13:50:06 -0000	1.30
+++ hal-spec.html	14 Oct 2004 18:37:28 -0000	1.31
@@ -456,21 +456,21 @@
 ><DL
 ><DT
 ><A
-HREF="#AEN2138"
+HREF="#AEN2141"
 >Interface org.freedesktop.Hal.Manager</A
 ></DT
 ><DD
 ><DL
 ><DT
 ><A
-HREF="#AEN2149"
+HREF="#AEN2152"
 >Example</A
 ></DT
 ></DL
 ></DD
 ><DT
 ><A
-HREF="#AEN2157"
+HREF="#AEN2160"
 >Interface org.freedesktop.Hal.Device</A
 ></DT
 ></DL
@@ -6386,7 +6386,16 @@
 CLASS="literal"
 >is_absolute_path</TT
 > - matches only when a string property represents an absolute path
-	     (the path doesn't have to exist).
+	     (the path doesn't have to exist). Can be used with 'true' or 'false'.
+	 </P
+></LI
+><LI
+><P
+>&#13;	     <TT
+CLASS="literal"
+>is_ascii</TT
+> - matches only when a string property contain only ASCII characters. 
+	     Can be used with 'true' or 'false'.
 	 </P
 ></LI
 ><LI
@@ -6908,59 +6917,104 @@
     &#60;!-- Normal volumes; use volume label, uuid or drive_type --&#62;
     &#60;match key="block.is_volume" bool="true"&#62;
       &#60;match key="volume.fsusage" string="filesystem"&#62;
+	&#60;!-- skip for drives with the no partitions hint (they are handled above) --&#62;
+	&#60;match key="@block.storage_device:storage.no_partitions_hint" bool="false"&#62;
 
-	&#60;merge key="volume.policy.should_mount" type="bool"&#62;true&#60;/merge&#62;
-	&#60;merge key="volume.policy.mount_filesystem" type="copy_property"&#62;volume.fstype&#60;/merge&#62;
-
-	&#60;!-- Fallback is '&#60;storage.drive_type&#62;', e.g. disk, compact_flash etc. --&#62;
-	&#60;merge key="volume.policy.desired_mount_point" type="copy_property"&#62;@block.storage_device:storage.drive_type&#60;/merge&#62;
-	
-	&#60;!-- Better: if available use UUID --&#62;
-        &#60;match key="volume.uuid" empty="false"&#62;
-          &#60;merge key="volume.policy.desired_mount_point" type="copy_property"&#62;volume.uuid&#60;/merge&#62;
-        &#60;/match&#62;
-
-        &#60;!-- Best: If available use filesystem label --&#62;
-        &#60;match key="volume.label" empty="false"&#62;
-          &#60;!-- unless it's a path (e.g. /boot, /, /home etc) --&#62;
-          &#60;match key="volume.label" is_absolute_path="false"&#62;
-            &#60;merge key="volume.policy.desired_mount_point" type="copy_property"&#62;volume.label&#60;/merge&#62;
+	  &#60;merge key="volume.policy.should_mount" type="bool"&#62;true&#60;/merge&#62;
+	  &#60;merge key="volume.policy.mount_filesystem" type="copy_property"&#62;volume.fstype&#60;/merge&#62;
+	  
+	  &#60;!-- Fallback is '&#60;storage.drive_type&#62;', e.g. disk, compact_flash etc. --&#62;
+	  &#60;merge key="volume.policy.desired_mount_point" type="copy_property"&#62;@block.storage_device:storage.drive_type&#60;/merge&#62;
+	  
+	  &#60;!-- Better: if available use UUID --&#62;
+          &#60;match key="volume.uuid" empty="false"&#62;
+            &#60;merge key="volume.policy.desired_mount_point" type="copy_property"&#62;volume.uuid&#60;/merge&#62;
           &#60;/match&#62;
-        &#60;/match&#62;
-
-	&#60;!-- Should never mount Apple Bootstrap partitions (it would be
-	     a security hole) - should use the bootable flag from the
-	     Mac partition table instead --&#62;
-	&#60;match key="volume.fstype" string="hfs"&#62;
-	  &#60;match key="volume.label" string="bootstrap"&#62;
-	    &#60;merge key="volume.policy.should_mount" type="bool"&#62;false&#60;/merge&#62;
-	  &#60;/match&#62;
-	&#60;/match&#62;
-
-	&#60;!-- Use selinux mount options for hotpluggable and removable
-	     volumes --&#62;
-	&#60;match key="/org/freedesktop/Hal/devices/computer:linux.is_selinux_enabled" bool="true"&#62;
-	  &#60;match key="@block.storage_device:storage.hotpluggable" bool="true"&#62;
-	    &#60;merge key="volume.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool"&#62;true&#60;/merge&#62;
+	  
+          &#60;!-- Best: If available use filesystem label --&#62;
+          &#60;match key="volume.label" empty="false"&#62;
+            &#60;!-- unless it's a path (e.g. /boot, /, /home etc) --&#62;
+            &#60;match key="volume.label" is_absolute_path="false"&#62;
+	      &#60;!-- and only if the label is ascii --&#62;
+              &#60;match key="volume.label" is_ascii="true"&#62;
+		&#60;merge key="volume.policy.desired_mount_point" type="copy_property"&#62;volume.label&#60;/merge&#62;
+              &#60;/match&#62;
+            &#60;/match&#62;
+          &#60;/match&#62;
+	  
+	  &#60;!-- Should never mount Apple Bootstrap partitions (it would be
+	       a security hole) - should use the bootable flag from the
+	       Mac partition table instead --&#62;
+	  &#60;match key="volume.fstype" string="hfs"&#62;
+	    &#60;match key="volume.label" string="bootstrap"&#62;
+	      &#60;merge key="volume.policy.should_mount" type="bool"&#62;false&#60;/merge&#62;
+	    &#60;/match&#62;
 	  &#60;/match&#62;
-	  &#60;match key="@block.storage_device:storage.removable" bool="true"&#62;
-	    &#60;merge key="volume.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool"&#62;true&#60;/merge&#62;
+	  
+	  &#60;!-- Use selinux mount options for hotpluggable and removable
+	       volumes --&#62;
+	  &#60;match key="/org/freedesktop/Hal/devices/computer:linux.is_selinux_enabled" bool="true"&#62;
+	    &#60;match key="@block.storage_device:storage.hotpluggable" bool="true"&#62;
+	      &#60;merge key="volume.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool"&#62;true&#60;/merge&#62;
+	    &#60;/match&#62;
+	    &#60;match key="@block.storage_device:storage.removable" bool="true"&#62;
+	      &#60;merge key="volume.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool"&#62;true&#60;/merge&#62;
+	    &#60;/match&#62;
 	  &#60;/match&#62;
-	&#60;/match&#62;
 
-	&#60;!-- Use noatime and sync options for all hotpluggable or removable
-	     volumes smaller than 2GB --&#62;
-	&#60;match key="volume.size" compare_lt="2147483648"&#62;
-	  &#60;match key="@block.storage_device:storage.hotpluggable" bool="true"&#62;
-	    &#60;merge key="volume.policy.mount_option.async" type="bool"&#62;true&#60;/merge&#62;
-	    &#60;merge key="volume.policy.mount_option.noatime" type="bool"&#62;true&#60;/merge&#62;
+	  &#60;!-- Use noatime and sync options for all hotpluggable or removable
+	       volumes smaller than 2GB --&#62;
+	  &#60;match key="volume.size" compare_lt="2147483648"&#62;
+	    &#60;match key="@block.storage_device:storage.hotpluggable" bool="true"&#62;
+	      &#60;merge key="volume.policy.mount_option.async" type="bool"&#62;true&#60;/merge&#62;
+	      &#60;merge key="volume.policy.mount_option.noatime" type="bool"&#62;true&#60;/merge&#62;
+	    &#60;/match&#62;
+	    &#60;match key="@block.storage_device:storage.removable" bool="true"&#62;
+	      &#60;merge key="volume.policy.mount_option.async" type="bool"&#62;true&#60;/merge&#62;
+	      &#60;merge key="volume.policy.mount_option.noatime" type="bool"&#62;true&#60;/merge&#62;
+	    &#60;/match&#62;
 	  &#60;/match&#62;
-	  &#60;match key="@block.storage_device:storage.removable" bool="true"&#62;
-	    &#60;merge key="volume.policy.mount_option.async" type="bool"&#62;true&#60;/merge&#62;
-	    &#60;merge key="volume.policy.mount_option.noatime" type="bool"&#62;true&#60;/merge&#62;
+	  
+	  &#60;!-- whitelist of partition table id, if from a msdos partition table --&#62;
+	  &#60;match key="volume.partition.msdos_part_table_type" exists="true"&#62;
+	    &#60;!-- Default to no mount and punch holes --&#62;
+	    &#60;merge key="volume.policy.should_mount" type="bool"&#62;false&#60;/merge&#62;
+	    &#60;!-- Linux --&#62;
+	    &#60;match key="volume.partition.msdos_part_table_type" int="0x83"&#62;
+	      &#60;merge key="volume.policy.should_mount" type="bool"&#62;true&#60;/merge&#62;
+	    &#60;/match&#62;
+	    &#60;!-- FAT12 --&#62;
+	    &#60;match key="volume.partition.msdos_part_table_type" int="0x01"&#62;
+	      &#60;merge key="volume.policy.should_mount" type="bool"&#62;true&#60;/merge&#62;
+	    &#60;/match&#62;
+	    &#60;!-- FAT16 &#60;32M --&#62;
+	    &#60;match key="volume.partition.msdos_part_table_type" int="0x04"&#62;
+	      &#60;merge key="volume.policy.should_mount" type="bool"&#62;true&#60;/merge&#62;
+	    &#60;/match&#62;
+	    &#60;!-- FAT16 --&#62;
+	    &#60;match key="volume.partition.msdos_part_table_type" int="0x06"&#62;
+	      &#60;merge key="volume.policy.should_mount" type="bool"&#62;true&#60;/merge&#62;
+	    &#60;/match&#62;
+	    &#60;!-- HPFS/NTFS --&#62;
+	    &#60;match key="volume.partition.msdos_part_table_type" int="0x07"&#62;
+	      &#60;merge key="volume.policy.should_mount" type="bool"&#62;true&#60;/merge&#62;
+	    &#60;/match&#62;
+	    &#60;!-- W95 FAT32 --&#62;
+	    &#60;match key="volume.partition.msdos_part_table_type" int="0x0b"&#62;
+	      &#60;merge key="volume.policy.should_mount" type="bool"&#62;true&#60;/merge&#62;
+	    &#60;/match&#62;
+	    &#60;!-- W95 FAT32 (LBA) --&#62;
+	    &#60;match key="volume.partition.msdos_part_table_type" int="0x0c"&#62;
+	      &#60;merge key="volume.policy.should_mount" type="bool"&#62;true&#60;/merge&#62;
+	    &#60;/match&#62;
+	    &#60;!-- W95 FAT16 (LBA) --&#62;
+	    &#60;match key="volume.partition.msdos_part_table_type" int="0x0e"&#62;
+	      &#60;merge key="volume.policy.should_mount" type="bool"&#62;true&#60;/merge&#62;
+	    &#60;/match&#62;
 	  &#60;/match&#62;
-	&#60;/match&#62;
 
+	  
+	&#60;/match&#62;
       &#60;/match&#62;
     &#60;/match&#62;
   &#60;/device&#62;
@@ -7064,7 +7118,7 @@
 ><P
 ></P
 ><A
-NAME="AEN2096"
+NAME="AEN2099"
 ></A
 ><TABLE
 BORDER="1"
@@ -7224,7 +7278,7 @@
 ><HR><H2
 CLASS="sect1"
 ><A
-NAME="AEN2138"
+NAME="AEN2141"
 >Interface org.freedesktop.Hal.Manager</A
 ></H2
 ><P
@@ -7340,7 +7394,7 @@
 ><HR><H3
 CLASS="sect2"
 ><A
-NAME="AEN2149"
+NAME="AEN2152"
 >Example</A
 ></H3
 ><P
@@ -7458,7 +7512,7 @@
 ><HR><H2
 CLASS="sect1"
 ><A
-NAME="AEN2157"
+NAME="AEN2160"
 >Interface org.freedesktop.Hal.Device</A
 ></H2
 ><P




More information about the hal-commit mailing list