aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-26 19:04:00 -0500
committerCraig Jennings <c@cjennings.net>2026-05-26 19:04:00 -0500
commit1fc5b1ff2910106c59fac3199c682f9acfcff7f2 (patch)
treef682388c0affee8587c67c03bfe3cbb863d3b356
parent376fea3c81b66df281ffb73219f5a3c82f679fea (diff)
downloadarchsetup-1fc5b1ff2910106c59fac3199c682f9acfcff7f2.tar.gz
archsetup-1fc5b1ff2910106c59fac3199c682f9acfcff7f2.zip
fix(archsetup): write the cpupower config instead of editing a missing file
A VM test caught my cpupower step failing with sed exit 2: the cpupower package no longer ships /etc/default/cpupower, so there was nothing to edit. The step was non-fatal, so the install carried on, but the governor never got set. I now write the file fresh with printf, which creates it whether or not one exists. The governor stays performance for the reasons in the surrounding comment.
-rwxr-xr-xarchsetup14
1 files changed, 8 insertions, 6 deletions
diff --git a/archsetup b/archsetup
index 88b7c2e..ce8117e 100755
--- a/archsetup
+++ b/archsetup
@@ -1232,14 +1232,16 @@ EOF
action="enabling upower service" && display "task" "$action"
systemctl enable upower >> "$logfile" 2>&1 || error_warn "$action" "$?"
- # cpupower applies a CPU frequency governor at boot. 'performance' is valid
- # under every cpufreq driver -- amd_pstate/intel_pstate active mode accept
- # only performance and powersave, while passive/acpi-cpufreq also allow
- # schedutil/ondemand. Laptops (velox) want 'powersave'; that's a per-host
- # override candidate. Non-fatal -- an unsupported governor just fails to apply.
+ # cpupower applies a CPU frequency governor at boot from /etc/default/cpupower.
+ # The cpupower package no longer ships that file, so write it fresh rather than
+ # edit it. 'performance' is valid under every cpufreq driver -- amd_pstate and
+ # intel_pstate active mode accept only performance and powersave, while
+ # passive/acpi-cpufreq also allow schedutil/ondemand. Laptops (velox) want
+ # 'powersave', a per-host override candidate. Non-fatal: an unsupported
+ # governor just fails to apply at boot.
pacman_install cpupower
action="setting cpupower governor to performance" && display "task" "$action"
- sed -i "s/^#\?governor=.*/governor='performance'/" /etc/default/cpupower >> "$logfile" 2>&1 || \
+ printf "# Set by archsetup.\ngovernor='performance'\n" > /etc/default/cpupower 2>> "$logfile" || \
error_warn "$action" "$?"
action="enabling cpupower service" && display "task" "$action"
systemctl enable cpupower.service >> "$logfile" 2>&1 || error_warn "$action" "$?"