cpufreqscaling: update

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-06-20 21:19:44 +02:00
parent ed887db2bb
commit 30ce161df4
2 changed files with 7 additions and 4 deletions

View File

@ -5,8 +5,8 @@ set -euo pipefail
rm -f /usr/sbin/stopscale
systemctl enable cpufreqscaling.service
systemctl start cpufreqscaling.service
#systemctl enable cpufreqscaling.service
#systemctl start cpufreqscaling.service
# Get cpu cores count minus 1, to allow maping from 0
cpucorecount=$(cat /proc/cpuinfo | grep processor | wc -l)
@ -20,6 +20,9 @@ if [ -f "/usr/lib/modules/cpufreq_${1}" ] || [ "${1}" = "schedutil" ]; then
echo "${1}" >/sys/devices/system/cpu/cpu"${i}"/cpufreq/scaling_governor
done
fi
if [ "${1}" = "ondemand" ] || [ "${1}" = "conservative" ]; then
modprobe cpufreq_${1}
fi
else
echo "No cpufreq_${1} module found"
exit 1

View File

@ -48,7 +48,7 @@ else
echo "User=root" >>${DEST}
echo "Type=oneshot" >>${DEST}
echo "RemainAfterExit=yes" >>${DEST}
echo "ExecStart=/usr/sbin/rescaler.sh \"${2}\"" >>${DEST}
echo "ExecStart=/usr/sbin/rescaler.sh ${2}" >>${DEST}
echo >>${DEST}
echo "[X-Synology]" >>${DEST}
echo "Author=Virtualization Team" >>${DEST}
@ -65,7 +65,7 @@ fi
export LD_LIBRARY_PATH=/tmpRoot/bin:/tmpRoot/lib
/tmpRoot/bin/sqlite3 /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db <<EOF
DELETE FROM task WHERE task_name LIKE 'Rescaler';
INSERT INTO task VALUES('Rescaler', '', 'bootup', '', 0, 0, 0, 0, '', 0, '/usr/sbin/rescaler.sh "${2}"', 'script', '{}', '', '', '{}', '{}');
INSERT INTO task VALUES('Rescaler', '', 'bootup', '', 0, 0, 0, 0, '', 0, '/usr/sbin/rescaler.sh ${2}', 'script', '{}', '', '', '{}', '{}');
DELETE FROM task WHERE task_name LIKE 'Unscaler';
INSERT INTO task VALUES('Unscaler', '', 'bootup', '', 0, 0, 0, 0, '', 0, '/usr/sbin/unscaler.sh', 'script', '{}', '', '', '{}', '{}');
EOF