cpufreqscaling: more rework

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-10-27 19:37:36 +01:00
parent e0fe3b002d
commit 7467f158e9

View File

@ -11,12 +11,13 @@ set -euo pipefail
# Load the correct cpufreq module
cerror=0
governor=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
if [ "${1}" == "ondemand" ] || [ "${1}" == "conservative" ]; then
insmod /usr/lib/modules/cpufreq_${1}.ko || cerror=1
fi
# Set correct cpufreq governor to allow frequency scaling
if [ "${governor}" != "${1}" ]; then
echo "${1}" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
echo ${1} | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
fi
sleep 10
# Check if the governor is set correctly