mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add cpu scale frequency configuration
This commit is contained in:
parent
c5916d5454
commit
183bef4a8b
4 changed files with 92 additions and 0 deletions
27
luci-app-openmptcprouter/root/etc/init.d/openmptcprouter
Executable file
27
luci-app-openmptcprouter/root/etc/init.d/openmptcprouter
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=5
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
local scaling_min_freq scaling_max_freq
|
||||
config_load openmptcprouter
|
||||
config_get scaling_min_freq settings scaling_min_freq
|
||||
[ -n "$scaling_min_freq" ] && {
|
||||
echo $scaling_min_freq > /sys/devices/system/cpu/cpufreq/policy*/scaling_min_freq
|
||||
}
|
||||
config_get scaling_max_freq settings scaling_max_freq
|
||||
[ -n "$scaling_max_freq" ] && {
|
||||
echo $scaling_max_freq > /sys/devices/system/cpu/cpufreq/policy*/scaling_max_freq
|
||||
}
|
||||
config_get scaling_governor settings scaling_governor
|
||||
[ -n "$scaling_governor" ] && {
|
||||
echo $scaling_governor > /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
|
||||
}
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
rc_procd start_service
|
||||
return 0
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue