mirror of
https://github.com/AuxXxilium/arc-addons.git
synced 2024-11-23 21:50:52 +07:00
cpufreqscaling: fix logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
6a33fe38ae
commit
d0df5a9502
@ -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)
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user