rpms/hal/devel 05-olpc-detect.fdi, NONE, 1.1 hal-add-out-of-tree-ofw-probing.patch, NONE, 1.1 hal.spec, 1.170, 1.171

Richard Hughes rhughes at fedoraproject.org
Wed Nov 5 09:36:54 UTC 2008


Author: rhughes

Update of /cvs/pkgs/rpms/hal/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv2149

Modified Files:
	hal.spec 
Added Files:
	05-olpc-detect.fdi hal-add-out-of-tree-ofw-probing.patch 
Log Message:
* Wed Nov 05 2008 Richard Hughes <rhughes at redhat.com> - 0.5.12-10.20081027git
- Add a small FDI file to match OLPC devices so we can remap the keyboard.



--- NEW FILE 05-olpc-detect.fdi ---
<?xml version="1.0" encoding="UTF-8"?> 
<deviceinfo version="0.2">
  <device>
    <match key="info.product" string="OLPC ALPS HGPK">
      <merge key="/org/freedesktop/Hal/devices/computer:system.hardware.product" type="string">C2</merge>
      <merge key="/org/freedesktop/Hal/devices/computer:system.hardware.vendor" type="string">OLPC</merge>
      <merge key="/org/freedesktop/Hal/devices/computer:system.hardware.version" type="string">OLPC C2</merge>
    </match>
  </device>
</deviceinfo>


hal-add-out-of-tree-ofw-probing.patch:

--- NEW FILE hal-add-out-of-tree-ofw-probing.patch ---
diff --git a/hald/linux/osspec.c b/hald/linux/osspec.c
index 91a9e65..f24efc9 100644
--- a/hald/linux/osspec.c
+++ b/hald/linux/osspec.c
@@ -734,6 +734,22 @@ decode_dmi_from_openfirmware (HalDevice *root)
 }
 
 static gboolean
+decode_dmi_from_ofw (HalDevice *root)
+{
+#define OFW_TREE_PATH "/ofw/"
+	if (!g_file_test(OFW_TREE_PATH, G_FILE_TEST_IS_DIR))
+		return FALSE;
+
+	/* these mappings are not documented */
+	hal_util_set_string_from_file(root, "system.firmware.version", OFW_TREE_PATH, "ec-name");
+	hal_util_set_string_from_file(root, "system.hardware.product", OFW_TREE_PATH, "banner-name");
+	hal_util_set_string_from_file(root, "system.hardware.serial", OFW_TREE_PATH, "serial-number");
+	hal_util_set_string_from_file(root, "system.hardware.vendor", OFW_TREE_PATH, "architecture");
+	hal_util_set_string_from_file(root, "system.hardware.version", OFW_TREE_PATH, "model");
+	return TRUE;
+}
+
+static gboolean
 decode_dmi_from_sysfs (HalDevice *d)
 {
 	if (!g_file_test (DMI_SYSFS_PATH, (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
@@ -761,7 +777,8 @@ decode_dmi (HalDevice *d)
 {
 	/* try to get the dmi infos from sysfs instead of call dmidecode*/
 	if (decode_dmi_from_sysfs(d) ||
-	    decode_dmi_from_openfirmware (d)) {
+	    decode_dmi_from_openfirmware (d) ||
+	    decode_dmi_from_ofw (d)) {
 		HAL_INFO (("got DMI from files"));
 		computer_probing_helper_done (d);
 	} else {


Index: hal.spec
===================================================================
RCS file: /cvs/pkgs/rpms/hal/devel/hal.spec,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -r1.170 -r1.171
--- hal.spec	28 Oct 2008 18:44:38 -0000	1.170
+++ hal.spec	5 Nov 2008 09:36:24 -0000	1.171
@@ -28,10 +28,14 @@
 Name: hal
 Version: 0.5.12
 #Release: 5%{?dist}
-Release: 9.%{?alphatag}%{?dist}
+Release: 10.%{?alphatag}%{?dist}
 URL: http://www.freedesktop.org/Software/hal
 #Source0: http://hal.freedesktop.org/releases/%{name}-%{version}.tar.gz
 Source0: http://hal.freedesktop.org/releases/%{name}-%{version}-%{?alphatag}.tar.gz
+
+# OLPC specific, not upstream as is a hack until OFW lands
+Source1: 05-olpc-detect.fdi
+
 Patch1: hal-0.5.10-set-property-direct.patch
 Patch2: hal-change-priority.patch
 Patch3: hal-add-keys-to-buttons.patch
@@ -163,6 +167,9 @@
 # deprecated keys
 cp -p fdi/information/10freedesktop/01-deprecated-keys.fdi $RPM_BUILD_ROOT%{_datadir}/hal/fdi/information/10freedesktop/
 
+# OLPC detection hack
+install -D -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/hal/fdi/policy/10osvendor/05-olpc-detect.fdi
+
 cp README AUTHORS NEWS COPYING HACKING $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{version}
 
 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
@@ -280,6 +287,9 @@
 %{_datadir}/gtk-doc/html/libhal-storage/*
 
 %changelog
+* Wed Nov 05 2008 Richard Hughes <rhughes at redhat.com> - 0.5.12-10.20081027git
+- Add a small FDI file to match OLPC devices so we can remap the keyboard.
+
 * Tue Oct 28 2008 Richard Hughes <rhughes at redhat.com> - 0.5.12-9.20081027git
 - Remove the newly added BDI devices to fix #468850
 




More information about the fedora-extras-commits mailing list