From 674bf25597176a59acd79a32b447846d5a0de2aa Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 1 Jul 2008 11:12:08 +0000 Subject: [PATCH] - New upstream release 3.0.2 - This release contains various important fixes to sensors-detect, which made it unsafe to run sensors-detect on certain systems - Drop all patches (all upstreamed) --- .cvsignore | 2 +- lm_sensors-3.0.1-lsb-retcodes.patch | 116 ------------------ lm_sensors-3.0.1-pci-without-subsys.patch | 31 ----- ...s-3.0.1-sensors-detect-special-chips.patch | 23 ---- lm_sensors-3.0.1-service-default-off.patch | 36 ------ lm_sensors-3.0.1-virtual-dev.patch | 114 ----------------- lm_sensors.spec | 20 ++- sources | 2 +- 8 files changed, 10 insertions(+), 334 deletions(-) delete mode 100644 lm_sensors-3.0.1-lsb-retcodes.patch delete mode 100644 lm_sensors-3.0.1-pci-without-subsys.patch delete mode 100644 lm_sensors-3.0.1-sensors-detect-special-chips.patch delete mode 100644 lm_sensors-3.0.1-service-default-off.patch delete mode 100644 lm_sensors-3.0.1-virtual-dev.patch diff --git a/.cvsignore b/.cvsignore index 18f4cc2..47c2f28 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -lm_sensors-3.0.1.tar.bz2 +lm_sensors-3.0.2.tar.bz2 diff --git a/lm_sensors-3.0.1-lsb-retcodes.patch b/lm_sensors-3.0.1-lsb-retcodes.patch deleted file mode 100644 index 3a57950..0000000 --- a/lm_sensors-3.0.1-lsb-retcodes.patch +++ /dev/null @@ -1,116 +0,0 @@ ---- lm_sensors-3.0.1/prog/init/lm_sensors.init 2008-02-26 14:37:51.000000000 +0100 -+++ lm_sensors-3.0.1.new/prog/init/lm_sensors.init 2008-02-26 14:25:13.000000000 +0100 -@@ -28,31 +28,6 @@ - # in order as normal shell variables with the special names: - # MODULE_1, MODULE_2, MODULE_3, etc. - --if grep -q sysfs /proc/mounts; then -- WITHSYS=1 --else -- WITHSYS=0 --fi -- --if [ $WITHSYS == "0" ]; then -- # If sensors isn't supported by the kernel, try loading the module... -- [ -e /proc/sys/dev/sensors ] || /sbin/modprobe i2c-proc >/dev/null 2>&1 -- -- # Don't bother if /proc/sensors still doesn't exist, kernel doesn't have -- # support for sensors. -- [ -e /proc/sys/dev/sensors ] || exit 0 -- -- # If sensors was not already running, unload the module... -- [ -e /var/lock/subsys/lm_sensors ] || /sbin/modprobe -r i2c-proc >/dev/null 2>&1 --fi -- --CONFIG=/etc/sysconfig/lm_sensors --[ -r "$CONFIG" ] || exit 0 --grep '^MODULE_' $CONFIG >/dev/null 2>&1 || exit 0 -- --# Load config file --. "$CONFIG" -- - PSENSORS=/usr/local/bin/sensors - - if [ ! -x $PSENSORS ]; then -@@ -65,7 +40,47 @@ - RETVAL=0 - prog="lm_sensors" - -+# This functions checks if sensor support is compiled into the kernel, if -+# sensors are configured, and loads the config file -+check_sensors() { -+ if grep -q sysfs /proc/mounts; then -+ WITHSYS=1 -+ else -+ WITHSYS=0 -+ fi -+ -+ if [ $WITHSYS == "0" ]; then -+ # If sensors isn't supported by the kernel, try loading the module... -+ [ -e /proc/sys/dev/sensors ] || /sbin/modprobe i2c-proc >/dev/null 2>&1 -+ -+ # Don't bother if /proc/sensors still doesn't exist, kernel doesn't have -+ # support for sensors. -+ if ! [ -e /proc/sys/dev/sensors ]; then -+ echo -n "$1 $prog: kernel does not have sensors support" -+ echo_failure -+ echo -+ exit 5 -+ fi -+ -+ # If sensors was not already running, unload the module... -+ [ -e /var/lock/subsys/lm_sensors ] || /sbin/modprobe -r i2c-proc >/dev/null 2>&1 -+ fi -+ -+ CONFIG=/etc/sysconfig/lm_sensors -+ if ! [ -r "$CONFIG" ] || ! grep '^MODULE_' $CONFIG >/dev/null 2>&1; then -+ echo -n "$1 $prog: not configured, run sensors-detect" -+ echo_warning -+ echo -+ exit 6 -+ fi -+ -+ # Load config file -+ . "$CONFIG" -+} -+ - start() { -+ check_sensors "Starting" -+ - echo -n "Starting $prog: loading module " - - modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '` -@@ -89,6 +104,8 @@ - } - - stop() { -+ check_sensors "Stopping" -+ - echo -n "Stopping $prog: " - - modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '` -@@ -116,12 +133,14 @@ - dostatus() { - $PSENSORS - RETVAL=$? -+ if [ $RETVAL -ne 0 ]; then -+ RETVAL=3 -+ fi - } - - restart() { - stop - start -- RETVAL=$? - } - - condrestart() { -@@ -147,7 +166,7 @@ - ;; - *) - echo "Usage: $0 {start|stop|status|restart|reload|condrestart}" -- exit 1 -+ exit 3 - esac - - exit $RETVAL diff --git a/lm_sensors-3.0.1-pci-without-subsys.patch b/lm_sensors-3.0.1-pci-without-subsys.patch deleted file mode 100644 index d2d8a5c..0000000 --- a/lm_sensors-3.0.1-pci-without-subsys.patch +++ /dev/null @@ -1,31 +0,0 @@ -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; diff --git a/lm_sensors-3.0.1-sensors-detect-special-chips.patch b/lm_sensors-3.0.1-sensors-detect-special-chips.patch deleted file mode 100644 index 5413a9f..0000000 --- a/lm_sensors-3.0.1-sensors-detect-special-chips.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up lm_sensors-3.0.1/prog/detect/sensors-detect~ lm_sensors-3.0.1/prog/detect/sensors-detect ---- lm_sensors-3.0.1/prog/detect/sensors-detect~ 2008-02-11 13:59:25.000000000 +0100 -+++ lm_sensors-3.0.1/prog/detect/sensors-detect 2008-02-11 13:59:25.000000000 +0100 -@@ -5677,6 +5677,9 @@ sub main - initialize_conf; - initialize_proc_pci; - initialize_modules_list; -+ # make sure any special case chips are added to the chip_ids list before -+ # making the support modules list -+ chip_special_cases(); - initialize_modules_supported; - initialize_cpu_list(); - -@@ -5740,9 +5744,6 @@ sub main - print "\n"; - } - -- # Before looking for chips, make sure any special case chips are -- # added to the chip_ids list -- chip_special_cases(); - $i2c_addresses_to_scan = i2c_addresses_to_scan(); - - print "We are now going to do the I2C/SMBus adapter probings. Some chips may\n", diff --git a/lm_sensors-3.0.1-service-default-off.patch b/lm_sensors-3.0.1-service-default-off.patch deleted file mode 100644 index 73833d8..0000000 --- a/lm_sensors-3.0.1-service-default-off.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- lm_sensors-3.0.1/prog/init/lm_sensors.init.default-off 2007-04-27 14:34:17.000000000 +0200 -+++ lm_sensors-3.0.1/prog/init/lm_sensors.init 2008-02-26 14:55:58.000000000 +0100 -@@ -1,6 +1,6 @@ - #!/bin/sh - # --# chkconfig: 2345 26 74 -+# chkconfig: - 26 74 - # description: sensors is used for monitoring motherboard sensor values. - # config: /etc/sysconfig/lm_sensors - # ---- lm_sensors-3.0.1/prog/detect/sensors-detect.default-off 2008-01-22 13:22:47.000000000 +0100 -+++ lm_sensors-3.0.1/prog/detect/sensors-detect 2008-02-26 15:00:07.000000000 +0100 -@@ -5673,6 +5673,11 @@ sub main - exit -1; - } - -+ if (-x "/sbin/service" && -f "/etc/init.d/lm_sensors" && -+ -f "/var/lock/subsys/lm_sensors") { -+ system("/sbin/service", "lm_sensors", "stop"); -+ } -+ - initialize_kernel_version(); - initialize_conf; - initialize_proc_pci; -@@ -5943,6 +5948,11 @@ EOT - - if (-x "/sbin/insserv" && -f "/etc/init.d/lm_sensors") { - system("/sbin/insserv", "/etc/init.d/lm_sensors"); -+ } elsif (-x "/sbin/chkconfig" && -f "/etc/init.d/lm_sensors") { -+ system("/sbin/chkconfig", "lm_sensors", "on"); -+ if (-x "/sbin/service") { -+ system("/sbin/service", "lm_sensors", "start"); -+ } - } else { - print "You should now start the lm_sensors service to load the required\n". - "kernel modules.\n\n"; diff --git a/lm_sensors-3.0.1-virtual-dev.patch b/lm_sensors-3.0.1-virtual-dev.patch deleted file mode 100644 index 56eaeb1..0000000 --- a/lm_sensors-3.0.1-virtual-dev.patch +++ /dev/null @@ -1,114 +0,0 @@ -Index: lib/sensors.h -=================================================================== ---- lib/sensors.h (revision 5145) -+++ lib/sensors.h (working copy) -@@ -30,7 +30,7 @@ - when the API + ABI breaks), the third digit is incremented to track small - API additions like new flags / enum values. The second digit is for tracking - larger additions like new methods. */ --#define SENSORS_API_VERSION 0x400 -+#define SENSORS_API_VERSION 0x401 - - #define SENSORS_CHIP_NAME_PREFIX_ANY NULL - #define SENSORS_CHIP_NAME_ADDR_ANY -1 -@@ -40,6 +40,7 @@ - #define SENSORS_BUS_TYPE_ISA 1 - #define SENSORS_BUS_TYPE_PCI 2 - #define SENSORS_BUS_TYPE_SPI 3 -+#define SENSORS_BUS_TYPE_VIRT 4 - #define SENSORS_BUS_NR_ANY (-1) - #define SENSORS_BUS_NR_IGNORE (-2) - -Index: lib/access.c -=================================================================== ---- lib/access.c (revision 5145) -+++ lib/access.c (working copy) -@@ -344,6 +344,8 @@ - so we don't have any custom string to return. */ - case SENSORS_BUS_TYPE_SPI: - return "SPI adapter"; -+ case SENSORS_BUS_TYPE_VIRT: -+ return "Virtual device"; - } - - /* bus types with several instances */ -Index: lib/sysfs.c -=================================================================== ---- lib/sysfs.c (revision 5145) -+++ lib/sysfs.c (working copy) -@@ -475,6 +475,14 @@ - if (!entry.chip.path) - sensors_fatal_error(__func__, "Out of memory"); - -+ if (dev_path == NULL) { -+ /* Virtual device */ -+ entry.chip.addr = 0; -+ entry.chip.bus.type = SENSORS_BUS_TYPE_VIRT; -+ entry.chip.bus.nr = 0; -+ goto done; -+ } -+ - /* Find bus type */ - snprintf(linkpath, NAME_MAX, "%s/subsystem", dev_path); - sub_len = readlink(linkpath, subsys_path, NAME_MAX - 1); -@@ -543,6 +551,7 @@ - goto exit_free; - } - -+done: - if (sensors_read_dynamic_chip(&entry, hwmon_path) < 0) - goto exit_free; - if (!entry.subfeature) { /* No subfeature, discard chip */ -@@ -591,16 +600,20 @@ - - snprintf(linkpath, NAME_MAX, "%s/device", path); - dev_len = readlink(linkpath, device, NAME_MAX - 1); -- if (dev_len < 0) -- return -SENSORS_ERR_KERNEL; -- device[dev_len] = '\0'; -- device_p = strrchr(device, '/') + 1; -+ if (dev_len < 0) { -+ /* No device link? Treat as virtual */ -+ err = sensors_read_one_sysfs_chip(NULL, NULL, path); -+ } else { -+ device[dev_len] = '\0'; -+ device_p = strrchr(device, '/') + 1; - -- /* The attributes we want might be those of the hwmon class device, -- or those of the device itself. */ -- err = sensors_read_one_sysfs_chip(linkpath, device_p, path); -- if (err == 0) -- err = sensors_read_one_sysfs_chip(linkpath, device_p, linkpath); -+ /* The attributes we want might be those of the hwmon class -+ device, or those of the device itself. */ -+ err = sensors_read_one_sysfs_chip(linkpath, device_p, path); -+ if (err == 0) -+ err = sensors_read_one_sysfs_chip(linkpath, device_p, -+ linkpath); -+ } - if (err < 0) - return err; - return 0; -Index: lib/data.c -=================================================================== ---- lib/data.c (revision 5145) -+++ lib/data.c (working copy) -@@ -108,6 +108,8 @@ - res->bus.type = SENSORS_BUS_TYPE_PCI; - else if (!strncmp(name, "spi", dash - name)) - res->bus.type = SENSORS_BUS_TYPE_SPI; -+ else if (!strncmp(name, "virtual", dash - name)) -+ res->bus.type = SENSORS_BUS_TYPE_VIRT; - else - goto ERROR; - name = dash + 1; -@@ -168,6 +170,9 @@ - case SENSORS_BUS_TYPE_SPI: - return snprintf(str, size, "%s-spi-%hd-%x", chip->prefix, - chip->bus.nr, chip->addr); -+ case SENSORS_BUS_TYPE_VIRT: -+ return snprintf(str, size, "%s-virtual-%x", chip->prefix, -+ chip->addr); - } - - return -SENSORS_ERR_CHIP_NAME; diff --git a/lm_sensors.spec b/lm_sensors.spec index 05560c0..3222b34 100644 --- a/lm_sensors.spec +++ b/lm_sensors.spec @@ -1,17 +1,12 @@ Name: lm_sensors -Version: 3.0.1 -Release: 6%{?dist} +Version: 3.0.2 +Release: 1%{?dist} URL: http://www.lm-sensors.org/ Source: http://dl.lm-sensors.org/lm-sensors/releases/%{name}-%{version}.tar.bz2 Source1: lm_sensors.sysconfig # these 2 were taken from PLD-linux, Thanks! Source2: sensord.sysconfig Source3: sensord.init -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+ @@ -53,11 +48,6 @@ database, and warns of sensor alarms. %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p0 -%patch4 -p0 mv prog/init/README prog/init/README.initscripts chmod -x prog/init/fancontrol.init @@ -171,6 +161,12 @@ fi %changelog +* Tue Jul 1 2008 Hans de Goede 3.0.2-1 +- New upstream release 3.0.2 +- This release contains various important fixes to sensors-detect, which made + it unsafe to run sensors-detect on certain systems +- Drop all patches (all upstreamed) + * Sat Jun 14 2008 Hans de Goede 3.0.1-6 - Rebuild for new rrdtool diff --git a/sources b/sources index df00fd1..d318f32 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -dace0c6bb031bd097a46a336de60587c lm_sensors-3.0.1.tar.bz2 +5b210ba9cc01f00161c438fd618484e5 lm_sensors-3.0.2.tar.bz2