Accepting request 1139544 from home:michals

- Update to version 3.6.2:
  * sensor quantitiy and units
  * new json format
  * SENSORS_SYSFS_ROOT environment variable
  * service files updated
- Drop upstreamed patches
  * harden_fancontrol.service.patch
  * harden_lm_sensors.service.patch
  * harden_sensord.service.patch
  * lm_sensors-3.4.0-sensord-service-extra-args.patch
  * var-run-deprecated.patch
  * rrd-drop-useless-cast.patch
  * pwmconfig-raise-fan-threshold.patch
  * sysfs-Expand-filename-buffer-to-quiet-warning.patch
- Run tests

- Update to version 3.6.1:
  * configs: Added a number of new configuration files
  * fancontrol: Add executable commands as temp sensors
  * pwmconfig, fancontrol: Allow read-only pwm*_enable
  * sensors: Handle json trailing ',' when no features are listed
           Add support for rated values
           Only do conversion to Fahrenheit on temperatures
  * sensors-detect: Add support for NCT6687D
                  Add support for AMD CPU Family 19h
                  Add support for FTS Teutates Chip
                  Fix the driver for Nuvoton W83677HG-I
  * sensord: Add support of emergency alarm
           Change PIDFile path from /var/run to /run
  * Allow subfeatures to be ignored too

OBS-URL: https://build.opensuse.org/request/show/1139544
OBS-URL: https://build.opensuse.org/package/show/Base:System/sensors?expand=0&rev=123
This commit is contained in:
Marcus Meissner 2024-01-29 12:37:41 +00:00 committed by Git OBS Bridge
parent 3a247886bd
commit 2305724167
19 changed files with 143 additions and 406 deletions

View File

@ -1,35 +0,0 @@
From: puneetse <22071208+puneetse@users.noreply.github.com>
Date: Wed, 11 Mar 2020 09:36:51 -0700
Subject: Change PIDFile path from /var/run to /run
Git-commit: 25f4f8793730ef3d170f1f2bd729a82fd61a4784
Patch-mainline: Yes
References: bsc#1185183
/var/run is considered a legacy directory by systemd 239+ and having it in unit files causes a warning to be emitted to the journal.
---
prog/init/fancontrol.service | 2 +-
prog/init/sensord.service | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/prog/init/fancontrol.service
+++ b/prog/init/fancontrol.service
@@ -5,7 +5,7 @@ After=lm_sensors.service
[Service]
Type=simple
-PIDFile=/var/run/fancontrol.pid
+PIDFile=/run/fancontrol.pid
ExecStart=/usr/sbin/fancontrol
[Install]
--- a/prog/init/sensord.service
+++ b/prog/init/sensord.service
@@ -5,7 +5,7 @@ After=lm_sensors.service
[Service]
EnvironmentFile=/etc/sysconfig/sensord
Type=forking
-PIDFile=/var/run/sensord.pid
+PIDFile=/run/sensord.pid
ExecStart=/usr/sbin/sensord -i $INTERVAL -l $LOG_INTERVAL -f daemon $SENSORD_ARGS
[Install]

View File

@ -1,20 +0,0 @@
Index: lm-sensors-3-6-0/prog/init/fancontrol.service
===================================================================
--- lm-sensors-3-6-0.orig/prog/init/fancontrol.service
+++ lm-sensors-3-6-0/prog/init/fancontrol.service
@@ -4,6 +4,15 @@ ConditionFileNotEmpty=/etc/fancontrol
After=lm_sensors.service
[Service]
+# added automatically, for details please see
+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
+ProtectSystem=full
+ProtectHome=true
+ProtectHostname=true
+ProtectKernelLogs=true
+ProtectControlGroups=true
+RestrictRealtime=true
+# end of automatic additions
Type=simple
PIDFile=/run/fancontrol.pid
ExecStart=/usr/sbin/fancontrol

View File

@ -1,20 +0,0 @@
Index: lm-sensors-3-6-0/prog/init/lm_sensors.service
===================================================================
--- lm-sensors-3-6-0.orig/prog/init/lm_sensors.service
+++ lm-sensors-3-6-0/prog/init/lm_sensors.service
@@ -2,6 +2,15 @@
Description=Initialize hardware monitoring sensors
[Service]
+# added automatically, for details please see
+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
+ProtectSystem=full
+ProtectHome=true
+ProtectHostname=true
+ProtectKernelLogs=true
+ProtectControlGroups=true
+RestrictRealtime=true
+# end of automatic additions
EnvironmentFile=/etc/sysconfig/lm_sensors
Type=oneshot
RemainAfterExit=yes

View File

@ -1,21 +0,0 @@
Index: lm-sensors-3-6-0/prog/init/sensord.service
===================================================================
--- lm-sensors-3-6-0.orig/prog/init/sensord.service
+++ lm-sensors-3-6-0/prog/init/sensord.service
@@ -3,6 +3,16 @@ Description=Log hardware monitoring data
After=lm_sensors.service
[Service]
+# added automatically, for details please see
+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
+ProtectSystem=full
+ProtectHome=true
+ProtectHostname=true
+ProtectKernelTunables=true
+ProtectKernelLogs=true
+ProtectControlGroups=true
+RestrictRealtime=true
+# end of automatic additions
EnvironmentFile=/etc/sysconfig/sensord
Type=forking
PIDFile=/run/sensord.pid

BIN
lm-sensors-3-6-0.tar.gz (Stored with Git LFS)

Binary file not shown.

3
lm-sensors-3-6-2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c6a0587e565778a40d88891928bf8943f27d353f382d5b745a997d635978a8f0
size 292327

View File

@ -1,10 +1,17 @@
From d68c760c8065ba542391c30863b5543d703e5b1b Mon Sep 17 00:00:00 2001
From: "jdelvare@suse.de" <jdelvare@suse.de>
Date: Mon, 26 Nov 2007 13:34:08 +0100
Subject: [PATCH 02/11] lm_sensors-3.0.0-sensord-separate
---
doc/progs | 2 ++
doc/progs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/doc/progs b/doc/progs
index 0c5464df..63f6e260 100644
--- a/doc/progs
+++ b/doc/progs
@@ -53,6 +53,8 @@ see http://www.lm-sensors.org/wiki/Usefu
@@ -56,6 +56,8 @@ see https://github.com/lm-sensors/lm-sensors/
the sensors hardware to syslog, and to alert (using syslog level ALERT)
when a sensor alarm is signalled; for example, if a fan fails, a temperature
limit is exceeded, etc.
@ -13,3 +20,6 @@
* prog/sensors/sensors (written in C, installed by `make install')
This pretty-prints the information provided by the modules. It is a normal
--
2.43.0

View File

@ -1,10 +1,17 @@
From 4a0a238e350c31a328f6c473b35a19a1fbaa6138 Mon Sep 17 00:00:00 2001
From: "jdelvare@suse.de" <jdelvare@suse.de>
Date: Mon, 26 Nov 2007 13:34:08 +0100
Subject: [PATCH 03/11] lm_sensors-3.0.0-sysconfig_metadata
---
prog/detect/sensors-detect | 6 ++++++
prog/detect/sensors-detect | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect
index 2018cc70..fed2b3b6 100755
--- a/prog/detect/sensors-detect
+++ b/prog/detect/sensors-detect
@@ -7077,6 +7077,12 @@ sub write_config
@@ -7444,6 +7444,12 @@ sub write_config
or die "Sorry, can't create /etc/sysconfig/lm_sensors ($!)";
print SYSCONFIG "# Generated by sensors-detect on " . scalar localtime() . "\n";
print SYSCONFIG <<'EOT';
@ -17,3 +24,6 @@
# This file is sourced by /etc/init.d/lm_sensors and defines the modules to
# be loaded/unloaded.
#
--
2.43.0

View File

@ -1,7 +1,17 @@
diff -Naur a/prog/detect/sensors-detect b/prog/detect/sensors-detect
--- a/prog/detect/sensors-detect 2018-11-23 19:04:09.562152712 -0600
+++ b/prog/detect/sensors-detect 2018-11-23 19:08:21.037599155 -0600
@@ -3051,13 +3051,16 @@
From c4b5b7114a43b771331a68317c46644aef42ebb5 Mon Sep 17 00:00:00 2001
From: "jdelvare@suse.de" <jdelvare@suse.de>
Date: Tue, 14 Oct 2008 14:34:53 +0200
Subject: [PATCH 04/11] lm_sensors-3.0.3-hint-at-kernel-extra-package
---
prog/detect/sensors-detect | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect
index fed2b3b6..f5b890ba 100755
--- a/prog/detect/sensors-detect
+++ b/prog/detect/sensors-detect
@@ -3090,13 +3090,16 @@ sub initialize_conf
# [2] -> SUBLEVEL
# [3] -> EXTRAVERSION
#
@ -19,7 +29,7 @@ diff -Naur a/prog/detect/sensors-detect b/prog/detect/sensors-detect
chomp($kernel_arch = `uname -m`);
# We only support kernels >= 2.6.5
@@ -7303,6 +7306,9 @@
@@ -7389,6 +7392,9 @@ sub generate_modprobes
print "Warning: the required module $driver is not currently installed\n".
"on your system. Check https://hwmon.wiki.kernel.org/device_support_status for\n".
"driver availability.\n\n";
@ -29,3 +39,6 @@ diff -Naur a/prog/detect/sensors-detect b/prog/detect/sensors-detect
} else {
$hwmon_modules{$driver}++
unless hwmon_is_autoloaded($driver);
--
2.43.0

View File

@ -1,6 +1,17 @@
--- lm_sensors-3.1.1.orig/Makefile
+++ lm_sensors-3.1.1/Makefile
@@ -141,7 +141,7 @@ ifeq ($(DEBUG),1)
From 00066aab63916e9c5b8aec9f412fd30a7a040563 Mon Sep 17 00:00:00 2001
From: "jdelvare@suse.de" <jdelvare@suse.de>
Date: Mon, 20 Jul 2009 09:59:32 +0200
Subject: [PATCH 01/11] lm_sensors-3.1.1-build
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index f1e72258..c2e0615a 100644
--- a/Makefile
+++ b/Makefile
@@ -152,7 +152,7 @@ ifeq ($(DEBUG),1)
ALL_CPPFLAGS += -DDEBUG
ALL_CFLAGS += -O -g
else
@ -9,3 +20,6 @@
endif
ifeq ($(WARN),1)
--
2.43.0

View File

@ -1,16 +0,0 @@
Allow passing arbitrary extra arguments to sensord.
---
prog/init/sensord.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/prog/init/sensord.service
+++ b/prog/init/sensord.service
@@ -6,7 +6,7 @@ After=lm_sensors.service
EnvironmentFile=/etc/sysconfig/sensord
Type=forking
PIDFile=/var/run/sensord.pid
-ExecStart=/usr/sbin/sensord -i $INTERVAL -l $LOG_INTERVAL -f daemon
+ExecStart=/usr/sbin/sensord -i $INTERVAL -l $LOG_INTERVAL -f daemon $SENSORD_ARGS
[Install]
WantedBy=multi-user.target

View File

@ -1,64 +0,0 @@
From 6693f6f6aaa098955f70049d0f63ff5eab354c31 Mon Sep 17 00:00:00 2001
From: Ruediger Meier <ruediger.meier@ga-group.nl>
Date: Fri, 2 Sep 2016 12:38:20 +0200
Subject: [PATCH] sensors-detect: add ftsteutates support
ftsteutates is a kernel module by Fujitsu for recent Skylake Fujitsu
boards, see
ftp://ftp.ts.fujitsu.com/pub/Mainboard-OEM-Sales/Services/Software&Tools/Linux_SystemMonitoring&Watchdog&GPIO/
ftsteutates-module_20160601.zip
Fujitsu_mainboards-1-Sensors_HowTo-en-US.pdf
This patch was taken from ftsteutates-module_20160601.zip, (original patch
name: add-fts-teutates-to-lm-sensors-detect.patch).
I've made a minor modification to the original patch
- return if $id == 0x11; # Teutates
+ return if $id eq 0x11; # Teutates
to fix a warning "Argument "^Q" isn't numeric in numeric eq".
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
prog/detect/sensors-detect | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect
index 057cd96..7c744dd 100755
--- a/prog/detect/sensors-detect
+++ b/prog/detect/sensors-detect
@@ -1270,6 +1270,11 @@ use vars qw(@i2c_adapter_names);
i2c_addrs => [0x73],
i2c_detect => sub { fsc_detect(@_, 7); },
}, {
+ name => "FSC Teutates",
+ driver => "ftsteutates",
+ i2c_addrs => [0x73],
+ i2c_detect => sub { fts_detect(@_, 1); },
+ }, {
name => "ALi M5879",
driver => "to-be-written",
i2c_addrs => [0x2c..0x2d],
@@ -6107,6 +6112,20 @@ sub fsc_detect
return 8;
}
+# ChipID to detect: 1 = Teutates
+# Registers used:
+# 0x00: Identification (0x1X => X needs to be ID)
+sub fts_detect
+{
+ my ($file, $addr, $chip) = @_;
+ my $id;
+
+ $id = chr(i2c_smbus_read_byte_data($file, 0x00));
+
+ return if $id eq 0x11; # Teutates
+ return 2;
+}
+
# Chip to detect: 0 = LM93, 1 = LM94
# Registers used:
# 0x3E: Manufacturer ID
--
1.8.5.6

View File

@ -1,5 +1,7 @@
From f3f6488b0b15d1eea89c4312e7dc646e2b959fa5 Mon Sep 17 00:00:00 2001
From: Jean Delvare <jdelvare@suse.de>
Subject: libsensors: Undo gratuitous library version bump
Date: Sun, 16 Dec 2018 12:19:48 +0000
Subject: [PATCH 06/11] libsensors: Undo gratuitous library version bump
The new library is compatible with previous versions, it only has
added symbols, no changes nor removals. So the major version number
@ -7,12 +9,14 @@ shall stay the same.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
lib/Module.mk | 4 ++--
lib/Module.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/Module.mk b/lib/Module.mk
index ca25e7bb..fbc4114f 100644
--- a/lib/Module.mk
+++ b/lib/Module.mk
@@ -32,8 +32,8 @@ LIBMAN5FILES := $(MODULE_DIR)/sensors.co
@@ -32,8 +32,8 @@ LIBMAN5FILES := $(MODULE_DIR)/sensors.conf.5
# The library soname (major number) must be changed if and only if the interface is
# changed in a backward incompatible way. The interface is defined by
# the public header files - in this case they are error.h and sensors.h.
@ -23,3 +27,6 @@ Signed-off-by: Jean Delvare <jdelvare@suse.de>
LIBVER := $(LIBMAINVER).$(LIBMINORVER)
# The static lib name, the shared lib name, and the internal ('so') name of
--
2.43.0

View File

@ -1,45 +0,0 @@
From: Jean Delvare <jdelvare@suse.de>
Subject: sensors-detect: Fix the driver for Nuvoton W83677HG-I
Originally, support for the Nuvoton W83677HG-I and derivatives was
first added to the w83627ehf driver, so that's the driver recommended
by sensors-detect. Later, support for the same device was added to
the nct6775 driver. In kernel v5.6, support was removed from the
w83627ehf driver to get rid of the duplicate code.
So sensors-detect should now point users of this device to the
nct6775 driver. We can't do that for very old kernels though, as this
driver did not exist back then. I chose v3.10 for the cut-over, as
this is when support for the Nuvoton W83677HG-I was finalized in the
nct6775 driver, at least according to git log.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
Changes since v1:
* Enable run-time driver decision for Super-I/O devices
prog/detect/sensors-detect | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- lm-sensors.orig/prog/detect/sensors-detect 2020-05-07 14:29:34.731733274 +0200
+++ lm-sensors/prog/detect/sensors-detect 2020-05-12 11:08:07.989885399 +0200
@@ -2273,7 +2273,7 @@ use constant FEAT_SMBUS => (1 << 7);
features => FEAT_IN | FEAT_FAN | FEAT_TEMP,
}, {
name => "Nuvoton W83677HG-I (NCT5572D/NCT6771F/NCT6772F/NCT6775F) Super IO Sensors",
- driver => "w83627ehf",
+ driver => sub { kernel_version_at_least(3, 10, 0) ? "nct6775" : "w83627ehf" },
devid => 0xB470,
devid_mask => 0xFFF0,
logdev => 0x0b,
@@ -4574,7 +4574,9 @@ sub scan_cpu
sub chip_special_cases
{
# Some chip to driver mappings depend on the environment
- foreach my $chip (@chip_ids) {
+ foreach my $chip (@chip_ids, @superio_ids_natsemi, @superio_ids_smsc,
+ @superio_ids_smsc_ns, @superio_ids_winbond,
+ @superio_ids_ite) {
if (ref($chip->{driver}) eq 'CODE') {
$chip->{driver} = $chip->{driver}->();
}

View File

@ -1,29 +0,0 @@
From: Jean Delvare <jdelvare@suse.de>
Subject: pwmconfig: Deal gracefully with unreadable fan inputs
References: boo#1181890
Upstream: not yet, submitted 2021-02-11 but upstream is dead
If a hwmon driver exposes an unreadable fan input, let the user know
and skip that input. Otherwise we hit syntax errors later on.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
prog/pwm/pwmconfig | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- lm-sensors.orig/prog/pwm/pwmconfig 2020-05-07 14:29:34.731733274 +0200
+++ lm-sensors/prog/pwm/pwmconfig 2021-02-11 11:31:40.636126815 +0100
@@ -283,8 +283,11 @@ sleep $DELAY
echo 'Found the following fan sensors:'
for i in $FAN
do
- S=$(cat $i)
- if [ "$S" = "0" -o "$S" = "-1" ]
+ S=$(cat $i 2> /dev/null)
+ if [ $? -ne 0 ]
+ then
+ echo " $i current speed: can't read ... skipping!"
+ elif [ "$S" = "0" -o "$S" = "-1" ]
then
echo " $i current speed: 0 ... skipping!"
else

View File

@ -1,27 +0,0 @@
From: Jean Delvare <jdelvare@suse.de>
Subject: pwmconfig: Further raise the fan threshold
References: boo#1181890
Upstream: not yet, submitted 2021-02-11 but upstream is dead
Modern 4-pin fans can have a minimum speed (PWM=0) which is still
relatively high. I've seen 4500 RPM fans lower their speed to only
3500 RPM, which is 77% of the maximum speed, above our current
detection threshold (3/4 or 75%). Increase the threshold to 5/6
(roughly 83%) to make sure such fans are handled properly.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
prog/pwm/pwmconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- lm-sensors.orig/prog/pwm/pwmconfig 2021-02-11 11:31:40.636126815 +0100
+++ lm-sensors/prog/pwm/pwmconfig 2021-02-11 15:30:12.831007617 +0100
@@ -455,7 +455,7 @@ do
OS=$(echo $SPEEDS | cut -d' ' -f$count)
S=$(echo $CURRENT_SPEEDS | cut -d' ' -f$count)
echo " $j ... speed was $OS now $S"
- let threshold=3*$OS/4
+ let threshold=5*$OS/6
if [ $S -lt $threshold ]
then
echo " It appears that fan $j"

View File

@ -1,3 +1,61 @@
-------------------------------------------------------------------
Sat Jan 13 16:09:14 UTC 2024 - Michal Suchanek <msuchanek@suse.com>
- Update to version 3.6.2:
* sensor quantitiy and units
* new json format
* SENSORS_SYSFS_ROOT environment variable
* service files updated
- Drop upstreamed patches
* harden_fancontrol.service.patch
* harden_lm_sensors.service.patch
* harden_sensord.service.patch
* lm_sensors-3.4.0-sensord-service-extra-args.patch
* var-run-deprecated.patch
* rrd-drop-useless-cast.patch
* pwmconfig-raise-fan-threshold.patch
* sysfs-Expand-filename-buffer-to-quiet-warning.patch
- Run tests
-------------------------------------------------------------------
Mon Dec 25 17:51:48 UTC 2023 - Michal Suchanek <msuchanek@suse.com>
- Update to version 3.6.1:
* configs: Added a number of new configuration files
* fancontrol: Add executable commands as temp sensors
* pwmconfig, fancontrol: Allow read-only pwm*_enable
* sensors: Handle json trailing ',' when no features are listed
Add support for rated values
Only do conversion to Fahrenheit on temperatures
* sensors-detect: Add support for NCT6687D
Add support for AMD CPU Family 19h
Add support for FTS Teutates Chip
Fix the driver for Nuvoton W83677HG-I
* sensord: Add support of emergency alarm
Change PIDFile path from /var/run to /run
* Allow subfeatures to be ignored too
* Flag allow-no-sensors added
* Add support for dev_name formatted like "a000000.wifi"
* Add ZSH completion for sensors and sensors-detect
* Add ISA ACPI sensor driver name support
* Add support for static only build
* Add SDIO attached sensor support
* Add PWM and frequency sensor support
- Drop trailing space from hardedning patches
* harden_fancontrol.service.patch
* harden_lm_sensors.service.patch
* harden_sensord.service.patch
- Refresh
* lm_sensors-3.4.0-sensord-service-extra-args.patch
* var-run-deprecated.patch
- Add rrd-drop-useless-cast.patch
- Drop usptreamed patches
* change-pidfile-path-from-var-run-to-run.patch
* lm_sensors-3.4.0-sensors-detect-add-ftsteutates-support.patch
* lm_sensors-3.6.0-sensors-detect-fix-driver-for-w83677hgi.patch
* pwmconfig-handle-fan-input-error.patch
- Drop obsolete spec file constructs, use autopatch.
-------------------------------------------------------------------
Mon Dec 13 16:22:02 UTC 2021 - Johannes Segitz <jsegitz@suse.com>
@ -590,6 +648,7 @@ Mon Jul 20 09:59:32 CEST 2009 - jdelvare@suse.de
* Completely reworked sensors-detect
* Support for multiple configuration files
* New default sensors.conf file
* add lm_sensors-3.1.1-build.patch
- Include our own init script instead of patching upstream's to no
end.
- Fix init script Provides (lm_sensors instead of sensors.)
@ -743,6 +802,7 @@ Mon Nov 26 13:34:08 CET 2007 - jdelvare@suse.de
device-specific code)
* libsensors has a new SONAME (libsensors.so.4)
* fancontrol.pl is gone
* Add lm_sensors-3.0.0-sensord-separate.patch lm_sensors-3.0.0-sysconfig_metadata.patch
-------------------------------------------------------------------
Thu Nov 22 11:31:49 CET 2007 - jdelvare@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package sensors
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -19,46 +19,32 @@
#%%define commit 1c48b191c8a2b9fc747e3db3816247c666c5c3f1
#%%define shortcommit 1c48b19
%define _name lm-sensors
%define _version 3-6-0
%define _version 3-6-2
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir %{_localstatedir}/adm/fillup-templates
%endif
Name: sensors
Version: 3.6.0
Version: %(echo %{_version} | tr '-' '.')
Release: 0
Summary: Hardware health monitoring for Linux
License: GPL-2.0-or-later
Group: System/Monitoring
URL: https://github.com/lm-sensors/%{_name}
Source0: https://github.com/lm-sensors/%{_name}/archive/V%{_version}.tar.gz#/%{_name}-%{_version}.tar.gz
#Source0: https://github.com/groeck/lm-sensors/archive/%%{commit}/%%{_name}-%%{shortcommit}.tar.gz
Source0: https://github.com/hramrach/%{_name}/archive/V%{_version}.tar.gz#/%{_name}-%{_version}.tar.gz
Source1: sysconfig.sensord
Source2: baselibs.conf
Patch1: lm_sensors-3.1.1-build.patch
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
Patch6: lm_sensors-3.4.0-sensord-service-extra-args.patch
#PATCH-FEATURE-UPSTREAM add ftsteutates support
Patch7: lm_sensors-3.4.0-sensors-detect-add-ftsteutates-support.patch
Patch8: lm_sensors-3.5.0-libsensors-fix-soname.patch
#PATCH-FEATURE-UPSTREAM fix w83677hgi support
Patch9: lm_sensors-3.6.0-sensors-detect-fix-driver-for-w83677hgi.patch
#PATCH-FIX-UPSTREAM Deal gracefully with unreadable fan inputs
Patch10: pwmconfig-handle-fan-input-error.patch
#PATCH-FIX-UPSTREAM Further raise the fan threshold
Patch11: pwmconfig-raise-fan-threshold.patch
#PATCH-FIX-UPSTREAM Change PIDFile path from /var/run to /run
Patch12: change-pidfile-path-from-var-run-to-run.patch
Patch13: var-run-deprecated.patch
Patch14: harden_fancontrol.service.patch
Patch15: harden_lm_sensors.service.patch
Patch16: harden_sensord.service.patch
BuildRequires: bison
BuildRequires: flex
BuildRequires: perl-Test-Cmd
BuildRequires: rrdtool-devel
BuildRequires: systemd-rpm-macros
BuildRequires: valgrind
Requires: modutils
%{?systemd_requires}
@ -113,23 +99,7 @@ have to be applied for the specific hardware, so that the output makes
sense to the user.
%prep
%setup -q -n %{_name}-%{_version}
#%%setup -q -n lm-%%{name}-%%{commit}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%autosetup -p1 -n %{_name}-%{_version}
%build
RPM_OPT_FLAGS="%{optflags}"
@ -152,6 +122,9 @@ make %{?_smp_mflags} PROG_EXTRA:=sensord BUILD_STATIC_LIB:=0 PREFIX=%{_prefix} M
ln -sf service %{buildroot}%{_sbindir}/rcsensord
cp -a %{SOURCE1} %{buildroot}/%{_fillupdir}
%check
make test
%pre
%service_add_pre lm_sensors.service fancontrol.service
@ -200,11 +173,9 @@ fi
%service_del_postun sensord.service
%post -n libsensors4 -p /sbin/ldconfig
%postun -n libsensors4 -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_unitdir}/lm_sensors.service
%{_sbindir}/rclm_sensors
%{_unitdir}/fancontrol.service
@ -234,9 +205,9 @@ fi
%{_mandir}/man8/pwmconfig.8%{?ext_man}
%{_mandir}/man8/sensors-conf-convert.8%{?ext_man}
%{_mandir}/man8/sensors-detect.8%{?ext_man}
%{_datadir}/zsh/site-functions/
%files -n sensord
%defattr(-,root,root)
%{_unitdir}/sensord.service
%{_sbindir}/rcsensord
%{_fillupdir}/sysconfig.sensord
@ -246,7 +217,6 @@ fi
%{_mandir}/man8/sensord.8%{?ext_man}
%files -n libsensors4
%defattr(-,root,root)
%config %{_sysconfdir}/sensors3.conf
%config %{_sysconfdir}/sensors.d/
%{_libdir}/libsensors.so.4*
@ -255,7 +225,6 @@ fi
%{_mandir}/man5/*.5%{?ext_man}
%files -n libsensors4-devel
%defattr(-,root,root)
%{_includedir}/sensors/
%{_libdir}/libsensors.so
%dir %{_docdir}/sensors

View File

@ -1,69 +0,0 @@
From: Jean Delvare <jdelvare@suse.de>
Subject: /var/run is deprecated
Patch-mainline: Not yet, will submit later today
References: bsc#1185183
Systemd now wants PID files in /run, not /var/run. Service files have
been updated upstream already, but not the path used by the actual
programs. Change them too so that things don't break when the
/var/run symlink is eventually dropped.
---
prog/pwm/fancontrol | 2 +-
prog/pwm/pwmconfig | 2 +-
prog/sensord/args.c | 4 ++--
prog/sensord/sensord.8 | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
--- a/prog/pwm/fancontrol
+++ b/prog/pwm/fancontrol
@@ -38,7 +38,7 @@
#
#
-PIDFILE="/var/run/fancontrol.pid"
+PIDFILE="/run/fancontrol.pid"
#DEBUG=1
MAX=255
--- a/prog/pwm/pwmconfig
+++ b/prog/pwm/pwmconfig
@@ -30,7 +30,7 @@
#
LM_VERSION='3.6.0'
-PIDFILE="/var/run/fancontrol.pid"
+PIDFILE="/run/fancontrol.pid"
if [ -f "$PIDFILE" ]
then
--- a/prog/sensord/args.c
+++ b/prog/sensord/args.c
@@ -33,7 +33,7 @@
#include "version.h"
struct sensord_arguments sensord_args = {
- .pidFile = "/var/run/sensord.pid",
+ .pidFile = "/run/sensord.pid",
.scanTime = 60,
.logTime = 30 * 60,
.rrdTime = 5 * 60,
@@ -97,7 +97,7 @@ static const char *daemonSyntax =
" -T, --rrd-no-average -- switch RRD in non-average mode\n"
" -r, --rrd-file <file> -- RRD file (default <none>)\n"
" -c, --config-file <file> -- configuration file\n"
- " -p, --pid-file <file> -- PID file (default /var/run/sensord.pid)\n"
+ " -p, --pid-file <file> -- PID file (default /run/sensord.pid)\n"
" -f, --syslog-facility <f> -- syslog facility to use (default local4)\n"
" -g, --rrd-cgi <img-dir> -- output an RRD CGI script and exit\n"
" -a, --load-average -- include load average in RRD file\n"
--- a/prog/sensord/sensord.8
+++ b/prog/sensord/sensord.8
@@ -86,7 +86,7 @@ configuration file is used.
.IP "-p, --pid-file file"
Specify what PID file to write; the default is to write the file
-`/var/run/sensord.pid'. You should always specify an absolute path
+`/run/sensord.pid'. You should always specify an absolute path
here. The file is removed when the daemon exits.
.IP "-f, --syslog-facility facility"
Specify the