Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
tbblgm119
lede
提交
a0adb273
L
lede
项目概览
tbblgm119
/
lede
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
lede
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a0adb273
编写于
3月 08, 2020
作者:
L
LEAN-ESX
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
luci-app-cpufreq: unlocked for all target
上级
2ae46625
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
21 deletion
+40
-21
include/target.mk
include/target.mk
+1
-1
package/lean/luci-app-cpufreq/Makefile
package/lean/luci-app-cpufreq/Makefile
+3
-3
package/lean/luci-app-cpufreq/luasrc/model/cbi/cpufreq.lua
package/lean/luci-app-cpufreq/luasrc/model/cbi/cpufreq.lua
+36
-17
未找到文件。
include/target.mk
浏览文件 @
a0adb273
...
...
@@ -18,7 +18,7 @@ block-mount coremark kmod-nf-nathelper kmod-nf-nathelper-extra kmod-ipt-raw wget
default-settings luci luci-proto-relay luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot
\
luci-app-filetransfer luci-app-vsftpd luci-app-ssr-plus luci-app-unblockmusic
\
luci-app-zerotier luci-app-arpbind luci-app-vlmcsd luci-app-wol luci-app-ramfree
\
luci-app-sfe luci-app-flowoffload luci-app-nlbwmon luci-app-accesscontrol
\
luci-app-sfe luci-app-flowoffload luci-app-nlbwmon luci-app-accesscontrol
luci-app-cpufreq
\
ddns-scripts_aliyun ddns-scripts_dnspod
# For nas targets
DEFAULT_PACKAGES.nas
:=
block-mount fdisk lsblk mdadm
...
...
package/lean/luci-app-cpufreq/Makefile
浏览文件 @
a0adb273
...
...
@@ -6,11 +6,11 @@
include
$(TOPDIR)/rules.mk
LUCI_TITLE
:=
LuCI
for
CPU
IPQ40xx Freq
LUCI_DEPENDS
:=
@TARGET_ipq40xx
LUCI_TITLE
:=
LuCI
for
CPU
Freq Setting
LUCI_DEPENDS
:=
PKG_NAME
:=
luci-app-cpufreq
PKG_VERSION
:=
1
PKG_RELEASE
:=
2
PKG_RELEASE
:=
3
include
$(TOPDIR)/feeds/luci/luci.mk
...
...
package/lean/luci-app-cpufreq/luasrc/model/cbi/cpufreq.lua
浏览文件 @
a0adb273
local
fs
=
require
"nixio.fs"
cpu_freqs
=
fs
.
readfile
(
"/sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies"
)
or
"100000"
cpu_freqs
=
string.sub
(
cpu_freqs
,
1
,
-
3
)
cpu_governors
=
fs
.
readfile
(
"/sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors"
)
or
"performance"
cpu_governors
=
string.sub
(
cpu_governors
,
1
,
-
3
)
function
string
.
split
(
input
,
delimiter
)
input
=
tostring
(
input
)
delimiter
=
tostring
(
delimiter
)
if
(
delimiter
==
''
)
then
return
false
end
local
pos
,
arr
=
0
,
{}
for
st
,
sp
in
function
()
return
string.find
(
input
,
delimiter
,
pos
,
true
)
end
do
table.insert
(
arr
,
string.sub
(
input
,
pos
,
st
-
1
))
pos
=
sp
+
1
end
table.insert
(
arr
,
string.sub
(
input
,
pos
))
return
arr
end
freq_array
=
string
.
split
(
cpu_freqs
,
" "
)
governor_array
=
string
.
split
(
cpu_governors
,
" "
)
mp
=
Map
(
"cpufreq"
,
translate
(
"CPU Freq Settings"
))
mp
.
description
=
translate
(
"Set CPU Scaling Governor to Max Performance or Balance Mode"
)
...
...
@@ -6,22 +29,19 @@ s = mp:section(NamedSection, "cpufreq", "settings")
s
.
anonymouse
=
true
governor
=
s
:
option
(
ListValue
,
"governor"
,
translate
(
"CPU Scaling Governor"
))
governor
:
value
(
"ondemand"
,
translate
(
"Ondemand Balance Mode"
))
governor
:
value
(
"performance"
,
translate
(
"Performance Mode"
))
minifreq
=
s
:
option
(
Value
,
"minifreq"
,
translate
(
"Min Idle CPU Freq"
))
minifreq
.
datatype
=
"range(48000,716000)"
minifreq
.
rmempty
=
false
minifreq
.
description
=
translate
(
"CPU Freq from 48000 to 716000 (Khz)"
)
minifreq
.
placeholder
=
48000
minifreq
.
default
=
48000
maxfreq
=
s
:
option
(
Value
,
"maxfreq"
,
translate
(
"Max Turbo Boost CPU Freq"
))
maxfreq
.
datatype
=
"range(48000,716000)"
maxfreq
.
rmempty
=
false
maxfreq
.
description
=
translate
(
"CPU Freq from 48000 to 716000 (Khz)"
)
maxfreq
.
placeholder
=
716000
maxfreq
.
default
=
716000
for
_
,
e
in
ipairs
(
governor_array
)
do
if
e
~=
""
then
governor
:
value
(
e
,
string.upper
(
e
))
end
end
minfreq
=
s
:
option
(
ListValue
,
"minifreq"
,
translate
(
"Min Idle CPU Freq"
))
for
_
,
e
in
ipairs
(
freq_array
)
do
if
e
~=
""
then
minfreq
:
value
(
e
)
end
end
maxfreq
=
s
:
option
(
ListValue
,
"maxfreq"
,
translate
(
"Max Turbo Boost CPU Freq"
))
for
_
,
e
in
ipairs
(
freq_array
)
do
if
e
~=
""
then
maxfreq
:
value
(
e
)
end
end
upthreshold
=
s
:
option
(
Value
,
"upthreshold"
,
translate
(
"CPU Switching Threshold"
))
upthreshold
.
datatype
=
"range(1,99)"
...
...
@@ -37,5 +57,4 @@ factor.description = translate("The sampling rate determines how frequently the
factor
.
placeholder
=
10
factor
.
default
=
10
return
mp
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录