Skip to content

Commit

Permalink
lm-sensors: improve packaging
Browse files Browse the repository at this point in the history
- Merge most retro/mainline scripts with ab_match_archgroup.
- Re-enable parallelism.
- Revise all sed operations into patches.
- Add a Fedora patch Fedora to add AMD CPU Family 19h support in
  sensors-detect.
- Track patches at AOSC-Tracking/lm-sensors @ aosc/V3-6-0
  (HEAD: dfd18d5f26ec39d55686af7f958d22896eab0619).
  • Loading branch information
MingcongBai committed Dec 27, 2024
1 parent 5a0b29f commit 808b42c
Show file tree
Hide file tree
Showing 18 changed files with 184 additions and 58 deletions.
1 change: 0 additions & 1 deletion app-utils/lm-sensors/autobuild/armv4

This file was deleted.

1 change: 0 additions & 1 deletion app-utils/lm-sensors/autobuild/armv6hf

This file was deleted.

1 change: 0 additions & 1 deletion app-utils/lm-sensors/autobuild/armv7hf

This file was deleted.

4 changes: 0 additions & 4 deletions app-utils/lm-sensors/autobuild/beyond

This file was deleted.

45 changes: 30 additions & 15 deletions app-utils/lm-sensors/autobuild/build
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
make PREFIX=/usr \
SBINDIR=/usr/bin \
LIBDIR=/usr/lib \
MANDIR=/usr/share/man \
CFLAGS="${CPPFLAGS} ${CFLAGS} ${LDFLAGS}" \
EXLDFLAGS="${LDFLAGS}" \
PROG_EXTRA=sensord user
make BUILD_STATIC_LIB=0 \
PREFIX=/usr \
SBINDIR=/usr/bin \
LIBDIR=/usr/lib \
MANDIR=/usr/share/man \
EXLDFLAGS="${LDFLAGS}" \
PROG_EXTRA=sensord \
DESTDIR="$PKGDIR" user_install
abinfo "Configuring make parameters ..."
MAKE_OPTS=(
"DESTDIR=$PKGDIR"
'PREFIX=/usr'
'SBINDIR=/usr/bin'
'LIBDIR=/usr/lib'
'MANDIR=/usr/share/man'
'BUILD_STATIC_LIB=0'
)
if ! ab_match_archgroup retro; then
MAKE_OPTS+=(
'PROG_EXTRA=sensord'
)
fi

abinfo "Building lm-sensors ..."
make user \
${MAKE_OPTS[@]} \
CFLAGS="${CPPFLAGS} ${CFLAGS} ${LDFLAGS}" \
EXLDFLAGS="${LDFLAGS}"

abinfo "Installing lm-sensors ..."
make user_install \
${MAKE_OPTS[@]}

if ! ab_match_archgroup retro; then
abinfo "Installing systemd units ..."
install -Dvm644 "$SRCDIR"/prog/init/*.service \
-t "$PKGDIR"/usr/lib/systemd/system/
fi
2 changes: 0 additions & 2 deletions app-utils/lm-sensors/autobuild/defines
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ PKGDEP__M68K="${PKGDEP__RETRO}"
PKGDEP__POWERPC="${PKGDEP__RETRO}"
PKGDEP__PPC64="${PKGDEP__RETRO}"
PKGDES="Collection of userspace tools for general SMBus access and hardware monitoring"

NOPARALLEL=1
1 change: 0 additions & 1 deletion app-utils/lm-sensors/autobuild/i486

This file was deleted.

1 change: 0 additions & 1 deletion app-utils/lm-sensors/autobuild/loongson2f

This file was deleted.

1 change: 0 additions & 1 deletion app-utils/lm-sensors/autobuild/m68k

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
From 3a97fa37b3c8a80fbe31c4596e4f6940aea214a3 Mon Sep 17 00:00:00 2001
From: Mingcong Bai <[email protected]>
Date: Fri, 27 Dec 2024 14:08:08 +0800
Subject: [PATCH 1/4] ARCHLINUX: use /etc/conf.d as the configuration prefix

---
prog/detect/sensors-detect | 14 +++++++-------
prog/init/lm_sensors.service | 2 +-
prog/init/sensord.service | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect
index 32fd29f3..ce06a1d6 100755
--- a/prog/detect/sensors-detect
+++ b/prog/detect/sensors-detect
@@ -7386,18 +7386,18 @@ sub write_config
}
}

- my $have_sysconfig = -d '/etc/sysconfig';
- printf "Do you want to \%s /etc/sysconfig/lm_sensors? (\%s): ",
- (-e '/etc/sysconfig/lm_sensors' ? 'overwrite' : 'generate'),
+ my $have_sysconfig = -d '/etc/conf.d';
+ printf "Do you want to \%s /etc/conf.d/lm_sensors? (\%s): ",
+ (-e '/etc/conf.d/lm_sensors' ? 'overwrite' : 'generate'),
($have_sysconfig ? 'YES/no' : 'yes/NO');
$_ = read_answer();
if (($have_sysconfig and not m/^\s*n/i) or m/^\s*y/i) {
unless ($have_sysconfig) {
- mkdir('/etc/sysconfig', 0777)
- or die "Sorry, can't create /etc/sysconfig ($!)";
+ mkdir('/etc/conf.d', 0777)
+ or die "Sorry, can't create /etc/conf.d ($!)";
}
- open(local *SYSCONFIG, ">/etc/sysconfig/lm_sensors")
- or die "Sorry, can't create /etc/sysconfig/lm_sensors ($!)";
+ open(local *SYSCONFIG, ">/etc/conf.d/lm_sensors")
+ or die "Sorry, can't create /etc/conf.d/lm_sensors ($!)";
print SYSCONFIG "# Generated by sensors-detect on " . scalar localtime() . "\n";
print SYSCONFIG <<'EOT';
# This file is sourced by /etc/init.d/lm_sensors and defines the modules to
diff --git a/prog/init/lm_sensors.service b/prog/init/lm_sensors.service
index 7d3bf808..7b012b30 100644
--- a/prog/init/lm_sensors.service
+++ b/prog/init/lm_sensors.service
@@ -2,7 +2,7 @@
Description=Initialize hardware monitoring sensors

[Service]
-EnvironmentFile=/etc/sysconfig/lm_sensors
+EnvironmentFile=/etc/conf.d/lm_sensors
Type=oneshot
RemainAfterExit=yes
ExecStart=-/sbin/modprobe -qab $BUS_MODULES $HWMON_MODULES
diff --git a/prog/init/sensord.service b/prog/init/sensord.service
index 2448beeb..176ee70a 100644
--- a/prog/init/sensord.service
+++ b/prog/init/sensord.service
@@ -3,7 +3,7 @@ Description=Log hardware monitoring data
After=lm_sensors.service

[Service]
-EnvironmentFile=/etc/sysconfig/sensord
+EnvironmentFile=/etc/conf.d/sensord
Type=forking
PIDFile=/var/run/sensord.pid
ExecStart=/usr/sbin/sensord -i $INTERVAL -l $LOG_INTERVAL -f daemon
--
2.47.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 7226828c95c04c9a320658e8894b85c76a1a89b1 Mon Sep 17 00:00:00 2001
From: Mingcong Bai <[email protected]>
Date: Fri, 27 Dec 2024 14:08:36 +0800
Subject: [PATCH 2/4] ARCHLINUX: do not throw warning if /etc/conf.d/lm_sensors
does not exist

---
prog/init/lm_sensors.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/prog/init/lm_sensors.service b/prog/init/lm_sensors.service
index 7b012b30..7aad77cd 100644
--- a/prog/init/lm_sensors.service
+++ b/prog/init/lm_sensors.service
@@ -2,7 +2,7 @@
Description=Initialize hardware monitoring sensors

[Service]
-EnvironmentFile=/etc/conf.d/lm_sensors
+EnvironmentFile=-/etc/conf.d/lm_sensors
Type=oneshot
RemainAfterExit=yes
ExecStart=-/sbin/modprobe -qab $BUS_MODULES $HWMON_MODULES
--
2.47.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From ecc2df2ada1269f842d65c8cfc3750a585ff4318 Mon Sep 17 00:00:00 2001
From: Mingcong Bai <[email protected]>
Date: Fri, 27 Dec 2024 14:08:50 +0800
Subject: [PATCH 3/4] ARCHLINUX: install sensord

---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 47ffe788..0142abb2 100644
--- a/Makefile
+++ b/Makefile
@@ -80,7 +80,7 @@ MANDIR := $(PREFIX)/man
ARCH := $(firstword $(subst -, ,$(shell $(CC) -dumpmachine)))

# Extra non-default programs to build; e.g., sensord
-#PROG_EXTRA := sensord
+PROG_EXTRA := sensord

# Build and install static library
BUILD_STATIC_LIB := 1
--
2.47.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From dfd18d5f26ec39d55686af7f958d22896eab0619 Mon Sep 17 00:00:00 2001
From: Mingcong Bai <[email protected]>
Date: Fri, 27 Dec 2024 14:24:08 +0800
Subject: [PATCH 4/4] FEDORA: sensors-detect: Add support for AMD CPU Family
19h

---
prog/detect/sensors-detect | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect
index ce06a1d6..7bd66ddd 100755
--- a/prog/detect/sensors-detect
+++ b/prog/detect/sensors-detect
@@ -2792,6 +2792,10 @@ use vars qw(@cpu_ids);
name => "AMD Family 17h thermal sensors",
driver => "k10temp",
detect => sub { amd_pci_detect('1463', '15d0', '1493', '1443') },
+ }, {
+ name => "AMD Family 19h thermal sensors",
+ driver => "k10temp",
+ detect => sub { amd_pci_detect('1653') },
}, {
name => "AMD Family 15h power sensors",
driver => "fam15h_power",
--
2.47.1

1 change: 0 additions & 1 deletion app-utils/lm-sensors/autobuild/powerpc

This file was deleted.

1 change: 0 additions & 1 deletion app-utils/lm-sensors/autobuild/ppc64

This file was deleted.

10 changes: 0 additions & 10 deletions app-utils/lm-sensors/autobuild/prepare

This file was deleted.

15 changes: 0 additions & 15 deletions app-utils/lm-sensors/autobuild/retro/build

This file was deleted.

9 changes: 5 additions & 4 deletions app-utils/lm-sensors/spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
VER=3.6.0
SRCS="tbl::https://github.com/lm-sensors/lm-sensors/archive/V${VER//./-}.tar.gz"
CHKSUMS="sha256::0591f9fa0339f0d15e75326d0365871c2d4e2ed8aa1ff759b3a55d3734b7d197"
UPSTREAM_VER=3-6-0
VER=${UPSTREAM_VER//-/.}
REL=2
SRCS="git::commit=tags/V${UPSTREAM_VER}::https://github.com/lm-sensors/lm-sensors"
CHKSUMS="SKIP"
CHKUPDATE="anitya::id=1831"
REL=1

0 comments on commit 808b42c

Please sign in to comment.