@@ -32,7 +32,7 @@ package_is_installed(){
3232install_if_missing () {
3333 if package_is_installed " $1 " ; then
3434 debug " Found existing $1 . Skipping..."
35- # Always mark our upstream apt deps as held back, which will prevent the package
35+ # Always mark our upstream apt deps as held back, which will prevent the package
3636 # from being automatically installed, upgraded or removed
3737 if [[ -z $TEST ]]; then
3838 apt-mark manual " $1 "
@@ -43,7 +43,7 @@ install_if_missing() {
4343 debug " Installing $1 ..."
4444 if [[ -z $TEST ]]; then
4545 apt-get install --yes " $1 "
46- # Always mark our upstream apt deps as held back, which will prevent the package
46+ # Always mark our upstream apt deps as held back, which will prevent the package
4747 # from being automatically installed, upgraded or removed
4848 apt-mark manual " $1 "
4949 fi
@@ -251,19 +251,26 @@ debug "Updated package list."
251251
252252install_if_missing curl
253253install_if_missing avahi-daemon
254- install_if_missing cpufrequtils
255254install_if_missing libatomic1
256255install_if_missing v4l-utils
257256install_if_missing sqlite3
258257install_if_missing openjdk-17-jre-headless
259258
260- debug " Setting cpufrequtils to performance mode "
259+ debug " Adding cpu governor service "
261260if [[ -z $TEST ]]; then
262- if [ -f /etc/default/cpufrequtils ]; then
263- sed -i -e ' s/^#\?GOVERNOR=.*$/GOVERNOR=performance/' /etc/default/cpufrequtils
264- else
265- echo ' GOVERNOR=performance' > /etc/default/cpufrequtils
266- fi
261+ cat > /etc/systemd/system/cpu_governor.service << EOF
262+ [Unit]
263+ Description=Service that sets the cpu frequency governor
264+
265+ [Service]
266+ Type=oneshot
267+ ExecStart=bash -c 'echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor'
268+
269+ [Install]
270+ WantedBy=multi-user.target
271+ EOF
272+ chmod 644 /etc/systemd/system/cpu_governor.service
273+ systemctl enable cpu_governor.service
267274fi
268275
269276if [[ " $INSTALL_NETWORK_MANAGER " == " yes" ]]; then
@@ -291,7 +298,7 @@ if [[ "$DISTRO" = "Ubuntu" && -z $(apt-cache search libcholmod3) ]]; then
291298 if [[ -z $TEST ]]; then
292299 if [[ " $ARCH " = " x86_64" ]]; then
293300 add-apt-repository -y -S ' deb http://security.ubuntu.com/ubuntu jammy main universe'
294- else
301+ else
295302 add-apt-repository -y -S ' deb http://ports.ubuntu.com/ubuntu-ports jammy main universe'
296303 fi
297304 fi
0 commit comments