Skip to content

Commit c86a55f

Browse files
Replace cpufrequtils with CPUFreq sysfs interaction
1 parent 3b73ea2 commit c86a55f

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

install.sh

100755100644
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,19 +252,26 @@ debug "Updated package list."
252252

253253
install_if_missing curl
254254
install_if_missing avahi-daemon
255-
install_if_missing cpufrequtils
256255
install_if_missing libatomic1
257256
install_if_missing v4l-utils
258257
install_if_missing sqlite3
259258
install_if_missing openjdk-17-jre-headless
260259

261-
debug "Setting cpufrequtils to performance mode"
260+
debug "Adding cpu governor service"
262261
if [[ -z $TEST ]]; then
263-
if [ -f /etc/default/cpufrequtils ]; then
264-
sed -i -e 's/^#\?GOVERNOR=.*$/GOVERNOR=performance/' /etc/default/cpufrequtils
265-
else
266-
echo 'GOVERNOR=performance' > /etc/default/cpufrequtils
267-
fi
262+
cat > /etc/systemd/system/cpu_governor.service <<EOF
263+
[Unit]
264+
Description=Service that sets the cpu frequency governor
265+
266+
[Service]
267+
Type=oneshot
268+
ExecStart=bash -c 'echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor'
269+
270+
[Install]
271+
WantedBy=multi-user.target
272+
EOF
273+
chmod 644 /etc/systemd/system/cpu_governor.service
274+
systemctl enable cpu_governor.service
268275
fi
269276

270277
if [[ "$INSTALL_NETWORK_MANAGER" == "yes" ]]; then

0 commit comments

Comments
 (0)