hal/fdi/policy/10osvendor 10-power-mgmt-policy.fdi, NONE, 1.1 10-storage-policy.fdi, NONE, 1.1 90-fstab-sync.fdi, NONE, 1.1 Makefile.am, NONE, 1.1

David Zeuthen david at freedesktop.org
Thu Feb 24 08:50:36 PST 2005


Update of /cvs/hal/hal/fdi/policy/10osvendor
In directory gabe:/tmp/cvs-serv5124/fdi/policy/10osvendor

Added Files:
	10-power-mgmt-policy.fdi 10-storage-policy.fdi 
	90-fstab-sync.fdi Makefile.am 
Log Message:
2005-02-24  David Zeuthen  <davidz at redhat.com>

	* tools/linux/hal_hotplug_map.c: Removed

	* tools/linux/Makefile.am: Remove build rules for hal-hotplug-map

	* hald/linux2/physdev.c: Callouts now take two userdata pointers
	(physdev_callouts_preprobing_done): New function
	(hotplug_event_begin_add_physdev): Run preprobing callouts
	just before real probing (flow continues in the above function)

	* hald/linux2/osspec.c: Callouts now take two userdata pointers

	* hald/linux2/classdev.c: Callouts now take two userdata pointers
	(classdev_callouts_preprobing_done): New function
	(hotplug_event_begin_add_classdev): Run preprobing callouts
	just before real probing (flow continues in the above function)

	* hald/linux2/blockdev.c: Callouts now take two userdata pointers
	(blockdev_callouts_preprobing_storage_done): New function
	(blockdev_callouts_preprobing_volume_done): New function
	(hotplug_event_begin_add_blockdev): Run preprobing callouts just
	before real probing (flow continues in the two above
	functions)

	* hald/linux2/apm.c: Callouts now take two userdata pointers

	* hald/linux2/acpi.c: Callouts now take two userdata pointers

	* hald/util.h: Fix up prototypes for callouts to take two userdata
	pointers. Add hal_util_callout_device_preprobe prototype.

	* hald/util.c: Change callouts to take two userdata pointers
	(hal_util_callout_device_preprobe): New function

	* hald/hald.c (main): Don't call hald_read_conf_file() as this
	is now gone.

	* hald/device_info.h (di_search_and_merge): Tweak prototype for
	di_search_and_merge to take a DeviceInfoType parameter

	* hald/device_info.c (di_search_and_merge): Lookup new environment
	variables

	* hald/run-hald.sh: Use new environment variables for specifying
	fdi file location

	* hald/debug-hald.sh: Use new environment variables for specifying
	fdi file location

	* hald/Makefile.am: Don't link with libselinux and don't install
	callout directories
	(hald_test_SOURCES): Remove hald_conf.[ch]
	(hald_SOURCES): Remove hald_conf.[ch].

	* configure.in: Add notes about how to tweak the hal tarball for a
	particular distribution or OS. Rework the details a bit. Remove the
	hotplug_map rules. Remove selinux bits (for now). Rework what fdi
	file directory Makefile's to generate.

	* hald/hald.conf: Removed

	* hald/hald_conf.[ch]: Removed

	* fdi/Makefile.am (SUBDIRS): Specificy new subdirs

	* fdi/preprobe: New

	* fdi/preprobe/Makefile.am: New

	* fdi/preprobe/10osvendor: New

	* fdi/preprobe/10osvendor/10-ide-drives.fdi: New

	* fdi/preprobe/10osvendor/Makefile.am: New

	* fdi/preprobe/20thirdparty: New

	* fdi/preprobe/20thirdparty/Makefile.am: New

	* fdi/preprobe/30user: New

	* fdi/preprobe/30user/Makefile.am: New

	* fdi/information: New

	* fdi/information/Makefile.am: New

	* fdi/information/10freedesktop: New

	* fdi/information/10freedesktop/Makefile.am: New

	* fdi/information/20thirdparty: New

	* fdi/information/20thirdparty/Makefile.am: New

	* fdi/information/30user: New

	* fdi/information/30user/Makefile.am: New

	* fdi/policy: New

	* fdi/policy/Makefile.am: New

	* fdi/policy/10osvendor: New

	* fdi/policy/10osvendor/10-storage-policy.fdi: New

	* fdi/policy/10osvendor/10-power-mgmt-policy.fdi: New

	* fdi/policy/10osvendor/90-fstab-sync.fdi: New

	* fdi/policy/10osvendor/Makefile.am: New

	* fdi/policy/20thirdparty: New

	* fdi/policy/20thirdparty/Makefile.am: New

	* fdi/policy/30user: New

	* fdi/policy/30user/Makefile.am: New

	* fdi/README: New file to describe the new directory structure



--- NEW FILE: 10-power-mgmt-policy.fdi ---
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- --> 

<deviceinfo version="0.2">

  <device>
    <match key="hiddev.application_pages" contains="Power Device Page">
      <append key="info.addons" type="strlist">hald-addon-hid-ups</append>
    </match>
  </device>

  <device>
    <match key="power_management.type" string="acpi">
      <append key="info.addons" type="strlist">hald-addon-acpi</append>
    </match>
  </device>

</deviceinfo>

--- NEW FILE: 10-storage-policy.fdi ---
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- --> 

<deviceinfo version="0.2">

  <!-- Default policies merged onto computer root object  -->
  <device>
    <match key="info.udi" string="/org/freedesktop/Hal/devices/computer">
      <merge key="storage.policy.default.mount_root" type="string">/media</merge>
      <merge key="storage.policy.default.use_managed_keyword" type="bool">true</merge>
      <merge key="storage.policy.default.managed_keyword.primary" type="string">managed</merge>
      <merge key="storage.policy.default.managed_keyword.secondary" type="string">kudzu</merge>
      <merge key="storage.policy.default.mount_option.noauto" type="bool">true</merge>
      <merge key="storage.policy.default.mount_option.pamconsole" type="bool">true</merge>
      <merge key="storage.policy.default.mount_option.exec" type="bool">true</merge>
    </match>
  </device>

  <device>
    <!-- Whitelist bus types of storage devices we care about  -->
    <match key="info.category" string="storage">
      <match key="storage.bus" string="usb">
	<merge key="storage.policy.should_mount" type="bool">true</merge>      
      </match>
      <match key="storage.bus" string="ide">
	<merge key="storage.policy.should_mount" type="bool">true</merge>
      </match>
      <match key="storage.bus" string="ieee1394">
	<merge key="storage.policy.should_mount" type="bool">true</merge>
      </match>
      <match key="storage.bus" string="sata">
	<merge key="storage.policy.should_mount" type="bool">true</merge>
      </match>
      <match key="storage.bus" string="platform">
	<merge key="storage.policy.should_mount" type="bool">true</merge>
      </match>
    </match>
    <!-- Also add SCSI optical drives -->
    <match key="storage.bus" string="scsi">
      <match key="storage.drive_type" string="cdrom">
        <merge key="storage.policy.should_mount" type="bool">true</merge>
      </match>
    </match>

    <!-- Handle drives with non-partitioned media  -->
    <match key="storage.no_partitions_hint" bool="true">
      <!-- optical drives -->
      <match key="storage.drive_type" string="cdrom">
	<merge key="storage.policy.mount_filesystem" type="string">auto</merge>
	<merge key="storage.policy.desired_mount_point" type="string">cdrom</merge>
	<match key="storage.cdrom.cdr" bool="true">
	  <merge key="storage.policy.desired_mount_point" type="string">cdrecorder</merge>
	</match>
	<match key="storage.cdrom.cdrw" bool="true">
	  <merge key="storage.policy.desired_mount_point" type="string">cdrecorder</merge>
	</match>
	<match key="storage.cdrom.dvdplusr" bool="true">
	  <merge key="storage.policy.desired_mount_point" type="string">cdrecorder</merge>
	</match>
	<match key="storage.cdrom.dvdplusrw" bool="true">
	  <merge key="storage.policy.desired_mount_point" type="string">cdrecorder</merge>
	</match>
	<match key="storage.cdrom.dvdram" bool="true">
	  <merge key="storage.policy.desired_mount_point" type="string">cdrecorder</merge>
	</match>
	<match key="storage.cdrom.dvdr" bool="true">
	  <merge key="storage.policy.desired_mount_point" type="string">cdrecorder</merge>
	</match>
	<match key="storage.cdrom.dvdrw" bool="true">
	  <merge key="storage.policy.desired_mount_point" type="string">cdrecorder</merge>
	</match>
	<match key="/org/freedesktop/Hal/devices/computer:linux.is_selinux_enabled" bool="true">
	  <merge key="storage.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool">true</merge>
	</match>
      </match>

      <!-- floppy drives -->
      <match key="storage.drive_type" string="floppy">
	<merge key="storage.policy.mount_filesystem" type="string">auto</merge>
	<merge key="storage.policy.desired_mount_point" type="string">floppy</merge>
	<match key="/org/freedesktop/Hal/devices/computer:linux.is_selinux_enabled" bool="true">
	  <merge key="storage.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool">true</merge>
	</match>
      </match>

      <!-- zip drives -->
      <match key="storage.drive_type" string="zip">
	<merge key="storage.policy.mount_filesystem" type="string">auto</merge>
	<merge key="storage.policy.desired_mount_point" type="string">zip</merge>
	<match key="/org/freedesktop/Hal/devices/computer:linux.is_selinux_enabled" bool="true">
	  <merge key="storage.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool">true</merge>
	</match>
      </match>

      <!-- jaz drives -->
      <match key="storage.drive_type" string="jaz">
	<merge key="storage.policy.mount_filesystem" type="string">auto</merge>
	<merge key="storage.policy.desired_mount_point" type="string">jaz</merge>
	<match key="/org/freedesktop/Hal/devices/computer:linux.is_selinux_enabled" bool="true">
	  <merge key="storage.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool">true</merge>
	</match>
      </match>
    </match>

    <!-- Normal volumes; use volume label, uuid or drive_type -->
    <match key="block.is_volume" bool="true">
      <match key="volume.fsusage" string="filesystem">
	<!-- skip for drives with the no partitions hint (they are handled above) -->
	<match key="@block.storage_device:storage.no_partitions_hint" bool="false">

	  <merge key="volume.policy.should_mount" type="bool">true</merge>
	  <merge key="volume.policy.mount_filesystem" type="copy_property">volume.fstype</merge>
	  
	  <!-- Fallback is '<storage.bus>', appended with 'disk', e.g. usbdisk,
	       idedisk, scsidisk etc. -->
	  <merge key="volume.policy.desired_mount_point" type="copy_property">@block.storage_device:storage.bus</merge>
	  <append key="volume.policy.desired_mount_point" type="string">disk</append>

         <!-- zip drives -->
         <match key="storage.drive_type" string="zip">
 	   <merge key="storage.policy.desired_mount_point" type="string">zip</merge>
         </match>
	  
          <!-- Best: If available use filesystem label -->
          <match key="volume.label" empty="false">
            <!-- unless it's a path (e.g. /boot, /, /home etc) -->
            <match key="volume.label" is_absolute_path="false">
	      <!-- and only if the label is ascii -->
              <match key="volume.label" is_ascii="true">
		<merge key="volume.policy.desired_mount_point" type="copy_property">volume.label</merge>
              </match>
            </match>
          </match>
	  
	  <!-- Should never mount Apple Bootstrap partitions (it would be
	       a security hole) - should use the bootable flag from the
	       Mac partition table instead -->
	  <match key="volume.fstype" string="hfs">
	    <match key="volume.label" string="bootstrap">
	      <merge key="volume.policy.should_mount" type="bool">false</merge>
	    </match>
	  </match>
	  
	  <!-- Use selinux mount options for hotpluggable and removable
	       volumes -->
	  <match key="/org/freedesktop/Hal/devices/computer:linux.is_selinux_enabled" bool="true">
	    <match key="@block.storage_device:storage.hotpluggable" bool="true">
	      <merge key="volume.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool">true</merge>
	    </match>
	    <match key="@block.storage_device:storage.removable" bool="true">
	      <merge key="volume.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool">true</merge>
	    </match>
	  </match>

	  <!-- Use noatime and sync options for all hotpluggable or removable
	       volumes smaller than 2GB -->
	  <match key="volume.size" compare_lt="2147483648">
	    <match key="@block.storage_device:storage.hotpluggable" bool="true">
	      <merge key="volume.policy.mount_option.sync" type="bool">true</merge>
	      <merge key="volume.policy.mount_option.noatime" type="bool">true</merge>
	    </match>
	    <match key="@block.storage_device:storage.removable" bool="true">
	      <merge key="volume.policy.mount_option.sync" type="bool">true</merge>
	      <merge key="volume.policy.mount_option.noatime" type="bool">true</merge>
	    </match>
	  </match>
	  
	  <!-- whitelist of partition table id's, if from a msdos partition table -->
	  <match key="volume.partition.msdos_part_table_type" exists="true">
	    <!-- Default to no mount and punch holes -->
	    <merge key="volume.policy.should_mount" type="bool">false</merge>
	    <!-- Linux -->
	    <match key="volume.partition.msdos_part_table_type" int="0x83">
	      <merge key="volume.policy.should_mount" type="bool">true</merge>
	    </match>
	    <!-- FAT12 -->
	    <match key="volume.partition.msdos_part_table_type" int="0x01">
	      <merge key="volume.policy.should_mount" type="bool">true</merge>
	    </match>
	    <!-- FAT16 <32M -->
	    <match key="volume.partition.msdos_part_table_type" int="0x04">
	      <merge key="volume.policy.should_mount" type="bool">true</merge>
	    </match>
	    <!-- FAT16 -->
	    <match key="volume.partition.msdos_part_table_type" int="0x06">
	      <merge key="volume.policy.should_mount" type="bool">true</merge>
	    </match>
	    <!-- HPFS/NTFS -->
	    <match key="volume.partition.msdos_part_table_type" int="0x07">
	      <merge key="volume.policy.should_mount" type="bool">true</merge>
	    </match>
	    <!-- W95 FAT32 -->
	    <match key="volume.partition.msdos_part_table_type" int="0x0b">
	      <merge key="volume.policy.should_mount" type="bool">true</merge>
	    </match>
	    <!-- W95 FAT32 (LBA) -->
	    <match key="volume.partition.msdos_part_table_type" int="0x0c">
	      <merge key="volume.policy.should_mount" type="bool">true</merge>
	    </match>
	    <!-- W95 FAT16 (LBA) -->
	    <match key="volume.partition.msdos_part_table_type" int="0x0e">
	      <merge key="volume.policy.should_mount" type="bool">true</merge>
	    </match>
	  </match>	  
	</match>
      </match>
    </match>
    
  </device>

  <!-- Dont want to mount non-hotpluggable fixed disks since ideraid
       detection isnt complete as hald wrongly detects e.g. partitions
       from some IDE RAID controllers -->
  <device>
    <match key="storage.hotpluggable" bool="false">
      <match key="storage.removable" bool="false">
	<merge key="storage.policy.should_mount" type="bool">false</merge>
      </match>
    </match>
  </device>

  <device>
    <match key="storage.media_check_enabled" bool="true">
      <append key="info.addons" type="strlist">hald-addon-storage</append>
    </match>
  </device>

</deviceinfo>

--- NEW FILE: 90-fstab-sync.fdi ---
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- --> 

<deviceinfo version="0.2">

  <device>
    <match key="info.udi" string="/org/freedesktop/Hal/devices/computer">
      <append key="info.callouts.add" type="strlist">fstab-sync --clean</append>
    </match>

    <match key="volume.policy.should_mount" bool="true">
      <match key="@block.storage_device:storage.policy.should_mount" bool="true">
	<append key="info.callouts.add" type="strlist">fstab-sync</append>
	<append key="info.callouts.remove" type="strlist">fstab-sync</append>
      </match>
    </match>

    <match key="storage.policy.should_mount" bool="true">
      <match key="storage.no_partitions_hint" bool="true">
	<append key="info.callouts.add" type="strlist">fstab-sync</append>
	<append key="info.callouts.remove" type="strlist">fstab-sync</append>
      </match>
    </match>
  </device>

</deviceinfo>


--- NEW FILE: Makefile.am ---

fdidir = $(sysconfdir)/hal/policy/10osvendor

dist_fdi_DATA = 10-storage-policy.fdi 10-power-mgmt-policy.fdi

if FSTAB_SYNC_ENABLED
dist_fdi_DATA += 90-fstab-sync.fdi
endif

clean-local :
	rm -f *~




More information about the hal-commit mailing list