From 95478c9275697c1487014592c0da4413f7d23c7eb349262b932f25e1abb2f4d9 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Tue, 30 Nov 2010 14:47:02 +0000 Subject: [PATCH 1/2] Updating link to change in openSUSE:Factory/sensors revision 62.0 OBS-URL: https://build.opensuse.org/package/show/Base:System/sensors?expand=0&rev=dd96953bb04b00e38c38a34dd797ee12 --- sensors.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sensors.spec b/sensors.spec index 7b2219d..474da5e 100644 --- a/sensors.spec +++ b/sensors.spec @@ -22,7 +22,7 @@ Name: sensors BuildRequires: bison flex rrdtool-devel Url: http://www.lm-sensors.org/ Version: 3.2.0 -Release: 2 +Release: 3 Summary: Hardware health monitoring for Linux License: GPLv2+ Group: System/Monitoring @@ -36,7 +36,7 @@ Patch2: lm_sensors-3.0.0-sensord-separate.patch Patch3: lm_sensors-3.0.0-sysconfig_metadata.patch Patch4: lm_sensors-3.0.3-hint-at-kernel-extra-package.patch Patch5: lm_sensors-3.1.1-no-ipmisensors-driver.patch -Patch6: libsensors-visibility.patch +Patch6: libsensors-visibility.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build ExcludeArch: s390 s390x @@ -140,6 +140,7 @@ Authors: %patch4 -p1 %patch5 -p1 %patch6 + %build RPM_OPT_FLAGS="$RPM_OPT_FLAGS" make %{?_smp_mflags} PROG_EXTRA:=sensord BUILD_STATIC_LIB:=0 PREFIX=%{_prefix} MANDIR=%{_mandir} LIBDIR=%{_libdir} @@ -160,6 +161,7 @@ make %{?_smp_mflags} PROG_EXTRA:=sensord BUILD_STATIC_LIB:=0 PREFIX=%{_prefix} M mkdir -p $RPM_BUILD_ROOT/etc/init.d install -m 0755 %{S:1} $RPM_BUILD_ROOT/etc/init.d/lm_sensors ln -sf /etc/init.d/lm_sensors $RPM_BUILD_ROOT/usr/sbin/rclm_sensors + %clean rm -rf $RPM_BUILD_ROOT From d79bae1ad3a72a1f46e7fdbae0ea8ae13a3f7335a00d7de9e7742ad5ea1bf4a0 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 19 Jan 2011 10:47:21 +0000 Subject: [PATCH 2/2] - lm_sensors-r5870-i2c-non-sequential.patch: Fix error seen in sensors-detect if i2c bus numbering is not sequential. - lm_sensors-r5883-W83667HG-B-is-supported.patch: The W83667HG-B is supported by the w83627ehf driver since kernel 2.6.36. - lm_sensors-r5886-default-config-W83627THF.patch: Add a default configuration section for the Winbond W83627THF. - lm_sensors-r5887-typo-in-sensors-conf-5.patch: Fixed typo in lib/sensors.conf.5. - lm_sensors-r5889-default-config-SCH5127.patch: Add a default configuration section for the SMSC SCH5127. - lm_sensors-r5905-fix-coretemp-detection.patch: Implement universal detection for Intel digital thermal sensors. OBS-URL: https://build.opensuse.org/package/show/Base:System/sensors?expand=0&rev=32 --- lm_sensors-r5870-i2c-non-sequential.patch | 18 +++ ...ensors-r5883-W83667HG-B-is-supported.patch | 19 +++ ...nsors-r5886-default-config-W83627THF.patch | 35 +++++ lm_sensors-r5887-typo-in-sensors-conf-5.patch | 18 +++ lm_sensors-r5889-default-config-SCH5127.patch | 30 ++++ lm_sensors-r5905-fix-coretemp-detection.patch | 137 ++++++++++++++++++ sensors.changes | 16 ++ sensors.spec | 12 ++ 8 files changed, 285 insertions(+) create mode 100644 lm_sensors-r5870-i2c-non-sequential.patch create mode 100644 lm_sensors-r5883-W83667HG-B-is-supported.patch create mode 100644 lm_sensors-r5886-default-config-W83627THF.patch create mode 100644 lm_sensors-r5887-typo-in-sensors-conf-5.patch create mode 100644 lm_sensors-r5889-default-config-SCH5127.patch create mode 100644 lm_sensors-r5905-fix-coretemp-detection.patch diff --git a/lm_sensors-r5870-i2c-non-sequential.patch b/lm_sensors-r5870-i2c-non-sequential.patch new file mode 100644 index 0000000..5876e33 --- /dev/null +++ b/lm_sensors-r5870-i2c-non-sequential.patch @@ -0,0 +1,18 @@ +Upstream changeset: r5870 +Fix error seen in sensors-detect if i2c bus numbering is not +sequential. + +--- + prog/detect/sensors-detect | 1 + + 1 file changed, 1 insertion(+) + +--- lm_sensors-3.2.0.orig/prog/detect/sensors-detect ++++ lm_sensors-3.2.0/prog/detect/sensors-detect +@@ -5933,6 +5933,7 @@ sub generate_modprobes + # the adapter drivers so that the numbers will be the same. If not, then + # we only load the adapter drivers which are useful. + foreach $adap (@i2c_adapters) { ++ next unless defined $adap; + next if $adap->{autoload}; + next if $adap->{driver} eq 'UNKNOWN'; + next if not defined $configfile and not $adap->{used}; diff --git a/lm_sensors-r5883-W83667HG-B-is-supported.patch b/lm_sensors-r5883-W83667HG-B-is-supported.patch new file mode 100644 index 0000000..eced5db --- /dev/null +++ b/lm_sensors-r5883-W83667HG-B-is-supported.patch @@ -0,0 +1,19 @@ +Upstream changeset: r5883 +The W83667HG-B is supported by the w83627ehf driver since kernel +2.6.36. + +--- + prog/detect/sensors-detect | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- lm_sensors-3.2.0.orig/prog/detect/sensors-detect ++++ lm_sensors-3.2.0/prog/detect/sensors-detect +@@ -1791,7 +1791,7 @@ use constant FEAT_SMBUS => (1 << 7); + features => FEAT_IN | FEAT_FAN | FEAT_TEMP, + }, { + name => "Nuvoton W83667HG-B Super IO Sensors", +- driver => "to-be-written", # Probably w83627ehf ++ driver => "w83627ehf", + devid => 0xB350, + devid_mask => 0xFFF0, + logdev => 0x0b, diff --git a/lm_sensors-r5886-default-config-W83627THF.patch b/lm_sensors-r5886-default-config-W83627THF.patch new file mode 100644 index 0000000..2e4492d --- /dev/null +++ b/lm_sensors-r5886-default-config-W83627THF.patch @@ -0,0 +1,35 @@ +Upstream changeset: r5886 +Add a default configuration section for the Winbond W83627THF. + +--- + etc/sensors.conf.default | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +--- lm_sensors-3.2.0.orig/etc/sensors.conf.default ++++ lm_sensors-3.2.0/etc/sensors.conf.default +@@ -266,6 +266,25 @@ chip "adm1030-*" "adm1031-*" + label temp1 "M/B Temp" + + ++chip "w83627thf-*" ++ ++ label in3 "+5V" ++ label in7 "5VSB" ++ label in8 "Vbat" ++ ++ # Internal resistors ++ compute in3 @ * (1 + 34/51), @ / (1 + 34/51) ++ compute in7 @ * (1 + 34/51), @ / (1 + 34/51) ++ ++ set in3_min 5.0 * 0.90 ++ set in3_max 5.0 * 1.10 ++ set in7_min 5.0 * 0.90 ++ set in7_max 5.0 * 1.10 ++# The battery voltage may or may not be monitored. ++# set in8_min 3.0 * 0.90 ++# set in8_max 3.0 * 1.10 ++ ++ + chip "w83627ehf-*" "w83627dhg-*" "w83667hg-*" + + label in0 "Vcore" diff --git a/lm_sensors-r5887-typo-in-sensors-conf-5.patch b/lm_sensors-r5887-typo-in-sensors-conf-5.patch new file mode 100644 index 0000000..f01cd1f --- /dev/null +++ b/lm_sensors-r5887-typo-in-sensors-conf-5.patch @@ -0,0 +1,18 @@ +Upstream changeset: r5887 +Fixed typo in lib/sensors.conf.5. + +--- + lib/sensors.conf.5 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- lm_sensors-3.2.0.orig/lib/sensors.conf.5 ++++ lm_sensors-3.2.0/lib/sensors.conf.5 +@@ -402,7 +402,7 @@ really cool before the fan stops, so tha + again immediately. + + So, in addition to tempX_max, many chips have a tempX_max_hyst +-sub-feature. Likewise, tempX_crit often comes with tempX_max_crit. ++sub-feature. Likewise, tempX_crit often comes with tempX_crit_hyst. + Example: + + .RS diff --git a/lm_sensors-r5889-default-config-SCH5127.patch b/lm_sensors-r5889-default-config-SCH5127.patch new file mode 100644 index 0000000..b49f936 --- /dev/null +++ b/lm_sensors-r5889-default-config-SCH5127.patch @@ -0,0 +1,30 @@ +Upstream changeset: r5889 +Add a default configuration section for the SMSC SCH5127. + +--- + etc/sensors.conf.default | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- lm_sensors-3.2.0.orig/etc/sensors.conf.default ++++ lm_sensors-3.2.0/etc/sensors.conf.default +@@ -402,6 +402,20 @@ chip "sch5027-*" + set in6_max 3.0 * 1.10 + + ++chip "sch5127-*" ++ ++ label in2 "+3.3V" ++ label in5 "3VSB" ++ label in6 "Vbat" ++ ++ set in2_min 3.3 * 0.90 ++ set in2_max 3.3 * 1.10 ++ set in5_min 3.3 * 0.90 ++ set in5_max 3.3 * 1.10 ++ set in6_min 3.0 * 0.90 ++ set in6_max 3.0 * 1.10 ++ ++ + chip "f71882fg-*" + + label in0 "+3.3V" diff --git a/lm_sensors-r5905-fix-coretemp-detection.patch b/lm_sensors-r5905-fix-coretemp-detection.patch new file mode 100644 index 0000000..b051805 --- /dev/null +++ b/lm_sensors-r5905-fix-coretemp-detection.patch @@ -0,0 +1,137 @@ +Upstream changeset: r5905 +Implement universal detection for Intel digital thermal sensors. This +relies on a flag returned by the cpuid instruction, as the coretemp +driver itself does since kernel 2.6.35. + +--- + prog/detect/sensors-detect | 68 +++++++++++++++++++++++++++------------------ + 1 file changed, 42 insertions(+), 26 deletions(-) + +--- lm_sensors-3.2.0.orig/prog/detect/sensors-detect ++++ lm_sensors-3.2.0/prog/detect/sensors-detect +@@ -23,7 +23,7 @@ + require 5.004; + + use strict; +-use Fcntl; ++use Fcntl qw(:DEFAULT :seek); + use File::Basename; + + # We will call modprobe, which typically lives in either /sbin, +@@ -2025,13 +2025,9 @@ use vars qw(@cpu_ids); + driver => "k10temp", + detect => \&fam11h_pci_detect, + }, { +- name => "Intel Core family thermal sensor", ++ name => "Intel digital thermal sensor", + driver => "coretemp", +- detect => sub { coretemp_detect(0); }, +- }, { +- name => "Intel Atom thermal sensor", +- driver => "coretemp", +- detect => sub { coretemp_detect(1); }, ++ detect => \&coretemp_detect, + }, { + name => "Intel AMB FB-DIMM thermal sensor", + driver => "i5k_amb", +@@ -2296,10 +2292,10 @@ sub initialize_cpu_list + while () { + if (m/^processor\s*:\s*(\d+)/) { + push @cpu, $entry if scalar keys(%{$entry}); # Previous entry +- $entry = {}; # New entry ++ $entry = { nr => $1 }; # New entry + next; + } +- if (m/^(vendor_id|cpu family|model|model name|stepping)\s*:\s*(.+)$/) { ++ if (m/^(vendor_id|cpu family|model|model name|stepping|cpuid level)\s*:\s*(.+)$/) { + my $k = $1; + my $v = $2; + $v =~ s/\s+/ /g; # Merge multiple spaces +@@ -2468,6 +2464,15 @@ sub load_module + $modules_list{$normalized} = 1; + } + ++# udev may take some time to create device nodes when loading modules ++sub udev_settle ++{ ++ if (!(-x "/sbin/udevadm" && system("/sbin/udevadm settle") == 0) ++ && !(-x "/sbin/udevsettle" && system("/sbin/udevsettle") == 0)) { ++ sleep(1); ++ } ++} ++ + sub initialize_modules_supported + { + foreach my $chip (@chip_ids) { +@@ -5757,23 +5762,33 @@ sub intel_amb_detect + return; + } + ++sub cpuid ++{ ++ my ($cpu_nr, $eax) = @_; ++ ++ sysopen(CPUID, "/dev/cpu/$cpu_nr/cpuid", O_RDONLY) or return; ++ binmode CPUID; ++ sysseek(CPUID, $eax, SEEK_SET) ++ or die "Cannot seek /dev/cpu/$cpu_nr/cpuid"; ++ sysread(CPUID, my $data, 16) ++ or die "Cannot read /dev/cpu/$cpu_nr/cpuid"; ++ close CPUID; ++ ++ return unpack("L4", $data); ++} ++ + sub coretemp_detect + { +- my $chip = shift; + my $probecpu; + + foreach $probecpu (@cpu) { + next unless $probecpu->{vendor_id} eq 'GenuineIntel' && +- $probecpu->{'cpu family'} == 6; +- return 9 if $chip == 0 && +- ($probecpu->{model} == 14 || # Pentium M DC +- $probecpu->{model} == 15 || # Core 2 DC 65nm +- $probecpu->{model} == 0x16 || # Core 2 SC 65nm +- $probecpu->{model} == 0x17 || # Penryn 45nm +- $probecpu->{model} == 0x1a || # Nehalem +- $probecpu->{model} == 0x1e); # Lynnfield +- return 9 if $chip == 1 && +- ($probecpu->{model} == 0x1c); # Atom ++ $probecpu->{'cpuid level'} >= 6; ++ ++ # Now we check for the DTS flag ++ my @regs = cpuid($probecpu->{nr}, 6); ++ return unless @regs == 4; ++ return 9 if ($regs[0] & (1 << 0)); # eax, bit 0 + } + return; + } +@@ -6137,6 +6152,12 @@ sub main + print "Some south bridges, CPUs or memory controllers contain embedded sensors.\n". + "Do you want to scan for them? This is totally safe. (YES/no): "; + unless ( =~ /^\s*n/i) { ++ # Load the cpuid driver if needed ++ unless (-e "/dev/cpu/$cpu[0]->{nr}/cpuid") { ++ load_module("cpuid"); ++ udev_settle(); ++ } ++ + $| = 1; + foreach my $entry (@cpu_ids) { + scan_cpu($entry); +@@ -6212,12 +6233,7 @@ sub main + $by_default = 1 if dmi_match('board_vendor', 'asustek', 'tyan', + 'supermicro'); + +- # udev may take some time to create the device node +- if (!(-x "/sbin/udevadm" && system("/sbin/udevadm settle") == 0) +- && !(-x "/sbin/udevsettle" && system("/sbin/udevsettle") == 0)) { +- sleep(1); +- } +- ++ udev_settle(); + for (my $dev_nr = 0; $dev_nr < @i2c_adapters; $dev_nr++) { + next unless exists $i2c_adapters[$dev_nr]; + scan_i2c_adapter($dev_nr, $by_default); diff --git a/sensors.changes b/sensors.changes index 94c6e5c..aa17418 100644 --- a/sensors.changes +++ b/sensors.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Wed Jan 19 11:44:18 CET 2011 - jdelvare@suse.de + +- lm_sensors-r5870-i2c-non-sequential.patch: Fix error seen in + sensors-detect if i2c bus numbering is not sequential. +- lm_sensors-r5883-W83667HG-B-is-supported.patch: The W83667HG-B is + supported by the w83627ehf driver since kernel 2.6.36. +- lm_sensors-r5886-default-config-W83627THF.patch: Add a default + configuration section for the Winbond W83627THF. +- lm_sensors-r5887-typo-in-sensors-conf-5.patch: Fixed typo in + lib/sensors.conf.5. +- lm_sensors-r5889-default-config-SCH5127.patch: Add a default + configuration section for the SMSC SCH5127. +- lm_sensors-r5905-fix-coretemp-detection.patch: Implement + universal detection for Intel digital thermal sensors. + ------------------------------------------------------------------- Mon Nov 29 20:47:06 UTC 2010 - cristian.rodriguez@opensuse.org diff --git a/sensors.spec b/sensors.spec index 474da5e..7ab2e53 100644 --- a/sensors.spec +++ b/sensors.spec @@ -37,6 +37,12 @@ Patch3: lm_sensors-3.0.0-sysconfig_metadata.patch Patch4: lm_sensors-3.0.3-hint-at-kernel-extra-package.patch Patch5: lm_sensors-3.1.1-no-ipmisensors-driver.patch Patch6: libsensors-visibility.patch +Patch7: lm_sensors-r5870-i2c-non-sequential.patch +Patch8: lm_sensors-r5883-W83667HG-B-is-supported.patch +Patch9: lm_sensors-r5886-default-config-W83627THF.patch +Patch10: lm_sensors-r5887-typo-in-sensors-conf-5.patch +Patch11: lm_sensors-r5889-default-config-SCH5127.patch +Patch12: lm_sensors-r5905-fix-coretemp-detection.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build ExcludeArch: s390 s390x @@ -140,6 +146,12 @@ Authors: %patch4 -p1 %patch5 -p1 %patch6 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 %build RPM_OPT_FLAGS="$RPM_OPT_FLAGS"