misc: rework more

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-06-20 00:33:46 +02:00
parent 215aa1dc87
commit 1ac00194c1
2 changed files with 30 additions and 26 deletions

View File

@ -14,8 +14,13 @@ while true; do
echo "schedutil" >"/sys/devices/system/cpu/cpu${CPUCORE}/cpufreq/scaling_governor"
echo "set schedutil governor for ${PLATFORM} cpu: ${CPUCORE}"
else
if [ -f "/usr/lib/modules/cpufreq_ondemand" ]; then
echo "ondemand" >"/sys/devices/system/cpu/cpu${CPUCORE}/cpufreq/scaling_governor"
echo "set ondemand governor for ${PLATFORM} cpu: ${CPUCORE}"
else
echo "performance" >"/sys/devices/system/cpu/cpu${CPUCORE}/cpufreq/scaling_governor"
echo "set performance governor for ${PLATFORM} cpu: ${CPUCORE}"
fi
fi
if [ ${CPUCORE} -eq 0 ]; then
break

View File

@ -128,6 +128,12 @@ elif [ "${1}" = "late" ]; then
echo "CPU supports CPU Performance Scaling, enabling"
sed -i 's/^# acpi-cpufreq/acpi-cpufreq/g' /tmpRoot/usr/lib/modules-load.d/70-cpufreq-kernel.conf
cp -vf /usr/lib/modules/cpufreq_* /tmpRoot/usr/lib/modules/
else
echo "CPU does NOT support CPU Performance Scaling, disabling"
sed -i 's/^acpi-cpufreq/# acpi-cpufreq/g' /tmpRoot/usr/lib/modules-load.d/70-cpufreq-kernel.conf
fi
fi
umount /sys
# copy cpu governor
echo "Installing Set CPU Governor - ${1}"
@ -151,13 +157,6 @@ elif [ "${1}" = "late" ]; then
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/governor.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/governor.service
else
echo "CPU does NOT support CPU Performance Scaling, disabling"
sed -i 's/^acpi-cpufreq/# acpi-cpufreq/g' /tmpRoot/usr/lib/modules-load.d/70-cpufreq-kernel.conf
echo "CPU does NOT support CPU Performance Scaling, disabling" >/tmpRoot/usr/bin/governor.sh
fi
fi
umount /sys
# crypto-kernel
if [ -f /tmpRoot/usr/lib/modules-load.d/70-crypto-kernel.conf ]; then