[PATCH] properly add the Eject method to Volumes on FreeBSD

Joe Marcus Clarke marcus at FreeBSD.org
Mon Jan 7 11:01:30 PST 2008


FreeBSD doesn't have a volume.linux.is_device_mapper property, so Eject was
not being added as a Volume method on FreeBSD.  Only check for
volume.linux.is_device_mapper if we are on Linux.  On FreeBSD, add Eject
no matter what.
---
 fdi/policy/10osvendor/20-storage-methods.fdi |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/fdi/policy/10osvendor/20-storage-methods.fdi b/fdi/policy/10osvendor/20-storage-methods.fdi
index 9a0cbf5..e1b77ce 100644
--- a/fdi/policy/10osvendor/20-storage-methods.fdi
+++ b/fdi/policy/10osvendor/20-storage-methods.fdi
@@ -167,11 +167,20 @@
       <append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">extra_options</append>
       <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-unmount</append>
 
-      <match key="volume.linux.is_device_mapper" bool="false">
+      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux">
+        <match key="volume.linux.is_device_mapper" bool="false">
+          <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Eject</append>
+          <append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">as</append>
+          <append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">extra_options</append>
+          <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-eject</append>
+        </match>
+      </match>
+
+      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="FreeBSD">
         <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Eject</append>
-        <append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">as</append>
-        <append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">extra_options</append>
-        <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-eject</append>
+	<append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">as</append>
+	<append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">extra_options</append>
+	<append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-eject</append>
       </match>
 
       <!-- allow these mount options for all file systems -->
-- 
1.5.3.2



More information about the hal mailing list