From 6df6b32bc0e93fa6b5db89ad6ea5044d4cb643a6 Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Tue, 26 Nov 2024 16:43:13 +0300 Subject: [PATCH] import intel-lpmd-0.0.6-1.el10 --- .gitignore | 1 + .intel-lpmd.metadata | 1 + ...Fix-compiler-above-array-bound-error.patch | 51 ++++++++ SPECS/intel-lpmd.spec | 111 ++++++++++++++++++ 4 files changed, 164 insertions(+) create mode 100644 .gitignore create mode 100644 .intel-lpmd.metadata create mode 100644 SOURCES/0001-lpmd_cpu-Fix-compiler-above-array-bound-error.patch create mode 100644 SPECS/intel-lpmd.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bafa199 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/intel-lpmd-0.0.6.tar.gz diff --git a/.intel-lpmd.metadata b/.intel-lpmd.metadata new file mode 100644 index 0000000..88d5ae1 --- /dev/null +++ b/.intel-lpmd.metadata @@ -0,0 +1 @@ +7582cf7147290d98c4b48740725381a26a51c540 SOURCES/intel-lpmd-0.0.6.tar.gz diff --git a/SOURCES/0001-lpmd_cpu-Fix-compiler-above-array-bound-error.patch b/SOURCES/0001-lpmd_cpu-Fix-compiler-above-array-bound-error.patch new file mode 100644 index 0000000..e24985d --- /dev/null +++ b/SOURCES/0001-lpmd_cpu-Fix-compiler-above-array-bound-error.patch @@ -0,0 +1,51 @@ +From 1918cd77f5f26eeb4f9288ed45072068e1b4da34 Mon Sep 17 00:00:00 2001 +From: Kate Hsuan +Date: Tue, 16 Jul 2024 11:31:00 +0800 +Subject: [PATCH] lpmd_cpu: Fix compiler above array bound error +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +n file included from /usr/include/glib-2.0/glib.h:64, + from src/lpmd.h:48, + from src/lpmd_cpu.c:52: +src/lpmd_cpu.c: In function ‘add_cpu’: +src/lpmd_cpu.c:408:66: error: array subscript 8 is above array bounds of ‘struct lpm_cpus[7]’ [-Werror=array-bounds=] + 408 | lpmd_log_debug ("\tDetected %s CPU%d\n", cpumasks[idx].name, cpu); + | ~~~~~~~~^~~~~ +src/lpmd_cpu.c:67:24: note: while referencing ‘cpumasks’ + 67 | static struct lpm_cpus cpumasks[CPUMASK_MAX] = { + | ^~~~~~~~ +cc1: all warnings being treated as errors +make[2]: *** [Makefile:686: src/intel_lpmd-lpmd_cpu.o] Error 1 +make[1]: *** [Makefile:868: all-recursive] Error 1 +make: *** [Makefile:459: all] Error 2 +--- + src/lpmd_cpu.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/src/lpmd_cpu.c b/src/lpmd_cpu.c +index 310bf65..808ae4b 100644 +--- a/src/lpmd_cpu.c ++++ b/src/lpmd_cpu.c +@@ -402,10 +402,14 @@ int add_cpu(int cpu, enum cpumask_idx idx) + if (idx & (CPUMASK_HFI | CPUMASK_HFI_SUV | CPUMASK_HFI_BANNED)) + return 0; + +- if (idx == CPUMASK_LPM_DEFAULT) ++ if (idx == CPUMASK_LPM_DEFAULT) { + lpmd_log_info ("\tDetected %s CPU%d\n", cpumasks[idx].name, cpu); +- else +- lpmd_log_debug ("\tDetected %s CPU%d\n", cpumasks[idx].name, cpu); ++ } else { ++ if (idx < CPUMASK_MAX) ++ lpmd_log_debug ("\tDetected %s CPU%d\n", cpumasks[idx].name, cpu); ++ else ++ lpmd_log_debug ("\tIncorrect CPU ID for CPU%d\n", cpu); ++ } + + return 0; + } +-- +2.45.2 + diff --git a/SPECS/intel-lpmd.spec b/SPECS/intel-lpmd.spec new file mode 100644 index 0000000..7b0dfdf --- /dev/null +++ b/SPECS/intel-lpmd.spec @@ -0,0 +1,111 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.6.5) +## RPMAUTOSPEC: autorelease, autochangelog +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 1; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} +## END: Set by rpmautospec + +%global daemon_name intel_lpmd + +Name: intel-lpmd +Version: 0.0.6 +Release: %autorelease +Summary: Intel Low Power Mode Daemon + +License: GPL-2.0-or-later +URL: https://github.com/intel/intel-lpmd +Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz + +# Fix compiler error +Patch0: 0001-lpmd_cpu-Fix-compiler-above-array-bound-error.patch + +ExclusiveArch: x86_64 + +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: gcc +BuildRequires: glib2-devel +BuildRequires: gtk-doc +BuildRequires: libnl3-devel +BuildRequires: libxml2-devel +BuildRequires: libtool +BuildRequires: systemd-devel +BuildRequires: systemd-units + +%description +Intel Low Power Model Daemon is a Linux daemon used to optimize active idle +power. It selects a set of most power efficient CPUs based on configuration +file or CPU topology. Based on system utilization and other hints, it puts +the system into Low Power Mode by activating the power efficient CPUs and +disabling the rest, and restoring the system from Low Power Mode by activating +all CPUs. + +%prep +%autosetup -p1 + +# fedora path fix +sed -i -e "s|etc|usr/share|" configure.ac + +%build +aclocal --install +gtkdocize --copy --flavour no-tmpl +autoreconf --install --verbose +%configure +%make_build + +%install +%make_install +install -D -p -m 644 src/%{daemon_name}_dbus_interface.xml %{buildroot}/%{_datadir}/dbus-1/interfaces/org.freedesktop.%{daemon_name}.xml + +%post +%systemd_post %{daemon_name}.service + +%preun +%systemd_preun %{daemon_name}.service + +%postun +%systemd_postun_with_restart %{daemon_name}.service + +%files +%license COPYING +%doc README.md +%{_bindir}/%{daemon_name}_control +%{_sbindir}/%{daemon_name} +%dir %{_sysconfdir}/%{daemon_name} +%config(noreplace) %{_sysconfdir}/%{daemon_name}/%{daemon_name}_config.xml +%{_datadir}/dbus-1/interfaces/org.freedesktop.%{daemon_name}.xml +%{_datadir}/dbus-1/system.d/org.freedesktop.%{daemon_name}.conf +%{_datadir}/dbus-1/system-services/org.freedesktop.%{daemon_name}.service +%{_unitdir}/%{daemon_name}.service +%{_mandir}/man5/%{daemon_name}_config.xml.5* +%{_mandir}/man8/%{daemon_name}.8* + +%changelog +## START: Generated by rpmautospec +* Tue Jul 16 2024 Kate Hsuan - 0.0.6-1 +- Update to release 0.0.6 + +* Mon Jun 24 2024 Troy Dawson - 0.0.3-4 +- Bump release for June 2024 mass rebuild + +* Fri Jun 07 2024 Kate Hsuan - 0.0.3-3 +- Add gating.yaml + +* Fri Jun 07 2024 Kate Hsuan - 0.0.3-2 +- Deprecate dbus-glib + +* Fri Feb 09 2024 Ali Erdinc Koroglu - 0.0.3-1 +- Update to 0.0.3 + +* Wed Jan 24 2024 Fedora Release Engineering - 0.0.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sat Jan 20 2024 Fedora Release Engineering - 0.0.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Dec 15 2023 Ali Erdinc Koroglu - 0.0.2-1 +- 1st release +## END: Generated by rpmautospec