cpufreqscaling: more rework

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-10-20 00:54:39 +02:00
parent d0df5a9502
commit da37d00e4e
2 changed files with 5 additions and 7 deletions

View File

@ -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
insmod /usr/lib/modules/cpufreq_${1}.ko
insmod /usr/lib/modules/cpufreq_${1}.ko || true
echo "CPUFreqScaling: cpufreq_${1} loaded"
else
echo "CPUFreqScaling: cpufreq_${1} not found"

View File

@ -11,18 +11,16 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/arc/addons/"
cp -vf "${0}" "/tmpRoot/usr/arc/addons/"
cp -vf /usr/sbin/scaling.sh /tmpRoot/usr/sbin/scaling.sh
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
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"
mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/cpufreqscaling.service"
cat <<EOF >${DEST}
[Unit]
Description=Enable CPU Freq scaling
DefaultDependencies=no
IgnoreOnIsolate=true
After=multi-user.target
After=udevrules.service
[Service]