Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main-src > by-pkgid > 26764e702e441b473525f6a16ac25557 > files > 19

hal-0.5.8.1-59.el5.src.rpm

--- hald/linux/probing/probe-smbios.c.orig	2007-06-25 17:27:09.000000000 -0400
+++ hald/linux/probing/probe-smbios.c	2007-06-25 17:30:34.000000000 -0400
@@ -50,6 +50,18 @@
 char *udi = NULL;
 LibHalContext *ctx = NULL;
 
+static void
+set_key_from (char *target_key, char *source_key)
+{
+	char *value;
+	
+	value = libhal_device_get_property_string (ctx, udi, source_key, NULL);
+	if (value != NULL) {
+		HAL_DEBUG (("Copying %s -> %s", source_key, target_key));
+		libhal_device_set_property_string (ctx, udi, target_key, value, NULL);
+	}
+}
+
 /** Finds the start of a null terminated string and sets HAL
  *  property if valid.
  *
@@ -232,6 +244,18 @@
 	/* as read to EOF, close */
 	fclose (f);
 
+	/* forward ported from hal 0.5.9 */
+	set_key_from ("system.hardware.vendor", "smbios.system.manufacturer");
+	set_key_from ("system.hardware.product", "smbios.system.product");
+	set_key_from ("system.hardware.version", "smbios.system.version");
+	set_key_from ("system.hardware.serial", "smbios.system.serial");
+	set_key_from ("system.hardware.uuid", "smbios.system.uuid");
+	set_key_from ("system.firmware.vendor", "smbios.bios.vendor");
+	set_key_from ("system.firmware.version", "smbios.bios.version");
+	set_key_from ("system.firmware.release_date", "smbios.bios.release_date");
+	set_key_from ("system.chassis.manufacturer", "smbios.chassis.manufacturer");
+	set_key_from ("system.chassis.type", "smbios.chassis.type");
+
 out:
 	/* free ctx */
 	if (ctx != NULL) {