cpufreqscaling: fix logic

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-10-20 00:36:31 +02:00
parent 6a33fe38ae
commit d0df5a9502
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ error=0
# Load the correct cpufreq module
if [ "${1}" = "ondemand" ] || [ "${1}" = "conservative" ]; then
if [ -f "/usr/lib/modules/cpufreq_${1}.ko" ]; then
modprobe cpufreq_${1}
insmod /usr/lib/modules/cpufreq_${1}.ko
echo "CPUFreqScaling: cpufreq_${1} loaded"
else
echo "CPUFreqScaling: cpufreq_${1} not found"
@ -33,7 +33,7 @@ for i in $(seq 0 ${cpucorecount}); do
echo "${1}" >/sys/devices/system/cpu/cpu${i}/cpufreq/scaling_governor
fi
done
sleep 10
sleep 5
# Check if the governor is set correctly
for i in $(seq 0 ${cpucorecount}); do
governor=$(cat /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_governor)

View File

@ -14,7 +14,7 @@ if [ "${1}" = "late" ]; then
cp -vf /usr/sbin/scaling.sh /tmpRoot/usr/sbin/scaling.sh
[ ! -f "/tmpRoot/usr/bin/echo" ] && cp -vf /usr/bin/echo /tmpRoot/usr/bin/echo || true
cp -f /usr/lib/modules/acpi_cpufreq.ko /tmpRoot/usr/lib/modules/acpi_cpufreq.ko
[ "${2}" != "schedutil" ] && cp -vf /usr/lib/modules/cpufreq_${2}.ko /tmpRoot/usr/lib/modules/cpufreq_${2}.ko && insmod cpufreq_${2} || true
[ "${2}" != "schedutil" ] && cp -vf /usr/lib/modules/cpufreq_${2}.ko /tmpRoot/usr/lib/modules/cpufreq_${2}.ko && modprobe cpufreq_${2} || true
mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/cpufreqscaling.service"
cat <<EOF >${DEST}