From 6b792dbe234cb3c3cf3244d7e1cf6eb4d184b8fd Mon Sep 17 00:00:00 2001 From: notcarbide Date: Sun, 21 Nov 2021 03:40:25 -0500 Subject: [PATCH] install: Allow the kernel to tune the ondemand cpufreq driver 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 --- install.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/install.sh b/install.sh index f8f069fdca39f..4da8f29761642 100755 --- a/install.sh +++ b/install.sh @@ -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."