Skip to content

Commit a443b8d

Browse files
add zenpower3 and zenmonitor3 (#2775) (#2778)
(cherry picked from commit ee56c1c) Co-authored-by: Cappy Ishihara <[email protected]>
1 parent 5ff13a1 commit a443b8d

File tree

5 files changed

+182
-0
lines changed

5 files changed

+182
-0
lines changed

anda/system/zenmonitor3/anda.hcl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
project pkg {
2+
rpm {
3+
spec = "zenmonitor3.spec"
4+
}
5+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
msr
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
%global debug_package %{nil}
2+
%global prjname zenmonitor3
3+
%global commit ecd9bf31dd532ac53f305e10378e637cd1cc4bbe
4+
%global shortcommit %(c=%{commit}; echo ${c:0:7})
5+
6+
Name: %{prjname}
7+
Version: 2.0.0^2.git%{shortcommit}
8+
Release: 2%{?dist}
9+
Summary: GUI monitoring software for AMD Zen-based CPUs.
10+
Packager: Cappy Ishihara <[email protected]>
11+
License: MIT
12+
URL: https://gitlab.com/shdwchn10/%{prjname}
13+
Source0: https://gitlab.com/shdwchn10/%{prjname}/-/archive/%{commit}/%{prjname}-%{commit}.tar.gz
14+
Source1: modules-load.conf
15+
16+
BuildRequires: gcc
17+
BuildRequires: make
18+
BuildRequires: systemd-rpm-macros
19+
BuildRequires: sed
20+
BuildRequires: gtk3-devel
21+
22+
%description
23+
Zenmonitor3 is GTK3 monitoring software for AMD Zen-based CPUs.
24+
25+
It can monitor these values:
26+
- CPU Temperature
27+
- CPU Core (SVI2) Voltage, Current and Power
28+
- SOC (SVI2) Voltage, Current and Power
29+
- Package and Core Power (RAPL)
30+
- Core Frequency (from OS)
31+
32+
33+
%package cli
34+
Summary: CLI monitoring software for AMD Zen-based CPUs.
35+
BuildRequires: ncurses-devel
36+
37+
%description cli
38+
Zenmonitor3 is ncurses monitoring software for AMD Zen-based CPUs.
39+
40+
It can monitor these values:
41+
- CPU Temperature
42+
- CPU Core (SVI2) Voltage, Current and Power
43+
- SOC (SVI2) Voltage, Current and Power
44+
- Package and Core Power (RAPL)
45+
- Core Frequency (from OS)
46+
47+
48+
%prep
49+
%setup -q -n %{prjname}-%{commit}
50+
51+
52+
%build
53+
make %{?_smp_mflags} DESTDIR=%{buildroot} build build-cli
54+
55+
56+
%install
57+
make %{?_smp_mflags} DESTDIR=%{buildroot} PREFIX=%{_prefix} install install-cli
58+
59+
mkdir -p %{buildroot}%{_datadir}/applications/
60+
mkdir -p %{buildroot}%{_datadir}/polkit-1/actions/
61+
62+
sed -e "s|@APP_EXEC@|%{_bindir}/zenmonitor|" data/zenmonitor.desktop.in > \
63+
%{buildroot}%{_datadir}/applications/zenmonitor.desktop
64+
sed -e "s|@APP_EXEC@|%{_bindir}/zenmonitor|" data/zenmonitor-root.desktop.in > \
65+
%{buildroot}%{_prefix}/share/applications/zenmonitor-root.desktop
66+
sed -e "s|@APP_EXEC@|%{_bindir}/zenmonitor|" data/org.pkexec.zenmonitor.policy.in > \
67+
%{buildroot}%{_datadir}/polkit-1/actions/org.pkexec.zenmonitor.policy
68+
69+
install -Dpm 0644 %{S:1} %{buildroot}%{_modulesloaddir}/%{name}.conf
70+
71+
72+
%files
73+
%{_bindir}/zenmonitor
74+
%{_datadir}/applications/zenmonitor.desktop
75+
%{_datadir}/applications/zenmonitor-root.desktop
76+
%{_datadir}/polkit-1/actions/org.pkexec.zenmonitor.policy
77+
%{_modulesloaddir}/%{name}.conf
78+
79+
80+
%files cli
81+
%{_bindir}/zenmonitor-cli
82+
83+
84+
%changelog
85+
* Thu Dec 19 2024 Andrey Brusnik <[email protected]> - 2.0.0^2.gitecd9bf3-2
86+
- fix: Update broken link to mirror
87+
88+
* Tue Nov 07 2023 Andrey Brusnik <[email protected]> - 2.0.0^1.gita09f0b25d3-1
89+
- Initial package

anda/system/zenpower3/anda.hcl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
project pkg {
2+
rpm {
3+
spec = "zenpower3.spec"
4+
}
5+
}

anda/system/zenpower3/zenpower3.spec

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
%global buildforkernels akmod
2+
%global debug_package %{nil}
3+
%global prjname zenpower3
4+
5+
# There will probably not be an update script for this package, since this kernel module
6+
# is kind of dead, I will update them manually when needed.
7+
%global commit c176fdb0d5bcba6ba2aba99ea36812e40f47751f
8+
%global shortcommit %(c=%{commit}; echo ${c:0:7})
9+
10+
Name: %{prjname}
11+
Version: 0.2.0^2.git%{shortcommit}
12+
Release: 1%{?dist}
13+
Summary: AMD Ryzen SMU driver for lm_sensors, up to Zen 3
14+
Packager: Cappy Ishihara <[email protected]>
15+
16+
License: GPLv2
17+
URL: https://gitlab.com/shdwchn10/%{prjname}
18+
Source0: https://gitlab.com/shdwchn10/%{prjname}/-/archive/%{commit}/%{prjname}-%{commit}.tar.gz
19+
20+
BuildRequires: gcc
21+
BuildRequires: make
22+
BuildRequires: kmodtool
23+
24+
# kmodtool does its magic here
25+
%{expand:%(kmodtool --target %{_target_cpu} --repo %{repo} --kmodname %{prjname} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null | sed '/global with_rhel_kabi/d') }
26+
27+
%description
28+
Zenpower3 is a Linux kernel driver for reading temperature, voltage(SVI2), current(SVI2) and power(SVI2) for AMD Zen family CPUs, now with Zen 3 support!
29+
30+
This package contains the kmod module for %{prjname}.
31+
32+
33+
%prep
34+
%setup -q -n %{prjname}-%{commit}
35+
36+
# Error out if there was something wrong with kmodtool.
37+
%{?kmodtool_check}
38+
39+
# Print kmodtool output for debugging purposes:
40+
kmodtool --target %{_target_cpu} --repo %{repo} --kmodname %{prjname} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null | sed '/global with_rhel_kabi/d'
41+
42+
mkdir src
43+
cp -a Makefile zenpower.c src/
44+
45+
for kernel_version in %{?kernel_versions} ; do
46+
cp -a src _kmod_build_${kernel_version%%___*}
47+
done
48+
49+
echo %{version} > VERSION
50+
51+
52+
%build
53+
for kernel_version in %{?kernel_versions} ; do
54+
make V=1 %{?_smp_mflags} -C ${kernel_version##*___} M=${PWD}/_kmod_build_${kernel_version%%___*} modules
55+
done
56+
57+
58+
%install
59+
for kernel_version in %{?kernel_versions}; do
60+
mkdir -p %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/
61+
install -Dpm 0755 _kmod_build_${kernel_version%%___*}/*.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/
62+
chmod a+x %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/*.ko
63+
done
64+
%{?akmod_install}
65+
66+
67+
%changelog
68+
* Sun Dec 29 2024 Cappy Ishihara <[email protected]> - 0.2.0^2.gitc176fdb-1
69+
- Repackaged for Terra
70+
71+
* Mon Dec 23 2024 Andrey Brusnik <[email protected]> - 0.2.0^2.gitc176fdb-4
72+
- fix: Actually fix building with custom kernels on EL
73+
74+
* Thu Dec 19 2024 Andrey Brusnik <[email protected]> - 0.2.0^2.gitc176fdb-3
75+
- fix: Update broken link to mirror
76+
- fix: Rollback to akmod on EL so module will work with custom kernels
77+
78+
* Sat Sep 28 2024 Andrey Brusnik <[email protected]> - 0.2.0^1.gitc176fdb0d5-2
79+
- fix: Build kmod instead of akmod for EL
80+
81+
* Tue Nov 07 2023 Andrey Brusnik <[email protected]> - 0.2.0^1.gitc176fdb0d5-1
82+
- Initial package

0 commit comments

Comments
 (0)