Sync from SUSE:SLFO:Main sensors revision 96a5a0760c2d26e5f4e23d999eb67ff1

This commit is contained in:
Adrian Schröter 2024-05-04 00:33:11 +02:00
commit 6cb09f00a7
21 changed files with 1924 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

3
baselibs.conf Normal file
View File

@ -0,0 +1,3 @@
libsensors4
obsoletes "sensors-<targettype> <= <version>"
provides "sensors-<targettype> = <version>"

View File

@ -0,0 +1,35 @@
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

@ -0,0 +1,20 @@
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

@ -0,0 +1,20 @@
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

@ -0,0 +1,21 @@
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) Normal file

Binary file not shown.

View File

@ -0,0 +1,15 @@
---
doc/progs | 2 ++
1 file changed, 2 insertions(+)
--- a/doc/progs
+++ b/doc/progs
@@ -53,6 +53,8 @@ see http://www.lm-sensors.org/wiki/Usefu
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.
+ In SUSE Linux, this daemon is packaged separately. You have to explicitly
+ install the package named "sensord" if you want it.
* prog/sensors/sensors (written in C, installed by `make install')
This pretty-prints the information provided by the modules. It is a normal

View File

@ -0,0 +1,19 @@
---
prog/detect/sensors-detect | 6 ++++++
1 file changed, 6 insertions(+)
--- a/prog/detect/sensors-detect
+++ b/prog/detect/sensors-detect
@@ -7077,6 +7077,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';
+## Path: Hardware/Sensors
+## Description: Defines the modules to used
+## Type: string
+## ServiceRestart: lm_sensors
+## Default: ""
+#
# This file is sourced by /etc/init.d/lm_sensors and defines the modules to
# be loaded/unloaded.
#

View File

@ -0,0 +1,31 @@
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 @@
# [2] -> SUBLEVEL
# [3] -> EXTRAVERSION
#
-use vars qw($kernel_version @kernel_version $kernel_arch);
+use vars qw($kernel_version @kernel_version $kernel_flavor $kernel_arch);
sub initialize_kernel_version
{
chomp($kernel_version = `uname -r`);
$kernel_version =~ /(\d+)\.(\d+)\.(\d+)(.*)/;
@kernel_version = ($1, $2, $3, $4);
+ if ($kernel_version[3] =~ /-([a-z]+)$/) {
+ chomp($kernel_flavor = $1);
+ }
chomp($kernel_arch = `uname -m`);
# We only support kernels >= 2.6.5
@@ -7303,6 +7306,9 @@
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";
+ print "You may need to install package kernel-$kernel_flavor-extra for\n".
+ "lm-sensors to work properly.\n\n" if $kernel_flavor;
+
} else {
$hwmon_modules{$driver}++
unless hwmon_is_autoloaded($driver);

View File

@ -0,0 +1,11 @@
--- lm_sensors-3.1.1.orig/Makefile
+++ lm_sensors-3.1.1/Makefile
@@ -141,7 +141,7 @@ ifeq ($(DEBUG),1)
ALL_CPPFLAGS += -DDEBUG
ALL_CFLAGS += -O -g
else
-ALL_CFLAGS += -O2
+ALL_CFLAGS += $(RPM_OPT_FLAGS)
endif
ifeq ($(WARN),1)

View File

@ -0,0 +1,16 @@
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

@ -0,0 +1,64 @@
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

@ -0,0 +1,25 @@
From: Jean Delvare <jdelvare@suse.de>
Subject: 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
shall stay the same.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
lib/Module.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/lib/Module.mk
+++ b/lib/Module.mk
@@ -32,8 +32,8 @@ LIBMAN5FILES := $(MODULE_DIR)/sensors.co
# 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.
-LIBMAINVER := 5
-LIBMINORVER := 0.0
+LIBMAINVER := 4
+LIBMINORVER := 5.0
LIBVER := $(LIBMAINVER).$(LIBMINORVER)
# The static lib name, the shared lib name, and the internal ('so') name of

View File

@ -0,0 +1,45 @@
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

@ -0,0 +1,29 @@
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

@ -0,0 +1,27 @@
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"

1156
sensors.changes Normal file

File diff suppressed because it is too large Load Diff

265
sensors.spec Normal file
View File

@ -0,0 +1,265 @@
#
# spec file for package sensors
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
#%%define commit 1c48b191c8a2b9fc747e3db3816247c666c5c3f1
#%%define shortcommit 1c48b19
%define _name lm-sensors
%define _version 3-6-0
#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
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
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: rrdtool-devel
BuildRequires: systemd-rpm-macros
Requires: modutils
%{?systemd_requires}
%description
This package includes programs that show data from some sensor chips.
The interface /proc/bus/i2c/ is provided by loading kernel modules.
Which modules to load can be interactively detected as root by calling
%{_sbindir}/sensors-detect. Warning, before using the sensors the default
configuration in %{_sysconfdir}/sensors.conf has to be checked and changed to fit
the actual set up of the mainboard and the BIOS used on that specific
mainboard!
%package -n sensord
Summary: Hardware health monitoring daemon
License: GPL-2.0-or-later
Group: System/Monitoring
Requires(pre): %fillup_prereq
Provides: sensors:%{_sbindir}/sensord
%description -n sensord
sensord is a daemon that can be used to periodically log sensor
readings from hardware health-monitoring chips to the system logs or a
round-robin database (RRD) and to alert when a sensor alarm is
signalled; for example, if a fan fails, a temperature limit is
exceeded, etc.
%package -n libsensors4
Summary: Hardware health monitoring library
License: LGPL-2.1-or-later
Group: System/Libraries
%description -n libsensors4
libsensors offers a way for applications to access the hardware
monitoring chips of the system. A system-dependent configuration file
controls how the different inputs are labeled and what scaling factors
have to be applied for the specific hardware, so that the output makes
sense to the user.
%package -n libsensors4-devel
Summary: Hardware health monitoring library
License: LGPL-2.1-or-later
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libsensors4 = %{version}
Provides: sensors:%{_includedir}/sensors/sensors.h
%description -n libsensors4-devel
libsensors offers a way for applications to access the hardware
monitoring chips of the system. A system-dependent configuration file
controls how the different inputs are labeled and what scaling factors
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
%build
RPM_OPT_FLAGS="%{optflags}"
make %{?_smp_mflags} PROG_EXTRA:=sensord BUILD_STATIC_LIB:=0 PREFIX=%{_prefix} MANDIR=%{_mandir} LIBDIR=%{_libdir}
%install
make PROG_EXTRA:=sensord BUILD_STATIC_LIB:=0 PREFIX=%{_prefix} MANDIR=%{_mandir} LIBDIR=%{_libdir} DESTDIR=%{buildroot} install
mkdir -p %{buildroot}/%{_docdir}/sensors %{buildroot}/%{_docdir}/sensord
cp -a doc/donations doc/fan-divisors \
doc/fancontrol.txt doc/libsensors-API.txt \
doc/progs doc/temperature-sensors \
doc/vid COPYING COPYING.LGPL %{buildroot}/%{_docdir}/sensors/
cp -a COPYING %{buildroot}/%{_docdir}/sensord/
chmod -R u+rwX,g+rX,o+rX %{buildroot}/%{_docdir}/sensors/ %{buildroot}/%{_docdir}/sensord/
chmod 0755 %{buildroot}/%{_libdir}/libsensors.so.*
mkdir -p %{buildroot}/%{_unitdir} %{buildroot}/%{_fillupdir}
cp -a prog/init/*.service %{buildroot}/%{_unitdir}/
ln -sf service %{buildroot}%{_sbindir}/rclm_sensors
ln -sf service %{buildroot}%{_sbindir}/rcfancontrol
ln -sf service %{buildroot}%{_sbindir}/rcsensord
cp -a %{SOURCE1} %{buildroot}/%{_fillupdir}
%pre
%service_add_pre lm_sensors.service fancontrol.service
%post
sh -c '
CONFIG=%{_sysconfdir}/sysconfig/lm_sensors
test -r "$CONFIG" || exit 0
unset ${!MODULE_*} $HWMON_MODULES
. "$CONFIG"
test -n "$HWMON_MODULES" && exit 0
for i in ${!MODULE_*} ; do
eval module=\$$i
if test -z "$HWMON_MODULES" ; then
HWMON_MODULES="$module"
else
HWMON_MODULES="$HWMON_MODULES $module"
fi
done
test -z "$HWMON_MODULES" && exit 0
echo >> "$CONFIG"
echo "# New configuration format generated by rpm post-install script" >> "$CONFIG"
echo "HWMON_MODULES=\"$HWMON_MODULES\"" >> "$CONFIG"
'
if test -e %{_sysconfdir}/modprobe.d/lm_sensors -a ! -e %{_sysconfdir}/modprobe.d/lm_sensors.conf ; then
mv -f %{_sysconfdir}/modprobe.d/lm_sensors %{_sysconfdir}/modprobe.d/lm_sensors.conf
fi
%service_add_post lm_sensors.service fancontrol.service
%preun
%service_del_preun fancontrol.service lm_sensors.service
%postun
%service_del_postun fancontrol.service lm_sensors.service
%pre -n sensord
%service_add_pre sensord.service
%post -n sensord
%service_add_post sensord.service
%{fillup_only -n sensord}
%preun -n sensord
%service_del_preun sensord.service
%postun -n sensord
%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
%{_sbindir}/rcfancontrol
%{_bindir}/*
%{_sbindir}/fancontrol
%ifarch i386 i486 i586 i686 x86_64
%{_sbindir}/isadump
%{_sbindir}/isaset
%endif
%{_sbindir}/pwmconfig
%{_sbindir}/sensors-detect
%dir %{_docdir}/sensors
%doc %{_docdir}/sensors/donations
%doc %{_docdir}/sensors/fan-divisors
%doc %{_docdir}/sensors/fancontrol.txt
%doc %{_docdir}/sensors/progs
%doc %{_docdir}/sensors/temperature-sensors
%doc %{_docdir}/sensors/vid
%license %{_docdir}/sensors/COPYING
%{_mandir}/man1/*.1%{?ext_man}
%{_mandir}/man8/fancontrol.8%{?ext_man}
%ifarch i386 i486 i586 i686 x86_64
%{_mandir}/man8/isadump.8%{?ext_man}
%{_mandir}/man8/isaset.8%{?ext_man}
%endif
%{_mandir}/man8/pwmconfig.8%{?ext_man}
%{_mandir}/man8/sensors-conf-convert.8%{?ext_man}
%{_mandir}/man8/sensors-detect.8%{?ext_man}
%files -n sensord
%defattr(-,root,root)
%{_unitdir}/sensord.service
%{_sbindir}/rcsensord
%{_fillupdir}/sysconfig.sensord
%{_sbindir}/sensord
%dir %{_docdir}/sensord
%license %{_docdir}/sensord/COPYING
%{_mandir}/man8/sensord.8%{?ext_man}
%files -n libsensors4
%defattr(-,root,root)
%config %{_sysconfdir}/sensors3.conf
%config %{_sysconfdir}/sensors.d/
%{_libdir}/libsensors.so.4*
%dir %{_docdir}/sensors
%license %{_docdir}/sensors/COPYING.LGPL
%{_mandir}/man5/*.5%{?ext_man}
%files -n libsensors4-devel
%defattr(-,root,root)
%{_includedir}/sensors/
%{_libdir}/libsensors.so
%dir %{_docdir}/sensors
%doc %{_docdir}/sensors/libsensors-API.txt
%{_mandir}/man3/*.3%{?ext_man}
%changelog

27
sysconfig.sensord Normal file
View File

@ -0,0 +1,27 @@
## Path: Hardware/Sensors Monitoring Daemon
## Description: Configuration for the hardware sensors monitoring daemon (sensord)
## ServiceRestart: sensord
## Type: string
## Default: "1m"
#
# Interval between scanning for alarms. Use suffix "s" for seconds, "m" for
# minutes, "h" for hours. 0 turns off scanning for alarms.
#
INTERVAL="1m"
## Type: string
## Default: "20m"
#
# Interval between logging. Use suffix "s" for seconds, "m" for minutes, "h"
# for hours. 0 turns off logging.
#
LOG_INTERVAL="20m"
## Type: string
## Default: ""
#
# Pass specific sensord(8) options when the service is started via
# systemctl.
#
SENSORD_ARGS=""

69
var-run-deprecated.patch Normal file
View File

@ -0,0 +1,69 @@
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