diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-26 19:04:00 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-26 19:04:00 -0500 |
| commit | 1fc5b1ff2910106c59fac3199c682f9acfcff7f2 (patch) | |
| tree | f682388c0affee8587c67c03bfe3cbb863d3b356 | |
| parent | 376fea3c81b66df281ffb73219f5a3c82f679fea (diff) | |
| download | archsetup-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-x | archsetup | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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" "$?" |
