rpms/lm_sensors/devel lm_sensors-3.0.1-pci-without-subsys.patch, NONE, 1.1 lm_sensors-3.0.1-virtual-dev.patch, NONE, 1.1 lm_sensors.spec, 1.63, 1.64

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Sun Mar 16 10:15:10 UTC 2008


Author: jwrdegoede

Update of /cvs/extras/rpms/lm_sensors/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29708

Modified Files:
	lm_sensors.spec 
Added Files:
	lm_sensors-3.0.1-pci-without-subsys.patch 
	lm_sensors-3.0.1-virtual-dev.patch 
Log Message:
* Sun Mar 16 2008 Hans de Goede <j.w.r.degoede at hhs.nl> 3.0.1-5
- Make libsensors work with hwmon class entries without a device link
  such as the acpi thermal_zone driver (bz 437637)


lm_sensors-3.0.1-pci-without-subsys.patch:

--- NEW FILE lm_sensors-3.0.1-pci-without-subsys.patch ---
Index: lib/sysfs.c
===================================================================
--- lib/sysfs.c	(revision 5142)
+++ lib/sysfs.c	(working copy)
@@ -524,19 +524,19 @@
 		/* SPI */
 		entry.chip.bus.type = SENSORS_BUS_TYPE_SPI;
 	} else
+	if ((!subsys || !strcmp(subsys, "pci")) &&
+	    sscanf(dev_name, "%x:%x:%x.%x", &domain, &bus, &slot, &fn) == 4) {
+		/* PCI */
+		entry.chip.addr = (domain << 16) + (bus << 8) + (slot << 3) + fn;
+		entry.chip.bus.type = SENSORS_BUS_TYPE_PCI;
+		entry.chip.bus.nr = 0;
+	} else
 	if ((!subsys || !strcmp(subsys, "platform"))) {
 		/* must be new ISA (platform driver) */
 		if (sscanf(dev_name, "%*[a-z0-9_].%d", &entry.chip.addr) != 1)
 			entry.chip.addr = 0;
 		entry.chip.bus.type = SENSORS_BUS_TYPE_ISA;
 		entry.chip.bus.nr = 0;
-	} else
-	if ((!subsys || !strcmp(subsys, "pci")) &&
-	    sscanf(dev_name, "%x:%x:%x.%x", &domain, &bus, &slot, &fn) == 4) {
-		/* PCI */
-		entry.chip.addr = (domain << 16) + (bus << 8) + (slot << 3) + fn;
-		entry.chip.bus.type = SENSORS_BUS_TYPE_PCI;
-		entry.chip.bus.nr = 0;
 	} else {
 		/* Ignore unknown device */
 		err = 0;

lm_sensors-3.0.1-virtual-dev.patch:

--- NEW FILE lm_sensors-3.0.1-virtual-dev.patch ---
Index: lib/sysfs.c
===================================================================
--- lib/sysfs.c	(revision 5142)
+++ lib/sysfs.c	(working copy)
@@ -591,8 +591,14 @@
 
 	snprintf(linkpath, NAME_MAX, "%s/device", path);
 	dev_len = readlink(linkpath, device, NAME_MAX - 1);
-	if (dev_len < 0)
-		return -SENSORS_ERR_KERNEL;
+	if (dev_len < 0) {
+		/* virtual device without a device link (for example
+		   the acpi thermalzone driver) */
+		err = sensors_read_one_sysfs_chip(path, "virtual", path);
+		if (err < 0)
+			return err;
+		return 0;
+	}
 	device[dev_len] = '\0';
 	device_p = strrchr(device, '/') + 1;
 


Index: lm_sensors.spec
===================================================================
RCS file: /cvs/extras/rpms/lm_sensors/devel/lm_sensors.spec,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- lm_sensors.spec	12 Mar 2008 20:52:38 -0000	1.63
+++ lm_sensors.spec	16 Mar 2008 10:14:31 -0000	1.64
@@ -1,6 +1,6 @@
 Name: lm_sensors
 Version: 3.0.1
-Release: 4%{?dist}
+Release: 5%{?dist}
 URL: http://www.lm-sensors.org/
 Source: http://dl.lm-sensors.org/lm-sensors/releases/%{name}-%{version}.tar.bz2
 Source1: lm_sensors.sysconfig
@@ -10,6 +10,8 @@
 Patch0: lm_sensors-3.0.1-service-default-off.patch
 Patch1: lm_sensors-3.0.1-lsb-retcodes.patch
 Patch2: lm_sensors-3.0.1-sensors-detect-special-chips.patch
+Patch3: lm_sensors-3.0.1-virtual-dev.patch
+Patch4: lm_sensors-3.0.1-pci-without-subsys.patch
 Summary: Hardware monitoring tools
 Group: Applications/System
 License: GPLv2+
@@ -54,6 +56,8 @@
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p0
+%patch4 -p0
 mv prog/init/README prog/init/README.initscripts
 chmod -x prog/init/fancontrol.init
 
@@ -167,6 +171,10 @@
 
 
 %changelog
+* Sun Mar 16 2008 Hans de Goede <j.w.r.degoede at hhs.nl> 3.0.1-5
+- Make libsensors work with hwmon class entries without a device link
+  such as the acpi thermal_zone driver (bz 437637)
+
 * Wed Mar 12 2008 Hans de Goede <j.w.r.degoede at hhs.nl> 3.0.1-4
 - One (last) minor cosmetical fix to the initscript
 




More information about the fedora-extras-commits mailing list