mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Force CPU speed for RPI
This commit is contained in:
parent
048e28f0d4
commit
48a83ab302
1 changed files with 7 additions and 4 deletions
|
@ -7,6 +7,7 @@ START=5
|
|||
USE_PROCD=1
|
||||
|
||||
omr_intf_del() {
|
||||
[ -z "$1" ] && return
|
||||
uci -q delete openmptcprouter.$1
|
||||
}
|
||||
|
||||
|
@ -17,10 +18,6 @@ omr_intf_check() {
|
|||
omr_intf_set() {
|
||||
config_get multipath "$1" multipath
|
||||
config_get ifname "$1" ifname
|
||||
[ -n "$(ubus call system board | jsonfilter -e '@.board_name' | grep raspberry)" ] && [ -n "$(echo $ifname | grep usb)" ] && {
|
||||
uci -q set openmptcprouter.settings.scaling_min_freq=800000
|
||||
uci -q set openmptcprouter.settings.scaling_max_freq=800000
|
||||
}
|
||||
[ -z "$multipath" ] || [ "$multipath" = "off" ] && [ "$1" != "omrvpn" ] && [ "$1" != "glorytun" ] && return
|
||||
|
||||
uci -q set openmptcprouter.$1=interface
|
||||
|
@ -41,6 +38,12 @@ start_service() {
|
|||
config_load network
|
||||
config_foreach omr_intf_set interface
|
||||
|
||||
[ -n "$(ubus call system board | jsonfilter -e '@.board_name' | grep raspberry)" ] && {
|
||||
# force CPU speed for RPI
|
||||
uci -q set openmptcprouter.settings.scaling_min_freq=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq | tr -d "\n")
|
||||
uci -q set openmptcprouter.settings.scaling_max_freq=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq | tr -d "\n")
|
||||
}
|
||||
|
||||
config_load openmptcprouter
|
||||
config_get scaling_min_freq settings scaling_min_freq
|
||||
[ -n "$scaling_min_freq" ] && {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue