cpufreqscaling: remove (we don't need it anymore)

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-10-06 03:12:11 +02:00
parent 3955bf3f01
commit ebfdd3e02b
3 changed files with 0 additions and 113 deletions

View File

@ -1,49 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
# Make things safer
set -euo pipefail
# Get cpu cores count minus 1, to allow maping from 0
cpucorecount=$(cat /proc/cpuinfo | grep processor | wc -l)
cpucorecount=$((cpucorecount - 1))
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}
echo "CPUFreqScaling: cpufreq_${1} loaded"
else
echo "CPUFreqScaling: cpufreq_${1} not found"
error=1
break
fi
fi
# Deamonize the main function...
for i in $(seq 0 ${cpucorecount}); do
governor=$(cat /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_governor)
# Set correct cpufreq governor to allow frequency scaling
if [ "${governor}" != "${1}" ]; then
echo "${1}" >/sys/devices/system/cpu/cpu${i}/cpufreq/scaling_governor
fi
done
sleep 10
# 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)
if [ "${governor}" = "${1}" ]; then
echo "CPUFreqScaling: Governor set to ${1}"
else
echo "CPUFreqScaling: Failed to set governor to ${1}"
error=1
break
fi
done
[ ${error} -eq 1 ] && exit 1
exit 0

View File

@ -1,44 +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.
#
if [ "${1}" = "late" ]; then
echo "Installing cpufreqscalingscaling - ${1}"
mkdir -p "/tmpRoot/usr/arc/addons/"
cp -vf "${0}" "/tmpRoot/usr/arc/addons/"
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 && modprobe cpufreq_${2} || true
mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/cpufreqscaling.service"
cat <<EOF >${DEST}
[Unit]
Description=Enable CPU Freq scaling
Wants=smpkg-custom-install.service
After=smpkg-custom-install.service
[Service]
User=root
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/scaling.sh ${2}
[Install]
WantedBy=multi-user.target
EOF
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/cpufreqscaling.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/cpufreqscaling.service
elif [ "${1}" = "uninstall" ]; then
echo "Installing cpufreqscalingscaling - ${1}"
rm -f "/tmpRoot/usr/lib/systemd/system/multi-user.target.wants/cpufreqscaling.service"
rm -f "/tmpRoot/usr/lib/systemd/system/cpufreqscaling.service"
rm -f /tmpRoot/usr/sbin/scaling.sh
fi

View File

@ -1,20 +0,0 @@
version: 1
name: cpufreqscaling
description: "Enable CPU Freqscaling for DSM - Modify in Arc DSM Options"
system: false
beta: false
target: system
all:
install-script: "install.sh"
copy: "all"
apollolake: true
broadwell: true
broadwellnk: true
broadwellnkv2: true
broadwellntbap: true
denverton: true
geminilake: true
purley: true
v1000: true
r1000: true
epyc7002: true