hal: Branch 'master'

Richard Hughes hughsient at kemper.freedesktop.org
Wed Feb 28 15:35:22 PST 2007


 doc/spec/hal-spec-properties.xml                    |  157 +++++++++++++++++++-
 fdi/policy/10osvendor/10-dell-laptop-brightness.fdi |    4 
 fdi/policy/10osvendor/10-macbookpro-utils.fdi       |    4 
 fdi/policy/10osvendor/10-toshiba-buttons.fdi        |    2 
 hald/freebsd/hf-computer.c                          |    8 -
 hald/freebsd/probing/probe-smbios.c                 |   20 +-
 hald/linux/osspec.c                                 |    7 
 hald/linux/probing/probe-smbios.c                   |   51 +++++-
 8 files changed, 214 insertions(+), 39 deletions(-)

New commits:
diff-tree 3b99fd882da9559162453043e861d9f09473c1a1 (from a3f79521a8e02968711e930b7a8deabda1e8e9bd)
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Feb 28 23:33:46 2007 +0000

    fix the smbios.*.* keys to be a little more sane
    
    Attached are two patches against hal and hal-info that deprecate the
    smbios.* keys and replace them with:
    
    smbios.system.manufacturer      -> system.hardware.vendor
    smbios.system.product           -> system.hardware.product
    smbios.system.version           -> system.hardware.version
    smbios.system.serial            -> system.hardware.serial
    smbios.system.uuid              -> system.hardware.uuid
    smbios.bios.vendor              -> system.firmware.vendor
    smbios.bios.version             -> system.firmware.version
    smbios.bios.release_date        -> system.firmware.release_date
    smbios.chassis.manufacturer     -> system.chassis.manufacturer
    smbios.chassis.type             -> system.chassis.type
    
    This means stuff like OLPC and N800 doesn't have to use the
    smbios.bios.* prefix for system firmware and is therefore more abstract.
    
    This is important to get in before 0.5.9 as hal-info spec can't change
    after it's formally released.
    
    The old keys are copied from the new names, so everything should work as
    it used to.

diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index fdbf988..aacf370 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -2772,19 +2772,18 @@
               <entry>Yes</entry>
               <entry>
                 The formfactor of the system. Usually the equivalent of
-                <literal>smbios.chassis.type</literal> or set from information
+                <literal>system.chassis.type</literal> or set from information
                 about ACPI/APM/PMU properties.
               </entry>
             </row>
             <row>
               <entry>
-                <literal>system.vendor</literal> (string)
+                <literal>system.hardware.vendor</literal> (string)
               </entry>
               <entry></entry>
               <entry>No</entry>
               <entry>
-                The name of the manufacturer of the machine. Usually the equivalent of
-                <literal>smbios.system.manufacturer</literal>.
+                The name of the manufacturer of the machine.
               </entry>
             </row>
             <row>
@@ -2794,9 +2793,87 @@
               <entry></entry>
               <entry>No</entry>
               <entry>
-                The product name of the machine. Usually the equivalent of
-                <literal>smbios.system.product</literal> and
-                <literal>smbios.system.version</literal>.
+                The product name of the machine.
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <literal>system.hardware.version</literal> (string)
+              </entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>
+                The version of the machine.
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <literal>system.hardware.serial</literal> (string)
+              </entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>
+                The serial number of the machine.
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <literal>system.hardware.uuid</literal> (string)
+              </entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>
+                The unique ID of the machine.
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <literal>system.firmware.vendor</literal> (string)
+              </entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>
+                The firmware vendor.
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <literal>system.firmware.version</literal> (string)
+              </entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>
+                The firmware version.
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <literal>system.firmware.release_date</literal> (string)
+              </entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>
+                The release date of the firmware.
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <literal>system.chassis.manufacturer</literal> (string)
+              </entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>
+                The manufacturer of the chassis.
+              </entry>
+            </row>
+            <row>
+              <entry>
+                <literal>system.chassis.type</literal> (string)
+              </entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>
+                The chassis type of the machine.
               </entry>
             </row>
           </tbody>
@@ -6243,6 +6320,72 @@
               <entry>2007-05-01</entry>
               <entry></entry>
             </row>
+            <row>
+              <entry><literal>smbios.system.manufacturer</literal> (string)</entry>
+              <entry><literal>system.hardware.vendor</literal></entry>
+              <entry>2008-02-28</entry>
+              <entry>Renamed to something more abstract.</entry>
+            </row>
+            <row>
+              <entry><literal>smbios.system.product</literal> (string)</entry>
+              <entry><literal>system.hardware.product</literal></entry>
+              <entry>2008-02-28</entry>
+              <entry>Renamed to something more abstract.</entry>
+            </row>
+            <row>
+              <entry><literal>smbios.system.version</literal> (string)</entry>
+              <entry><literal>system.hardware.version</literal></entry>
+              <entry>2008-02-28</entry>
+              <entry>Renamed to something more abstract.</entry>
+            </row>
+            <row>
+              <entry><literal>smbios.system.serial</literal> (string)</entry>
+              <entry><literal>system.hardware.serial</literal></entry>
+              <entry>2008-02-28</entry>
+              <entry>Renamed to something more abstract.</entry>
+            </row>
+            <row>
+              <entry><literal>smbios.system.uuid</literal> (string)</entry>
+              <entry><literal>system.hardware.uuid</literal></entry>
+              <entry>2008-02-28</entry>
+              <entry>Renamed to something more abstract.</entry>
+            </row>
+            <row>
+              <entry><literal>smbios.bios.vendor</literal> (string)</entry>
+              <entry><literal>system.firmware.vendor</literal></entry>
+              <entry>2008-02-28</entry>
+              <entry>Renamed to something more abstract.</entry>
+            </row>
+            <row>
+              <entry><literal>smbios.bios.version</literal> (string)</entry>
+              <entry><literal>system.firmware.version</literal></entry>
+              <entry>2008-02-28</entry>
+              <entry>Renamed to something more abstract.</entry>
+            </row>
+            <row>
+              <entry><literal>smbios.bios.release_date</literal> (string)</entry>
+              <entry><literal>system.firmware.release_date</literal></entry>
+              <entry>2008-02-28</entry>
+              <entry>Renamed to something more abstract.</entry>
+            </row>
+            <row>
+              <entry><literal>smbios.chassis.manufacturer</literal> (string)</entry>
+              <entry><literal>system.chassis.manufacturer</literal></entry>
+              <entry>2008-02-28</entry>
+              <entry>Renamed to something more abstract.</entry>
+            </row>
+            <row>
+              <entry><literal>smbios.chassis.type</literal> (string)</entry>
+              <entry><literal>system.chassis.type</literal></entry>
+              <entry>2008-02-28</entry>
+              <entry>Renamed to something more abstract.</entry>
+            </row>
+            <row>
+              <entry><literal>system.vendor</literal> (string)</entry>
+              <entry><literal>system.hardware.vendor</literal></entry>
+              <entry>2008-02-28</entry>
+              <entry>Duplicate of system.hardware.vendor.</entry>
+            </row>
           </tbody>
         </tgroup>
       </informaltable>
diff --git a/fdi/policy/10osvendor/10-dell-laptop-brightness.fdi b/fdi/policy/10osvendor/10-dell-laptop-brightness.fdi
index 094d124..b5a3bff 100644
--- a/fdi/policy/10osvendor/10-dell-laptop-brightness.fdi
+++ b/fdi/policy/10osvendor/10-dell-laptop-brightness.fdi
@@ -10,7 +10,7 @@
        See http://bugs.freedesktop.org/show_bug.cgi?id=7221 for details. -->
   <device>
     <match key="system.kernel.name" string="Linux"> 
-      <match key="smbios.system.manufacturer" string="Dell Computer Corporation">
+      <match key="system.hardware.vendor" string="Dell Computer Corporation">
         <match key="system.formfactor" string="laptop">
            <spawn udi="/org/freedesktop/Hal/devices/dell_lcd_panel"/>
         </match>
@@ -20,7 +20,7 @@
 
   <device>
     <match key="system.kernel.name" string="Linux"> 
-      <match key="smbios.system.manufacturer" string="Dell Inc.">
+      <match key="system.hardware.vendor" string="Dell Inc.">
         <match key="system.formfactor" string="laptop">
            <spawn udi="/org/freedesktop/Hal/devices/dell_lcd_panel"/>
         </match>
diff --git a/fdi/policy/10osvendor/10-macbookpro-utils.fdi b/fdi/policy/10osvendor/10-macbookpro-utils.fdi
index fa484c1..1b0ac67 100644
--- a/fdi/policy/10osvendor/10-macbookpro-utils.fdi
+++ b/fdi/policy/10osvendor/10-macbookpro-utils.fdi
@@ -5,8 +5,8 @@
   <!-- this is for Macbook Pro (LCD panel, light sensor, keyboard backlight) -->
   <device>
     <match key="system.kernel.name" string="Linux">
-      <match key="smbios.system.manufacturer" string="Apple Computer, Inc.">
-        <match key="smbios.system.product" string="MacBookPro1,1">
+      <match key="system.hardware.vendor" string="Apple Computer, Inc.">
+        <match key="system.hardware.product" string="MacBookPro1,1">
           <spawn udi="/org/freedesktop/Hal/devices/macbook_pro_light_sensor"/>
           <spawn udi="/org/freedesktop/Hal/devices/macbook_pro_keyboard_backlight"/>
           <spawn udi="/org/freedesktop/Hal/devices/macbook_pro_lcd_panel"/>
diff --git a/fdi/policy/10osvendor/10-toshiba-buttons.fdi b/fdi/policy/10osvendor/10-toshiba-buttons.fdi
index b2e83d7..d60bee2 100644
--- a/fdi/policy/10osvendor/10-toshiba-buttons.fdi
+++ b/fdi/policy/10osvendor/10-toshiba-buttons.fdi
@@ -4,7 +4,7 @@
 
   <!-- Only launch the addon for Toshiba laptops. -->
   <device>
-    <match key="smbios.system.manufacturer" string="TOSHIBA">
+    <match key="system.hardware.vendor" string="TOSHIBA">
       <match key="system.formfactor" string="laptop">
         <append key="info.addons" type="strlist">hald-addon-acpi-buttons-toshiba</append>
         <append key="info.capabilities" type="strlist">button</append>
diff --git a/hald/freebsd/hf-computer.c b/hald/freebsd/hf-computer.c
index a311f7e..e07e24c 100644
--- a/hald/freebsd/hf-computer.c
+++ b/hald/freebsd/hf-computer.c
@@ -45,9 +45,9 @@ hf_computer_device_probe (HalDevice *dev
 
   hf_runner_run_sync(device, 0, "hald-probe-smbios", NULL);
 
-  sys_manufacturer = hal_device_property_get_string(device, "smbios.system.manufacturer");
-  sys_product = hal_device_property_get_string(device, "smbios.system.product");
-  sys_version = hal_device_property_get_string(device, "smbios.system.version");
+  sys_manufacturer = hal_device_property_get_string(device, "system.hardware.vendor");
+  sys_product = hal_device_property_get_string(device, "system.hardware.product");
+  sys_version = hal_device_property_get_string(device, "system.hardware.version");
 
   if (sys_manufacturer && sys_product && sys_version)
     {
@@ -59,7 +59,7 @@ hf_computer_device_probe (HalDevice *dev
 	hal_device_property_set_string(device, "system.product", sys_product);
     }
 
-  chassis_type = hal_device_property_get_string(device, "smbios.chassis.type");
+  chassis_type = hal_device_property_get_string(device, "system.chassis.type");
   formfactor = hal_device_property_get_string(device, "system.formfactor");
 
   if (chassis_type && (! formfactor || ! strcmp(formfactor, "unknown")))
diff --git a/hald/freebsd/probing/probe-smbios.c b/hald/freebsd/probing/probe-smbios.c
index 7d12773..2b3b6fa 100644
--- a/hald/freebsd/probing/probe-smbios.c
+++ b/hald/freebsd/probing/probe-smbios.c
@@ -200,20 +200,20 @@ main (int argc, char *argv[])
 			nbuf[i] = '\0';
 
 		if (dmiparser_state == DMIPARSER_STATE_BIOS) {
-			setstr (nbuf, "Vendor:", "smbios.bios.vendor");
-			setstr (nbuf, "Version:", "smbios.bios.version");
-			setstr (nbuf, "Release Date:", "smbios.bios.release_date");
+			setstr (nbuf, "Vendor:", "system.firmware.vendor");
+			setstr (nbuf, "Version:", "system.firmware.version");
+			setstr (nbuf, "Release Date:", "system.firmware.release_date");
 			dmiparser_done_bios = TRUE;
 		} else if (dmiparser_state == DMIPARSER_STATE_SYSTEM) {
-			setstr (nbuf, "Manufacturer:", "smbios.system.manufacturer");
-			setstr (nbuf, "Product Name:", "smbios.system.product");
-			setstr (nbuf, "Version:", "smbios.system.version");
-			setstr (nbuf, "Serial Number:", "smbios.system.serial");
-			setstr (nbuf, "UUID:", "smbios.system.uuid");
+			setstr (nbuf, "Manufacturer:", "system.hardware.vendor");
+			setstr (nbuf, "Product Name:", "system.hardware.product");
+			setstr (nbuf, "Version:", "system.hardware.version");
+			setstr (nbuf, "Serial Number:", "system.hardware.serial");
+			setstr (nbuf, "UUID:", "system.hardware.uuid");
 			dmiparser_done_system = TRUE;
 		} else if (dmiparser_state == DMIPARSER_STATE_CHASSIS) {
-			setstr (nbuf, "Manufacturer:", "smbios.chassis.manufacturer");
-			setstr (nbuf, "Type:", "smbios.chassis.type");
+			setstr (nbuf, "Manufacturer:", "system.chassis.manufacturer");
+			setstr (nbuf, "Type:", "system.chassis.type");
 			dmiparser_done_chassis = TRUE;
 		}
 	}
diff --git a/hald/linux/osspec.c b/hald/linux/osspec.c
index 52c66d3..9da684d 100644
--- a/hald/linux/osspec.c
+++ b/hald/linux/osspec.c
@@ -495,11 +495,12 @@ computer_probing_pcbios_helper_done (Hal
 		goto out;
 	}
 
-	if ((system_manufacturer = hal_device_property_get_string (d, "smbios.system.manufacturer")) != NULL &&
-	    (system_product = hal_device_property_get_string (d, "smbios.system.product")) != NULL &&
-	    (system_version = hal_device_property_get_string (d, "smbios.system.version")) != NULL) {
+	if ((system_manufacturer = hal_device_property_get_string (d, "system.hardware.vendor")) != NULL &&
+	    (system_product = hal_device_property_get_string (d, "system.hardware.product")) != NULL &&
+	    (system_version = hal_device_property_get_string (d, "system.hardware.version")) != NULL) {
 		char buf[128];
 
+		/* depricated 2008-02-28 */
 		hal_device_property_set_string (d, "system.vendor", system_manufacturer);
 
 		if (strcmp(system_version, "Not Specified" ) != 0 ) {
diff --git a/hald/linux/probing/probe-smbios.c b/hald/linux/probing/probe-smbios.c
index 4fb6aed..d0b04ff 100644
--- a/hald/linux/probing/probe-smbios.c
+++ b/hald/linux/probing/probe-smbios.c
@@ -79,6 +79,25 @@ setstr (char *buf, char *str, char *prop
 }
 
 /** 
+ *  copykeyval:
+ *  @key:		The new HAL key
+ *  @compat_key:	The compatibility key, to be copied if key exists
+ *
+ *  Copies a key value into the compatibility value, if it exists.
+ */
+static void
+copykeyval (char *key, char *compat_key)
+{
+	char *value;
+
+	value = libhal_device_get_property_string (ctx, udi, key, NULL);
+	if (value != NULL) {
+		HAL_DEBUG (("Copying %s -> %s", key, compat_key));
+		libhal_device_set_property_string (ctx, udi, compat_key, value, NULL);
+	}
+}
+
+/** 
  *  main:
  *  @argc:	Number of arguments given to program
  *  @argv:	Arguments given to program
@@ -242,20 +261,20 @@ main (int argc, char *argv[])
 			nbuf[i] = '\0';
 
 		if (dmiparser_state == DMIPARSER_STATE_BIOS) {
-			setstr (nbuf, "Vendor:", "smbios.bios.vendor");
-			setstr (nbuf, "Version:", "smbios.bios.version");
-			setstr (nbuf, "Release Date:", "smbios.bios.release_date");
+			setstr (nbuf, "Vendor:", "system.firmware.vendor");
+			setstr (nbuf, "Version:", "system.firmware.version");
+			setstr (nbuf, "Release Date:", "system.firmware.release_date");
 			dmiparser_done_bios = TRUE;
 		} else if (dmiparser_state == DMIPARSER_STATE_SYSTEM) {
-			setstr (nbuf, "Manufacturer:", "smbios.system.manufacturer");
-			setstr (nbuf, "Product Name:", "smbios.system.product");
-			setstr (nbuf, "Version:", "smbios.system.version");
-			setstr (nbuf, "Serial Number:", "smbios.system.serial");
-			setstr (nbuf, "UUID:", "smbios.system.uuid");
+			setstr (nbuf, "Manufacturer:", "system.hardware.vendor");
+			setstr (nbuf, "Product Name:", "system.hardware.product");
+			setstr (nbuf, "Version:", "system.hardware.version");
+			setstr (nbuf, "Serial Number:", "system.hardware.serial");
+			setstr (nbuf, "UUID:", "system.hardware.uuid");
 			dmiparser_done_system = TRUE;
 		} else if (dmiparser_state == DMIPARSER_STATE_CHASSIS) {
-			setstr (nbuf, "Manufacturer:", "smbios.chassis.manufacturer");
-			setstr (nbuf, "Type:", "smbios.chassis.type");
+			setstr (nbuf, "Manufacturer:", "system.chassis.manufacturer");
+			setstr (nbuf, "Type:", "system.chassis.type");
 			dmiparser_done_chassis = TRUE;
 		}
 	}
@@ -263,6 +282,18 @@ main (int argc, char *argv[])
 	/* as read to EOF, close */
 	fclose (f);
 
+	/* compatibility keys, remove 28 Feb 2008 */
+	copykeyval ("system.hardware.vendor", "smbios.system.manufacturer");
+	copykeyval ("system.hardware.product", "smbios.system.product");
+	copykeyval ("system.hardware.version", "smbios.system.version");
+	copykeyval ("system.hardware.serial", "smbios.system.serial");
+	copykeyval ("system.hardware.uuid", "smbios.system.uuid");
+	copykeyval ("system.firmware.vendor", "smbios.bios.vendor");
+	copykeyval ("system.firmware.version", "smbios.bios.version");
+	copykeyval ("system.firmware.release_date", "smbios.bios.release_date");
+	copykeyval ("system.chassis.manufacturer", "smbios.chassis.manufacturer");
+	copykeyval ("system.chassis.type", "smbios.chassis.type");
+
 out:
 	/* free ctx */
 	if (ctx != NULL) {


More information about the hal-commit mailing list