From: Francesco Poli (wintermute) invernomuto@paranoici.org
cpupower: split unitdir from libdir in Makefile
Improve the installation procedure for the systemd service unit 'cpupower.service', to be more flexible. Some distros install libraries to /usr/lib64/, but systemd service units have to be installed to /usr/lib/systemd/system: as a consequence, the installation procedure should not assume that systemd service units can be installed to ${libdir}/systemd/system ... Define a dedicated variable ("unitdir") in the Makefile.
Link: https://lore.kernel.org/linux-pm/260b6d79-ab61-43b7-a0eb-813e257bc028@leemhu...
Fixes: 9c70b779ad91 ("cpupower: add a systemd service to run cpupower")
Signed-off-by: Francesco Poli (wintermute) invernomuto@paranoici.org Tested-by: Thorsten Leemhuis linux@leemhuis.info
diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile index blahblah..blahblah 100644 --- a/tools/power/cpupower/Makefile +++ b/tools/power/cpupower/Makefile @@ -73,6 +73,7 @@ sbindir ?= /usr/sbin mandir ?= /usr/man libdir ?= /usr/lib libexecdir ?= /usr/libexec +unitdir ?= /usr/lib/systemd/system includedir ?= /usr/include localedir ?= /usr/share/locale docdir ?= /usr/share/doc/packages/cpupower @@ -309,9 +310,9 @@ install-tools: $(OUTPUT)cpupower $(INSTALL_DATA) cpupower-service.conf '$(DESTDIR)${confdir}' $(INSTALL) -d $(DESTDIR)${libexecdir} $(INSTALL_PROGRAM) cpupower.sh '$(DESTDIR)${libexecdir}/cpupower' - $(INSTALL) -d $(DESTDIR)${libdir}/systemd/system - sed 's|___CDIR___|${confdir}|; s|___LDIR___|${libexecdir}|' cpupower.service.in > '$(DESTDIR)${libdir}/systemd/system/cpupower.service' - $(SETPERM_DATA) '$(DESTDIR)${libdir}/systemd/system/cpupower.service' + $(INSTALL) -d $(DESTDIR)${unitdir} + sed 's|___CDIR___|${confdir}|; s|___LDIR___|${libexecdir}|' cpupower.service.in > '$(DESTDIR)${unitdir}/cpupower.service' + $(SETPERM_DATA) '$(DESTDIR)${unitdir}/cpupower.service'
install-man: $(INSTALL_DATA) -D man/cpupower.1 $(DESTDIR)${mandir}/man1/cpupower.1 @@ -348,7 +349,7 @@ uninstall: - rm -f $(DESTDIR)${bindir}/utils/cpupower - rm -f $(DESTDIR)${confdir}cpupower-service.conf - rm -f $(DESTDIR)${libexecdir}/cpupower - - rm -f $(DESTDIR)${libdir}/systemd/system/cpupower.service + - rm -f $(DESTDIR)${unitdir}/cpupower.service - rm -f $(DESTDIR)${mandir}/man1/cpupower.1 - rm -f $(DESTDIR)${mandir}/man1/cpupower-frequency-set.1 - rm -f $(DESTDIR)${mandir}/man1/cpupower-frequency-info.1
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3898
From: Andreas Gruenbacher on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3898#note_2543917...
Can a working version of this fix please be merged? Right now, this is breaking our automated upstream gfs2 testing which is based on kernel-ark:
https://ci.kronosnet.org/job/kernel-ark/job/kernel-ark-pipeline/job/os- build/1730/pipeline-overview/?start-byte=5287994&selected-node=74#log-19
``` 23:07:17 RPM build errors: 23:07:17 File not found: /srv/workspace/ark_kernel-ark-pipeline_os- build/kernel-ark/ci-test-rpms/BUILDROOT/kernel-6.16.0-0.rc0.546b1c9e93c2.10.te st.el9.x86_64/usr/include/ynl 23:07:17 absolute symlink: /lib/modules/6.16.0-0.rc0.546b1c9e93c2.10.test.el9.x86_64/build -> /usr/src/kernels/6.16.0-0.rc0.546b1c9e93c2.10.test.el9.x86_64 23:07:17 Installed (but unpackaged) file(s) found: 23:07:17 /etc/cpupower-service.conf 23:07:17 /usr/lib64/systemd/system/cpupower.service 23:07:17 /usr/libexec/cpupower ```
Thanks a lot.
From: Thorsten Leemhuis on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3898#note_2563130...
this patch has now reached mainline and thus can be dropped here afaics
kernel@lists.fedoraproject.org