]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cpupower: do not install files to /etc/default/
authorFrancesco Poli (wintermute) <invernomuto@paranoici.org>
Tue, 13 May 2025 16:29:33 +0000 (18:29 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 13 May 2025 22:06:28 +0000 (16:06 -0600)
Improve the installation procedure for the systemd service unit
'cpupower.service', to be more distro-agnostic. Do not install the
service unit configuration file to /etc/default/ (a directory that
is used by Debian and Debian-derivatives and only rarely by other
distros).

Also, clarify the role of the configuration file in its own comments.

Link: https://lore.kernel.org/linux-pm/20250509002206.bd2519ba52035d47c3c32aa6@paranoici.org/T/#ma8a3fa80acc4036af6c754e8ecabacc55b288ad1
Link: https://lore.kernel.org/r/20250513163937.61062-5-invernomuto@paranoici.org
Fixes: 9c70b779ad91 ("cpupower: add a systemd service to run cpupower")
Signed-off-by: Francesco Poli (wintermute) <invernomuto@paranoici.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/power/cpupower/Makefile
tools/power/cpupower/README
tools/power/cpupower/cpupower-service.conf [moved from tools/power/cpupower/cpupower.default with 67% similarity]
tools/power/cpupower/cpupower.service.in

index 7cec2c30f98a97c008c78fa01d0ed44a02cff147..be8dfac140763524ab08f6aea12746bebc117a38 100644 (file)
@@ -305,8 +305,8 @@ install-tools: $(OUTPUT)cpupower
        $(INSTALL_PROGRAM) $(OUTPUT)cpupower $(DESTDIR)${bindir}
        $(INSTALL) -d $(DESTDIR)${bash_completion_dir}
        $(INSTALL_SCRIPT) cpupower-completion.sh '$(DESTDIR)${bash_completion_dir}/cpupower'
-       $(INSTALL) -d $(DESTDIR)${confdir}default
-       $(INSTALL_DATA) cpupower.default '$(DESTDIR)${confdir}default/cpupower'
+       $(INSTALL) -d $(DESTDIR)${confdir}
+       $(INSTALL_DATA) cpupower-service.conf '$(DESTDIR)${confdir}'
        $(INSTALL) -d $(DESTDIR)${libexecdir}
        $(INSTALL_PROGRAM) cpupower.sh '$(DESTDIR)${libexecdir}/cpupower'
        $(INSTALL) -d $(DESTDIR)${libdir}/systemd/system
@@ -346,7 +346,7 @@ uninstall:
        - rm -f $(DESTDIR)${includedir}/cpufreq.h
        - rm -f $(DESTDIR)${includedir}/cpuidle.h
        - rm -f $(DESTDIR)${bindir}/utils/cpupower
-       - rm -f $(DESTDIR)${confdir}default/cpupower
+       - rm -f $(DESTDIR)${confdir}cpupower-service.conf
        - rm -f $(DESTDIR)${libexecdir}/cpupower
        - rm -f $(DESTDIR)${libdir}/systemd/system/cpupower.service
        - rm -f $(DESTDIR)${mandir}/man1/cpupower.1
index 494104de154055abff578f2f7d2be8f6f5a50faa..9de449469568a6edb733bd0d69fe031aefa8bcd3 100644 (file)
@@ -195,9 +195,9 @@ command:
 
 $ sudo systemctl daemon-reload
 
-If you want to enable this systemd service, edit
-'${DESTDIR}/etc/default/cpupower' (uncommenting at least one of the options,
-depending on your preferences) and then issue the following command:
+If you want to enable this systemd service, edit '/etc/cpupower-service.conf'
+(uncommenting at least one of the options, depending on your preferences)
+and then issue the following command:
 
 $ sudo systemctl enable --now cpupower.service
 
similarity index 67%
rename from tools/power/cpupower/cpupower.default
rename to tools/power/cpupower/cpupower-service.conf
index 376ca40fe5a6a9ea1cf5f56818b4e5f46e1c0a4b..02eabe8e361425946357f2ac6a5cb84f1f1ebf30 100644 (file)
@@ -2,7 +2,11 @@
 # Copyright (C) 2012, Sébastien Luttringer
 # Copyright (C) 2024-2025, Francesco Poli <invernomuto@paranoici.org>
 
-# Default file for linux-cpupower
+# Configuration file for cpupower.service systemd service unit
+#
+# Edit this file (uncommenting at least one of the options, depending on
+# your preferences) and then enable cpupower.service, if you want cpupower
+# to run at boot with these settings.
 
 # --- CPU clock frequency ---
 
 #MIN_FREQ="2.25GHz"
 #MAX_FREQ="3GHz"
 
-# Specific frequency to be set.
+# Set a specific frequency
 # Requires userspace governor to be available.
 # If this option is set, all the previous frequency options are ignored
 #FREQ=
 
 # --- CPU policy ---
 
-# Sets a register on supported Intel processore which allows software to convey
+# Set a register on supported Intel processore which allows software to convey
 # its policy for the relative importance of performance versus energy savings to
 # the processor. See man CPUPOWER-SET(1) for additional details
 #PERF_BIAS=
index f91eaed0387208fbcf71ba2b98cddd30d04e3b5b..fbd5b8c14270515692957cc2e924483d9a586ebf 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 # Copyright (C) 2012-2020, Sébastien Luttringer
-# Copyright (C) 2024, Francesco Poli <invernomuto@paranoici.org>
+# Copyright (C) 2024-2025, Francesco Poli <invernomuto@paranoici.org>
 
 [Unit]
 Description=Apply cpupower configuration
@@ -8,7 +8,7 @@ ConditionVirtualization=!container
 
 [Service]
 Type=oneshot
-EnvironmentFile=-___CDIR___default/cpupower
+EnvironmentFile=-___CDIR___cpupower-service.conf
 ExecStart=___LDIR___/cpupower
 RemainAfterExit=yes