Skip to content

Commit

Permalink
install: Allow the kernel to tune the ondemand cpufreq driver
Browse files Browse the repository at this point in the history
The raspi-config init.d script will overwrite kernel tuning on
boot in RasPiOS. Now that these tunings are set in-kernel (with
some adjustemnts), stop this script from overwriting it.

Signed-off-by: notcarbide <luis@0k.cx>
  • Loading branch information
notcarbide committed Mar 22, 2022
1 parent 7a6b97c commit 6b792db
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,21 @@ echo "Installing kernel to $BOOT_DIR & modules to $LIB_DIR..."
cp -r boot/. "$BOOT_DIR" || (echo "Failed to install in $BOOT_DIR" && exit 1)
cp -r lib/. "$LIB_DIR" || (echo "Failed to install in $LIB_DIR" && exit 1)

# comment out raspi-config ondemand tuning
if [ -f /etc/init.d/raspi-config ]; then
if [ ! -f /etc/init.d/.raspi-config ]; then
echo
echo "Backing up old raspi-config as /etc/init.d/.raspi-config..."
cp /etc/init.d/raspi-config /etc/init.d/.raspi-config
echo "To restore, run:"
echo " sudo cp /etc/init.d/.raspi-config /etc/init.d/raspi-config"
fi
echo
echo "Commenting out RasPiOS changes to ondemand cpufreq governor, if needed..."
sed -i '/up_threshold/s/^#*/#/' /etc/init.d/raspi-config
sed -i '/sampling_rate/s/^#*/#/' /etc/init.d/raspi-config
sed -i '/sampling_down_factor/s/^#*/#/' /etc/init.d/raspi-config
fi

echo
echo "Installation successful. Reboot for changes to take effect."

0 comments on commit 6b792db

Please sign in to comment.