misc: cleanup

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-06-20 17:28:56 +02:00
parent 1ac00194c1
commit 951071545a
2 changed files with 0 additions and 51 deletions

View File

@ -1,28 +0,0 @@
#!/usr/bin/env ash
#
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
PLATFORM="$(/bin/get_key_value /etc.defaults/synoinfo.conf unique | cut -d"_" -f2)"
CPUCORE=$(cat /proc/cpuinfo 2>/dev/null | grep processor | wc -l)
while true; do
CPUCORE=$((CPUCORE - 1))
if [ "${PLATFORM}" = "epyc7002" ]; then
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
fi
done

View File

@ -135,29 +135,6 @@ elif [ "${1}" = "late" ]; then
fi
umount /sys
# copy cpu governor
echo "Installing Set CPU Governor - ${1}"
cp -vf /usr/bin/governor.sh /tmpRoot/usr/bin/governor.sh
mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/governor.service"
echo "[Unit]" >${DEST}
echo "Description=Set CPU Governor" >>${DEST}
echo "DefaultDependencies=no" >>${DEST}
echo "IgnoreOnIsolate=true" >>${DEST}
echo "After=multi-user.target" >>${DEST}
echo >>${DEST}
echo "[Service]" >>${DEST}
echo "Type=oneshot" >>${DEST}
echo "RemainAfterExit=yes" >>${DEST}
echo "ExecStart=/usr/bin/governor.sh" >>${DEST}
echo >>${DEST}
echo "[X-Synology]" >>${DEST}
echo "Author=Virtualization Team" >>${DEST}
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
# crypto-kernel
if [ -f /tmpRoot/usr/lib/modules-load.d/70-crypto-kernel.conf ]; then
# crc32c-intel