mirror of
https://github.com/AuxXxilium/arc-addons.git
synced 2024-11-23 21:50:52 +07:00
cpufreqscaling: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
4b64ba15ac
commit
d56cfe7c41
@ -22,6 +22,7 @@ if [ "${1}" = "ondemand" ] || [ "${1}" = "conservative" ]; then
|
||||
else
|
||||
echo "CPUFreqScaling: cpufreq_${1} not found"
|
||||
error=1
|
||||
break
|
||||
fi
|
||||
fi
|
||||
# Deamonize the main function...
|
||||
@ -41,7 +42,8 @@ for i in $(seq 0 ${cpucorecount}); do
|
||||
else
|
||||
echo "CPUFreqScaling: Failed to set governor to ${1}"
|
||||
error=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
[ "${error}" -eq 1 ] && exit 1
|
||||
[ ${error} -eq 1 ] && exit 1
|
||||
exit 0
|
@ -24,7 +24,7 @@ if [ "${1}" = "late" ]; then
|
||||
Description=Enable CPU Freq scaling
|
||||
DefaultDependencies=no
|
||||
IgnoreOnIsolate=true
|
||||
After=multi-user.target
|
||||
After=udevrules.service
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
@ -42,20 +42,22 @@ 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
|
||||
else
|
||||
[ "${2}" != "schedutil" ] && cp -vf /usr/lib/modules/cpufreq_${2}.ko /tmpRoot/usr/lib/modules/cpufreq_${2}.ko
|
||||
[ "${2}" != "schedutil" ] && cp -vf /usr/lib/modules/cpufreq_${2}.ko /tmpRoot/usr/lib/modules/cpufreq_${2}.ko && modprobe cpufreq_${2}
|
||||
mkdir -p "/tmpRoot/usr/lib/systemd/system"
|
||||
DEST="/tmpRoot/usr/lib/systemd/system/cpufreqscaling.service"
|
||||
cat << EOF > ${DEST}
|
||||
[Unit]
|
||||
Description=Enable CPU Freq scaling
|
||||
After=multi-user.target
|
||||
DefaultDependencies=no
|
||||
IgnoreOnIsolate=true
|
||||
After=udevrules.service
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
RestartSec=10s
|
||||
ExecStart=-/usr/bin/rescaler.sh "${2}"
|
||||
ExecStart=-/usr/bin/rescaler.sh ${2}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
Loading…
Reference in New Issue
Block a user