├── LICENSE
├── README.md
├── homebox
├── Makefile
└── files
│ ├── homebox.config
│ ├── homebox.init
│ └── homebox.uci-default
├── luci-alias.mk
├── luci-app-cpufreq
├── Makefile
├── luasrc
│ ├── controller
│ │ └── admin
│ │ │ └── cpufreq.lua
│ ├── model
│ │ └── cbi
│ │ │ └── cpufreq
│ │ │ ├── boot.lua
│ │ │ ├── cmdline.lua
│ │ │ ├── ipk.lua
│ │ │ ├── kmods.lua
│ │ │ ├── main.lua
│ │ │ ├── net.lua
│ │ │ └── samba.lua
│ └── view
│ │ └── cpufreq
│ │ ├── cpuinfo.htm
│ │ ├── sandbox.htm
│ │ ├── sb_guide.htm
│ │ ├── sb_guide.zh-cn.htm
│ │ ├── sb_info.htm
│ │ └── sb_info.zh-cn.htm
├── po
│ ├── en
│ │ └── cpufreq.po
│ ├── templates
│ │ └── cpufreq.pot
│ └── zh-cn
│ │ └── cpufreq.po
└── root
│ └── etc
│ ├── config
│ ├── cpufreq
│ ├── tuning
│ ├── tuning_boot
│ └── tuning_net
│ ├── init.d
│ ├── await_fstab
│ ├── cpufreq
│ ├── tuning
│ └── tuning_net
│ └── uci-defaults
│ ├── 21_cpufreq
│ ├── 21_tuning
│ └── 21_tuning_net
├── luci-app-fan
├── Makefile
├── luasrc
│ ├── controller
│ │ └── admin
│ │ │ └── luci-fan.lua
│ ├── model
│ │ └── cbi
│ │ │ └── luci-fan.lua
│ └── view
│ │ └── luci-fan.htm
├── po
│ ├── templates
│ │ └── luci-fan.pot
│ └── zh-cn
│ │ └── luci-fan.po
└── root
│ ├── etc
│ ├── config
│ │ └── luci-fan
│ ├── init.d
│ │ └── luci-fan
│ └── uci-defaults
│ │ └── luci-fan
│ └── usr
│ └── libexec
│ └── fan-control
├── luci-app-homebox
├── Makefile
├── luasrc
│ ├── controller
│ │ └── homebox.lua
│ ├── model
│ │ └── cbi
│ │ │ └── homebox.lua
│ └── view
│ │ ├── admin_status
│ │ └── index
│ │ │ └── homebox.htm
│ │ └── homebox_status.htm
├── po
│ └── zh-cn
│ │ └── homebox.po
└── root
│ └── etc
│ └── uci-defaults
│ └── 50_luci-homebox
├── luci-app-tasks
├── Makefile
├── luasrc
│ ├── controller
│ │ └── tasks-app.lua
│ ├── model
│ │ └── cbi
│ │ │ └── tasks
│ │ │ └── all.lua
│ └── view
│ │ └── tasks
│ │ └── all.htm
└── po
│ └── zh-cn
│ └── tasks.po
└── luci-lib-mac-vendor
├── Makefile
└── src
└── Makefile
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 练亮斌
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # openwrt-apps
2 | app for openwrt luci
3 |
--------------------------------------------------------------------------------
/homebox/Makefile:
--------------------------------------------------------------------------------
1 | include $(TOPDIR)/rules.mk
2 |
3 | PKG_NAME:=homebox
4 | PKG_VERSION:=0.0.0_pre2020062901
5 | PKG_RELEASE:=3
6 |
7 | SRC_VERSION:=0.0.0-dev.2020062901
8 | PKG_SOURCE_URL_FILE:=v$(SRC_VERSION).tar.gz
9 | PKG_SOURCE:=$(PKG_NAME)-$(SRC_VERSION).tar.gz
10 | PKG_SOURCE_URL:=https://github.com/XGHeaven/homebox/archive/refs/tags/
11 | PKG_HASH:=815a2a0fc5458245769648ef5b394f69fdec2573a1403b789146be0c4217a443
12 |
13 | PKG_BUILD_DEPENDS:=golang/host homebox/host
14 | PKG_BUILD_PARALLEL:=1
15 | PKG_USE_MIPS16:=0
16 |
17 | HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/${PKG_NAME}
18 |
19 | include $(INCLUDE_DIR)/host-build.mk
20 | include $(INCLUDE_DIR)/package.mk
21 | include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
22 |
23 | define Package/$(PKG_NAME)
24 | SECTION:=net
25 | CATEGORY:=Network
26 | SUBMENU:=Web Servers/Proxies
27 | TITLE:=A Toolbox for Home Local Networks
28 | URL:=https://github.com/XGHeaven/homebox
29 | DEPENDS:=$(GO_ARCH_DEPENDS)
30 | MENU:=1
31 | endef
32 |
33 | define Package/$(PKG_NAME)/description
34 | A Toolbox for Home Local Networks Speed Test
35 | endef
36 |
37 | GO_PKG_BUILD_VARS += GO111MODULE=auto
38 | TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS)
39 | TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
40 |
41 | define Build/Configure
42 | ( \
43 | cd $(PKG_BUILD_DIR)/server; \
44 | $(GO_PKG_VARS) \
45 | go get -d -modcacherw; \
46 | )
47 | ( \
48 | cd $(PKG_BUILD_DIR)/server; \
49 | GOPATH=$(PKG_BUILD_DIR)/.go_work/build \
50 | go install -modcacherw github.com/go-bindata/go-bindata/...@latest; \
51 | )
52 | endef
53 |
54 | define Build/Compile
55 | rm -rf $(PKG_BUILD_DIR)/build/static
56 | mkdir -p $(PKG_BUILD_DIR)/build
57 | $(CP) $(HOST_BUILD_DIR)/build/static $(PKG_BUILD_DIR)/build/
58 | ( \
59 | cd $(PKG_BUILD_DIR); \
60 | $(GO_PKG_VARS) PATH=$(PKG_BUILD_DIR)/.go_work/build/bin:$$$$PATH \
61 | $(MAKE) build-server; \
62 | )
63 | endef
64 |
65 | define Package/$(PKG_NAME)/install
66 | $(INSTALL_DIR) $(1)/usr/bin $(1)/etc/config $(1)/etc/init.d $(1)/etc/uci-defaults
67 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/server $(1)/usr/bin/homebox
68 | $(INSTALL_CONF) ./files/homebox.config $(1)/etc/config/homebox
69 | $(INSTALL_BIN) ./files/homebox.init $(1)/etc/init.d/homebox
70 | $(INSTALL_BIN) ./files/homebox.uci-default $(1)/etc/uci-defaults/homebox
71 | endef
72 |
73 | define Package/$(PKG_NAME)/conffiles
74 | /etc/config/homebox
75 | endef
76 |
77 | define Package/$(PKG_NAME)/postinst
78 | #!/bin/sh
79 | if [ -z "$${IPKG_INSTROOT}" ]; then
80 | [ -f /etc/uci-defaults/homebox ] && /etc/uci-defaults/homebox && rm -f /etc/uci-defaults/homebox
81 | exit 0
82 | fi
83 | endef
84 |
85 | define Host/Configure
86 | cd $(HOST_BUILD_DIR)/web && rm -f package-lock.json && npm --cache-min 1440 install
87 | endef
88 |
89 | define Host/Compile
90 | cd $(HOST_BUILD_DIR) && $(MAKE) build-web
91 | endef
92 |
93 | define Host/Install
94 | endef
95 |
96 | define Host/Clean
97 | rm -f $(HOST_BUILD_DIR)/build/static
98 | endef
99 |
100 | $(eval $(call HostBuild))
101 | $(eval $(call BuildPackage,homebox))
102 |
--------------------------------------------------------------------------------
/homebox/files/homebox.config:
--------------------------------------------------------------------------------
1 | config homebox
2 | option 'enabled' '0'
3 |
--------------------------------------------------------------------------------
/homebox/files/homebox.init:
--------------------------------------------------------------------------------
1 | #!/bin/sh /etc/rc.common
2 |
3 | START=99
4 | USE_PROCD=1
5 |
6 | get_config() {
7 | config_get_bool enabled $1 enabled 1
8 | config_get_bool logger $1 logger
9 | }
10 |
11 | start_service() {
12 | config_load homebox
13 | config_foreach get_config homebox
14 | [ $enabled != 1 ] && return 1
15 |
16 | procd_open_instance
17 | procd_set_param command /usr/bin/homebox
18 | [ "$logger" == 1 ] && procd_set_param stderr 1
19 | procd_set_param respawn
20 | procd_close_instance
21 | }
22 |
23 | service_triggers() {
24 | procd_add_reload_trigger "homebox"
25 | }
26 |
--------------------------------------------------------------------------------
/homebox/files/homebox.uci-default:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | uci -q batch <<-EOF >/dev/null
4 | delete ucitrack.@homebox[-1]
5 | add ucitrack homebox
6 | set ucitrack.@homebox[-1].init=homebox
7 | commit ucitrack
8 | EOF
9 |
10 | exit 0
--------------------------------------------------------------------------------
/luci-alias.mk:
--------------------------------------------------------------------------------
1 |
2 | LUCI_LANG.zh-cn=简体中文 (Chinese Simplified)
3 | LUCI_LANG.zh-tw=繁體中文 (Chinese Traditional)
4 | LUCI_LANG.pt-br=Português do Brasil (Brazilian Portuguese)
5 | LUCI_LANG.no=Norsk (Norwegian)
6 | LUCI_LANG.bn=বাংলা (Bengali)
7 |
8 | include $(TOPDIR)/feeds/luci/luci.mk
9 |
--------------------------------------------------------------------------------
/luci-app-cpufreq/Makefile:
--------------------------------------------------------------------------------
1 |
2 | include $(TOPDIR)/rules.mk
3 |
4 | LUCI_TITLE:=LuCI for misc configure
5 | LUCI_PKGARCH:=all
6 | LUCI_DEPENDS:=+ethtool
7 | PKG_VERSION:=1.8.6-r3
8 | PKG_RELEASE:=
9 |
10 | define Package/luci-app-cpufreq/conffiles
11 | /etc/config/cpufreq
12 | /etc/config/tuning
13 | /etc/config/tuning_boot
14 | /etc/config/tuning_net
15 | endef
16 |
17 | include ../luci-alias.mk
18 |
19 | # call BuildPackage - OpenWrt buildroot signature
20 |
--------------------------------------------------------------------------------
/luci-app-cpufreq/luasrc/controller/admin/cpufreq.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | LuCI - Lua Configuration Interface
3 | Copyright 2021 jjm2473
4 | ]]--
5 |
6 | module("luci.controller.admin.cpufreq",package.seeall)
7 | require "luci.util"
8 |
9 | function index()
10 | local sys = require "luci.sys"
11 | local appname = "tuning"
12 | local defaultpage = nil
13 | entry({"admin", "system", appname}).dependent = true
14 | if nixio.fs.access("/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq") then
15 | defaultpage = defaultpage or alias("admin", "system", appname, "main")
16 | entry({"admin", "system", appname, "main"}, cbi("cpufreq/main"), _("CPU Tuning"), 1).leaf = true
17 | entry({"admin", "system", appname, "get_cpu_info"}, call("get_cpu_info"), nil).leaf = true
18 | end
19 | if nixio.fs.access("/rom/etc/opkg/distfeeds.conf") then
20 | defaultpage = defaultpage or alias("admin", "system", appname, "ipk")
21 | entry({"admin", "system", appname, "ipk"}, cbi("cpufreq/ipk"), _("IPK Mirror"), 2).leaf = true
22 | end
23 | if nixio.fs.access("/etc/config/samba4") then
24 | defaultpage = defaultpage or alias("admin", "system", appname, "samba")
25 | entry({"admin", "system", appname, "samba"}, cbi("cpufreq/samba"), _("Samba"), 3).leaf = true
26 | end
27 | defaultpage = defaultpage or alias("admin", "system", appname, "boot")
28 | entry({"admin", "system", appname, "boot"}, cbi("cpufreq/boot"), _("Boot"), 4).leaf = true
29 |
30 | if nixio.fs.access("/etc/config/kmods") and sys.call("[ -n \"$(ls /etc/modules-pending.d/ 2>/dev/null | head -c1)\" ] >/dev/null 2>&1") == 0 then
31 | entry({"admin", "system", appname, "kmods"}, cbi("cpufreq/kmods"), _("Drivers"), 5).leaf = true
32 | end
33 |
34 | if sys.call("[ -d /ext_overlay ] >/dev/null 2>&1") == 0 then
35 | entry({"admin", "system", appname, "sandbox"}, call("sandbox_index",
36 | {prefix=luci.dispatcher.build_url("admin", "system", appname, "sandbox")}), _("Sandbox"), 6)
37 | entry({"admin", "system", appname, "sandbox", "reset"}, post("sandbox_reset"))
38 | entry({"admin", "system", appname, "sandbox", "commit"}, post("sandbox_commit"))
39 | entry({"admin", "system", appname, "sandbox", "exit"}, post("sandbox_exit"))
40 | end
41 |
42 | local hwppoe_feature = luci.util.trim(sys.exec("ethtool -k eth0 2>/dev/null | grep -F hw-pppoe: 2>/dev/null"))
43 | if hwppoe_feature ~= nil and hwppoe_feature ~= "" and not string.match(hwppoe_feature, "%[fixed%]") then
44 | entry({"admin", "system", appname, "net"}, cbi("cpufreq/net"), _("Network"), 7).leaf = true
45 | end
46 |
47 | if nixio.fs.access("/etc/init.d/grub") then
48 | entry({"admin", "system", appname, "cmdline"}, cbi("cpufreq/cmdline"), _("Kernel Cmdline"), 8).leaf = true
49 | end
50 |
51 | if defaultpage then
52 | entry({"admin", "system", appname}, defaultpage, _("Tuning"), 59)
53 | end
54 |
55 | end
56 |
57 | function get_cpu_info()
58 | local fs = require "nixio.fs"
59 | local freq = tonumber(fs.readfile("/sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq")) / 1000; -- MHz
60 | luci.http.status(200, "ok")
61 | luci.http.prepare_content("application/json")
62 | luci.http.write_json({freq=freq})
63 | end
64 |
65 | function sandbox_index(param)
66 | luci.template.render("cpufreq/sandbox", {prefix=param.prefix})
67 | end
68 |
69 | function sandbox_reset()
70 | local sys = require "luci.sys"
71 | sys.call("/usr/sbin/sandbox reset")
72 | luci.sys.reboot()
73 | end
74 |
75 | function sandbox_commit()
76 | local sys = require "luci.sys"
77 | sys.call("/usr/sbin/sandbox commit")
78 | luci.sys.reboot()
79 | end
80 |
81 | function sandbox_exit()
82 | local sys = require "luci.sys"
83 | sys.call("/usr/sbin/sandbox exit")
84 | luci.sys.reboot()
85 | end
86 |
--------------------------------------------------------------------------------
/luci-app-cpufreq/luasrc/model/cbi/cpufreq/boot.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | LuCI - Lua Configuration Interface
3 | Copyright 2021 jjm2473
4 | ]]--
5 |
6 | local fs = require "nixio.fs"
7 |
8 | local block = io.popen("block info", "r")
9 | local ln, dev, devices = nil, nil, {}
10 |
11 | repeat
12 | ln = block:read("*l")
13 | dev = ln and ln:match("^/dev/(.-):")
14 |
15 | if dev then
16 | local e, s, key, val = { }
17 |
18 | for key, val in ln:gmatch([[(%w+)="(.-)"]]) do
19 | e[key:lower()] = val
20 | end
21 |
22 | s = tonumber((fs.readfile("/sys/class/block/%s/size" % dev)))
23 |
24 | e.dev = "/dev/%s" % dev
25 | e.size = s and math.floor(s / 2048)
26 |
27 | devices[#devices+1] = e
28 | end
29 | until not ln
30 |
31 | block:close()
32 |
33 |
34 | local m, s, o
35 |
36 | m = Map("tuning_boot", nil, translate("Boot"))
37 |
38 | s = m:section(TypedSection, "fstab_delay", translate("Delay before disk mounting"),
39 | translate("Wait for the hard disk to initialize to solve the problem that the hard disk is not mounted when some applications that rely on the hard disk are started.")
40 | .. "
" .. translate("Do not select a network block device (e.g. NBD, iSCSI, etc.), you may have to wait until timeout."))
41 | s.addremove=false
42 | s.anonymous=true
43 |
44 | o = s:option(Flag, "enabled", translate("Enable"))
45 |
46 | o = s:option(Value, "timeout", translate("Timeout (seconds)"))
47 | o:value("5", "5")
48 | o:value("10", "10")
49 | o:value("30", "30")
50 | o:value("60", "60")
51 | o:depends("enabled", 1)
52 | o.default = "5"
53 |
54 | o = s:option(DynamicList, "device", translate("Or until these device(s) ready (UUID):"))
55 | o:depends("enabled", 1)
56 | for i, d in ipairs(devices) do
57 | if d.uuid and d.size then
58 | o:value(d.uuid, "%s (%s, %d MB)" %{ d.uuid, d.dev, d.size })
59 | elseif d.uuid then
60 | o:value(d.uuid, "%s (%s)" %{ d.uuid, d.dev })
61 | end
62 | end
63 |
64 | return m
65 |
--------------------------------------------------------------------------------
/luci-app-cpufreq/luasrc/model/cbi/cpufreq/cmdline.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | LuCI - Lua Configuration Interface
3 | Copyright 2024 jjm2473
4 | ]]--
5 |
6 | require "luci.util"
7 | require "luci.xml"
8 | local fs = require "nixio.fs"
9 |
10 | local m, s, o
11 |
12 | m = Map("grub", nil, translate("This page configures Linux kernel boot parameters. After saving and applying, the GRUB configuration file of the boot partition will be modified. The parameters will take effect after restarting the system (the boot partition is not within the scope of sandbox protection, please be aware)"))
13 | s = m:section(SimpleSection, translate("Current Cmdline"), luci.xml.pcdata(luci.util.trim(fs.readfile("/proc/cmdline") or "")))
14 |
15 | if fs.access("/etc/grub.cfg.d/01-iommu.cfg") then
16 | s = m:section(NamedSection, "iommu", "iommu", "IOMMU", translate("Supports PCI device passthrough for virtual machines (KVM/QEMU)"))
17 | s.addremove=false
18 | s.anonymous=true
19 |
20 | o = s:option(Flag, "enabled", translate("Enabled"))
21 |
22 | o = s:option(Value, "cmdline", translate("Parameters"), translate("Default or empty will be automatically filled in according to the current platform"))
23 | o:value("", translate("Default"))
24 | o:value("intel_iommu=on iommu=pt", "Intel (intel_iommu=on iommu=pt)")
25 | o:value("amd_iommu=on iommu=pt", "AMD (amd_iommu=on iommu=pt)")
26 |
27 | end
28 |
29 | s = m:section(TypedSection, "cmdline", translate("Custom Parameters"),
30 | translate("Danger! If you do not understand the kernel boot parameters, do not modify them to avoid being unable to start or damaging the hardware"))
31 | s.addremove=true
32 | s.anonymous=true
33 | s.template = "cbi/tblsection"
34 |
35 | o = s:option(Flag, "enabled", translate("Enabled"))
36 |
37 | o = s:option(Value, "cmdline", translate("Parameters"))
38 | o.datatype = "string"
39 | o.rmempty = false
40 |
41 | o = s:option(Value, "comment", translate("Comment"))
42 |
43 | return m
44 |
--------------------------------------------------------------------------------
/luci-app-cpufreq/luasrc/model/cbi/cpufreq/ipk.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | LuCI - Lua Configuration Interface
3 | Copyright 2021 jjm2473
4 | ]]--
5 |
6 | local m, s, o
7 |
8 | m = Map("tuning", nil, translate("Select IPK Mirror server"))
9 |
10 | s = m:section(TypedSection, "ipk")
11 | s.addremove=false
12 | s.anonymous=true
13 |
14 | o = s:option(ListValue, "mirror", translate("Mirror server"))
15 | o:value("disable", "")
16 | o:value("http://downloads.openwrt.org/", translate("OpenWRT") .. " (HTTP)")
17 | o:value("https://downloads.openwrt.org/", translate("OpenWRT") .. " (HTTPS)")
18 | o:value("https://mirrors.cernet.edu.cn/openwrt/", translate("CERNET 302"))
19 | o:value("https://mirrors.sustech.edu.cn/openwrt/", translate("SUSTech"))
20 | o:value("https://mirrors.tuna.tsinghua.edu.cn/openwrt/", translate("Tsinghua University"))
21 | o:value("https://mirrors.ustc.edu.cn/openwrt/", translate("USTC"))
22 | o:value("https://mirror.lzu.edu.cn/openwrt/", translate("Lanzhou University"))
23 | o:value("https://mirrors.aliyun.com/openwrt/", translate("Alibaba Cloud"))
24 | o:value("https://mirrors.cloud.tencent.com/openwrt/", translate("Tencent Cloud"))
25 | o:value("https://mirror.iscas.ac.cn/openwrt/", translate("Chinese Academy of Sciences"))
26 | o:value("https://mirror.nyist.edu.cn/openwrt/", translate("NYIST"))
27 | o:value("https://mirror.sjtu.edu.cn/openwrt/", translate("SJTU"))
28 | o:value("https://mirrors.cqupt.edu.cn/openwrt/", translate("CQUPT"))
29 | o:value("https://mirrors.qlu.edu.cn/openwrt/", translate("Qilu University of Technology"))
30 |
31 | o.rmempty = false
32 | o.default = "disable"
33 |
34 | return m
35 |
--------------------------------------------------------------------------------
/luci-app-cpufreq/luasrc/model/cbi/cpufreq/kmods.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | LuCI - Lua Configuration Interface
3 | Copyright 2023 jjm2473
4 | ]]--
5 |
6 | local files = io.popen("ls /etc/modules-pending.d/", "r")
7 | local ln, drivers = nil, {}
8 |
9 | while ( true )
10 | do
11 | ln = files:read("*l")
12 | if not ln or ln == "" then
13 | break
14 | end
15 | drivers[#drivers+1] = luci.util.trim(ln)
16 | end
17 |
18 | files:close()
19 |
20 | local m, s, o, i, d
21 |
22 | m = Map("kmods", nil, translate("Configure device drivers, kernel modules, etc. Changes here will take effect on next boot"))
23 |
24 | s = m:section(NamedSection, "kmods", "global", translate("Drivers Settings"))
25 | s.addremove=false
26 | s.anonymous=true
27 |
28 | local known = {
29 | ['r8125'] = translate("Realtek r8125 driver"),
30 | ['r8168'] = translate("Realtek r8168 driver"),
31 | ['i915-oot'] = translate("Backported Intel GPU driver (i915-oot)"),
32 | }
33 |
34 | o = s:option(StaticList, "enable", translate("Enable additional drivers"), translate("Please do not choose a driver you do not understand. Choosing the wrong driver may cause the system to fail to start"))
35 | for i, d in ipairs(drivers) do
36 | o:value(d, known[d] or d )
37 | end
38 |
39 | return m
40 |
--------------------------------------------------------------------------------
/luci-app-cpufreq/luasrc/model/cbi/cpufreq/main.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | LuCI - Lua Configuration Interface
3 | Copyright 2021 jjm2473
4 | ]]--
5 |
6 | local m, s, o
7 | require "luci.util"
8 |
9 | local governor_path = "/sys/devices/system/cpu/cpufreq/policy0/scaling_governor"
10 |
11 | local fs = require "nixio.fs"
12 |
13 | m = Map("cpufreq", nil, translate("Manage CPU performance over LuCI."))
14 | m:section(SimpleSection).template = "cpufreq/cpuinfo"
15 |
16 | s = m:section(TypedSection, "cpufreq")
17 | s.addremove=false
18 | s.anonymous=true
19 |
20 | local cur_governor = luci.util.trim(fs.readfile(governor_path))
21 |
22 | o = s:option(ListValue, "governor", translate("CPUFreq governor"), translate("It is recommended to use 'ondemand' or 'schedutil'"))
23 | o:value("", translate("Default (Take effect after reboot)"))
24 | for i,v in pairs(luci.util.split(luci.util.trim(fs.readfile("/sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors")), " ")) do
25 | o:value(v, translate(v))
26 | end
27 | o.default = cur_governor
28 |
29 | local available_frequencies = luci.util.split(luci.util.trim(fs.readfile("/sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies")), " ")
30 |
31 | if #available_frequencies > 0 then
32 | o = s:option(ListValue, "speed", translate("Frequency"), translate("Pay attention to heat dissipation when choosing high frequency"))
33 | o:depends("governor", "userspace")
34 | for i,v in pairs(available_frequencies) do
35 | o:value(v, (tonumber(v)/1000) .. " MHz")
36 | end
37 | o.rmempty = true
38 | o.default = available_frequencies[1]
39 | end
40 |
41 | return m
42 |
--------------------------------------------------------------------------------
/luci-app-cpufreq/luasrc/model/cbi/cpufreq/net.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | LuCI - Lua Configuration Interface
3 | Copyright 2022 jjm2473
4 | ]]--
5 |
6 | local m, s, o
7 |
8 | m = Map("tuning_net", nil, translate("Network"))
9 |
10 | s = m:section(TypedSection, "hw_acct", translate("Hardware Acceleration"))
11 | s.addremove=false
12 | s.anonymous=true
13 |
14 | o = s:option(Flag, "wan_acct", translate("Enable WAN Port Acceleration"), translate("Improve built-in WAN port (eth0) TX performace"))
15 | o.default="1"
16 |
17 | o = s:option(Flag, "hw_pppoe", translate("Enable PPPoE Acceleration"), translate("Improve PPPoE TX performace, only support built-in NICs"))
18 | o.rmempty=true
19 | o:depends('wan_acct', 1)
20 |
21 | return m
22 |
--------------------------------------------------------------------------------
/luci-app-cpufreq/luasrc/model/cbi/cpufreq/samba.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | LuCI - Lua Configuration Interface
3 | Copyright 2021 jjm2473
4 | ]]--
5 |
6 | local m, s, o
7 |
8 | m = Map("samba4", nil, translate("Samba"))
9 |
10 | s = m:section(TypedSection, "samba", translate("Samba expert"))
11 | s.addremove=false
12 | s.anonymous=true
13 |
14 | o = s:option(Flag, "allow_legacy_protocols", translate("Allow legacy protocols"), translate("Allow old client, don't use this option for secure environments!"))
15 |
16 | -- uci set samba.@samba[0].allow_legacy_protocols=1
17 |
18 | return m
19 |
--------------------------------------------------------------------------------
/luci-app-cpufreq/luasrc/view/cpufreq/cpuinfo.htm:
--------------------------------------------------------------------------------
1 |
13 |
14 |
Sandbox not working. How to start:
2 |Note: this sandbox only protect overlay partition, no Docker or other disks included
9 | -------------------------------------------------------------------------------- /luci-app-cpufreq/luasrc/view/cpufreq/sb_guide.zh-cn.htm: -------------------------------------------------------------------------------- 1 |当前不处于沙箱环境。沙箱配置方法:
2 |注意:此沙箱实际是多层OverlayFS,方便用来实验系统配置和程序,方便开发未完成的软件,但不保护Docker和硬盘的数据
9 | -------------------------------------------------------------------------------- /luci-app-cpufreq/luasrc/view/cpufreq/sb_info.htm: -------------------------------------------------------------------------------- 1 |Sandbox is working
2 |Click "Commit" to merge changes to normal env, click "Reset" to reinitialize the sandbox
3 |Click "Exit Sandbox" to exit sandbox env
4 |Above actions will reboot device
5 |Poweroff and detach the U disk to temporarily exit sandbox env
6 |After developing app flashed, "Reset" sandbox so we can check the releaseed version
7 | -------------------------------------------------------------------------------- /luci-app-cpufreq/luasrc/view/cpufreq/sb_info.zh-cn.htm: -------------------------------------------------------------------------------- 1 |当前处于沙箱环境
2 |点击“提交”可将变更合并到非沙箱环境,点击“重置”可将沙箱恢复到初始状态
3 |点击“退出沙箱”可退出沙箱环境
4 |以上操作都将重启设备
5 |关机以后移除相关U盘或者移动硬盘能临时退出沙箱环境
6 |若开发中的软件已经打包进固件并已经刷机,可“重置”沙箱以使用固件中的版本
7 | -------------------------------------------------------------------------------- /luci-app-cpufreq/po/en/cpufreq.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "Content-Type: text/plain; charset=UTF-8" 3 | 4 | msgid "Tuning" 5 | msgstr "Tuning" 6 | 7 | msgid "CPU Tuning" 8 | msgstr "CPU Tuning" 9 | 10 | msgid "Manage CPU performance over LuCI." 11 | msgstr "Manage CPU performance over LuCI." 12 | 13 | msgid "CPU frequence:" 14 | msgstr "CPU frequence:" 15 | 16 | msgid "temperature:" 17 | msgstr "temperature:" 18 | 19 | msgid "CPUFreq governor" 20 | msgstr "CPUFreq governor" 21 | 22 | msgid "Default (Take effect after reboot)" 23 | msgstr "Default (Take effect after reboot)" 24 | 25 | msgid "conservative" 26 | msgstr "Conservative" 27 | 28 | msgid "userspace" 29 | msgstr "Userspace" 30 | 31 | msgid "powersave" 32 | msgstr "Powersave" 33 | 34 | msgid "ondemand" 35 | msgstr "Ondemand" 36 | 37 | msgid "performance" 38 | msgstr "Performance" 39 | 40 | msgid "interactive" 41 | msgstr "Interactive" 42 | 43 | msgid "Fan trigger temperature" 44 | msgstr "Fan trigger temperature" 45 | 46 | msgid "IPK Mirror" 47 | msgstr "IPK Mirror" 48 | 49 | msgid "Select IPK Mirror server" 50 | msgstr "Select IPK Mirror server" 51 | 52 | msgid "Mirror server" 53 | msgstr "Mirror server" 54 | 55 | msgid "Tsinghua University" 56 | msgstr "Tsinghua University" 57 | 58 | msgid "USTC" 59 | msgstr "USTC" 60 | 61 | msgid "Alibaba Cloud" 62 | msgstr "Alibaba Cloud" 63 | 64 | msgid "Tencent Cloud" 65 | msgstr "Tencent Cloud" 66 | 67 | msgid "Drivers" 68 | msgstr "Drivers" 69 | 70 | msgid "Drivers Settings" 71 | msgstr "Drivers Settings" 72 | 73 | msgid "Realtek r8125 driver" 74 | msgstr "Realtek r8125 driver" 75 | 76 | msgid "Realtek r8168 driver" 77 | msgstr "Realtek r8168 driver" 78 | 79 | msgid "Backported Intel GPU driver (i915-oot)" 80 | msgstr "Backported Intel GPU driver (i915-oot)" 81 | 82 | msgid "Enable additional drivers" 83 | msgstr "Enable additional drivers" 84 | 85 | msgid "Configure device drivers, kernel modules, etc. Changes here will take effect on next boot" 86 | msgstr "Configure device drivers, kernel modules, etc. Changes here will take effect on next boot" 87 | 88 | msgid "Please do not choose a driver you do not understand. Choosing the wrong driver may cause the system to fail to start" 89 | msgstr "Please do not choose a driver you do not understand. Choosing the wrong driver may cause the system to fail to start" 90 | -------------------------------------------------------------------------------- /luci-app-cpufreq/po/templates/cpufreq.pot: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "Content-Type: text/plain; charset=UTF-8" 3 | 4 | msgid "Tuning" 5 | msgstr "" 6 | 7 | msgid "CPU Tuning" 8 | msgstr "" 9 | 10 | msgid "Manage CPU performance over LuCI." 11 | msgstr "" 12 | 13 | msgid "CPU frequence:" 14 | msgstr "" 15 | 16 | msgid "temperature:" 17 | msgstr "" 18 | 19 | msgid "CPUFreq governor" 20 | msgstr "" 21 | 22 | msgid "Default (Take effect after reboot)" 23 | msgstr "" 24 | 25 | msgid "conservative" 26 | msgstr "" 27 | 28 | msgid "userspace" 29 | msgstr "" 30 | 31 | msgid "powersave" 32 | msgstr "" 33 | 34 | msgid "ondemand" 35 | msgstr "" 36 | 37 | msgid "performance" 38 | msgstr "" 39 | 40 | msgid "interactive" 41 | msgstr "" 42 | 43 | msgid "schedutil" 44 | msgstr "" 45 | 46 | msgid "It is recommended to use 'ondemand' or 'schedutil'" 47 | msgstr "" 48 | 49 | msgid "Frequency" 50 | msgstr "" 51 | 52 | msgid "Pay attention to heat dissipation when choosing high frequency" 53 | msgstr "" 54 | 55 | msgid "Fan trigger temperature" 56 | msgstr "" 57 | 58 | msgid "Fan temperature hysteresis" 59 | msgstr "" 60 | 61 | msgid "Set a larger value to avoid frequent restart of the fan" 62 | msgstr "" 63 | 64 | msgid "IPK Mirror" 65 | msgstr "" 66 | 67 | msgid "Select IPK Mirror server" 68 | msgstr "" 69 | 70 | msgid "Mirror server" 71 | msgstr "" 72 | 73 | msgid "Tsinghua University" 74 | msgstr "" 75 | 76 | msgid "USTC" 77 | msgstr "" 78 | 79 | msgid "Alibaba Cloud" 80 | msgstr "" 81 | 82 | msgid "Tencent Cloud" 83 | msgstr "" 84 | 85 | msgid "Boot" 86 | msgstr "" 87 | 88 | msgid "Delay before mounting" 89 | msgstr "" 90 | 91 | msgid "Timeout (seconds)" 92 | msgstr "" 93 | 94 | msgid "Or until these device(s) ready (UUID):" 95 | msgstr "" 96 | 97 | msgid "Samba expert" 98 | msgstr "" 99 | 100 | msgid "Allow legacy protocols" 101 | msgstr "" 102 | 103 | msgid "Allow old client, don't use this option for secure environments!" 104 | msgstr "" 105 | 106 | msgid "Sandbox" 107 | msgstr "" 108 | 109 | msgid "Simple sandbox for OpenWRT" 110 | msgstr "" 111 | 112 | msgid "This action will reboot device" 113 | msgstr "" 114 | 115 | msgid "Commit" 116 | msgstr "" 117 | 118 | msgid "Reset" 119 | msgstr "" 120 | 121 | msgid "cpufreq/sb_info" 122 | msgstr "" 123 | 124 | msgid "cpufreq/sb_guide" 125 | msgstr "" 126 | 127 | msgid "Network" 128 | msgstr "" 129 | 130 | msgid "Hardware Acceleration" 131 | msgstr "" 132 | 133 | msgid "Enable PPPoE Acceleration" 134 | msgstr "" 135 | 136 | msgid "Improve PPPoE TX performace, only support built-in NICs" 137 | msgstr "" 138 | 139 | msgid "Exit Sandbox" 140 | msgstr "" 141 | 142 | msgid "Enable WAN Port Acceleration" 143 | msgstr "" 144 | 145 | msgid "Improve built-in WAN port (eth0) TX performace" 146 | msgstr "" 147 | 148 | msgid "Drivers" 149 | msgstr "" 150 | 151 | msgid "Drivers Settings" 152 | msgstr "" 153 | 154 | msgid "Realtek r8125 driver" 155 | msgstr "" 156 | 157 | msgid "Realtek r8168 driver" 158 | msgstr "" 159 | 160 | msgid "Backported Intel GPU driver (i915-oot)" 161 | msgstr "" 162 | 163 | msgid "Enable additional drivers" 164 | msgstr "" 165 | 166 | msgid "Configure device drivers, kernel modules, etc. Changes here will take effect on next boot" 167 | msgstr "" 168 | 169 | msgid "Please do not choose a driver you do not understand. Choosing the wrong driver may cause the system to fail to start" 170 | msgstr "" 171 | -------------------------------------------------------------------------------- /luci-app-cpufreq/po/zh-cn/cpufreq.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "Content-Type: text/plain; charset=UTF-8" 3 | 4 | msgid "Tuning" 5 | msgstr "杂项设置" 6 | 7 | msgid "CPU Tuning" 8 | msgstr "CPU调节" 9 | 10 | msgid "Manage CPU performance over LuCI." 11 | msgstr "通过LuCI调节CPU性能" 12 | 13 | msgid "CPU frequence:" 14 | msgstr "CPU频率:" 15 | 16 | msgid "temperature:" 17 | msgstr "核心温度:" 18 | 19 | msgid "CPUFreq governor" 20 | msgstr "CPU性能策略" 21 | 22 | msgid "Apply" 23 | msgstr "应用" 24 | 25 | msgid "Default (Take effect after reboot)" 26 | msgstr "默认(重启后生效)" 27 | 28 | msgid "conservative" 29 | msgstr "Conservative(平滑)" 30 | 31 | msgid "userspace" 32 | msgstr "手动/固定频率" 33 | 34 | msgid "powersave" 35 | msgstr "节能模式" 36 | 37 | msgid "ondemand" 38 | msgstr "自动调节" 39 | 40 | msgid "performance" 41 | msgstr "性能模式" 42 | 43 | msgid "interactive" 44 | msgstr "Interactive(灵敏)" 45 | 46 | msgid "schedutil" 47 | msgstr "基于调度器" 48 | 49 | msgid "It is recommended to use 'ondemand' or 'schedutil'" 50 | msgstr "推荐使用“自动调节”或“基于调度器”" 51 | 52 | msgid "Frequency" 53 | msgstr "频率" 54 | 55 | msgid "Pay attention to heat dissipation when choosing high frequency" 56 | msgstr "选择高频时注意散热" 57 | 58 | msgid "Fan trigger temperature" 59 | msgstr "风扇启动温度" 60 | 61 | msgid "Fan temperature hysteresis" 62 | msgstr "风扇温度容错" 63 | 64 | msgid "Set a larger value to avoid frequent restart of the fan" 65 | msgstr "设置更大的值以避免频繁重启风扇" 66 | 67 | msgid "IPK Mirror" 68 | msgstr "IPK镜像服务器" 69 | 70 | msgid "Select IPK Mirror server" 71 | msgstr "选择IPK镜像服务器" 72 | 73 | msgid "Mirror server" 74 | msgstr "镜像服务器" 75 | 76 | msgid "Tsinghua University" 77 | msgstr "清华大学" 78 | 79 | msgid "USTC" 80 | msgstr "中国科学技术大学" 81 | 82 | msgid "Alibaba Cloud" 83 | msgstr "阿里云" 84 | 85 | msgid "Tencent Cloud" 86 | msgstr "腾讯云" 87 | 88 | msgid "CERNET 302" 89 | msgstr "高校联合镜像站(智能选择最近大学镜像站)" 90 | 91 | msgid "SUSTech" 92 | msgstr "南方科技大学" 93 | 94 | msgid "Lanzhou University" 95 | msgstr "兰州大学" 96 | 97 | msgid "Chinese Academy of Sciences" 98 | msgstr "中国科学院" 99 | 100 | msgid "NYIST" 101 | msgstr "南洋理工大学" 102 | 103 | msgid "SJTU" 104 | msgstr "上海交通大学" 105 | 106 | msgid "CQUPT" 107 | msgstr "重庆邮电大学" 108 | 109 | msgid "Qilu University of Technology" 110 | msgstr "齐鲁工业大学" 111 | 112 | msgid "Boot" 113 | msgstr "启动" 114 | 115 | msgid "Delay before disk mounting" 116 | msgstr "挂载前等待磁盘" 117 | 118 | msgid "Wait for the hard disk to initialize to solve the problem that the hard disk is not mounted when some applications that rely on the hard disk are started." 119 | msgstr "等待硬盘初始化,以解决部分依赖硬盘的应用启动时硬盘还未挂载的问题" 120 | 121 | msgid "Do not select a network block device (e.g. NBD, iSCSI, etc.), you may have to wait until timeout." 122 | msgstr "请勿选择网络块设备(例如 NBD,iSCSI 等),可能必须等到超时" 123 | 124 | msgid "Timeout (seconds)" 125 | msgstr "超时(秒)" 126 | 127 | msgid "Or until these device(s) ready (UUID):" 128 | msgstr "或者直到这些磁盘准备好(UUID):" 129 | 130 | msgid "Samba expert" 131 | msgstr "Samba高级设置" 132 | 133 | msgid "Allow legacy protocols" 134 | msgstr "允许旧协议" 135 | 136 | msgid "Allow old client, don't use this option for secure environments!" 137 | msgstr "允许老客户端连接(例如一些电视盒或手机),可能有安全风险" 138 | 139 | msgid "Sandbox" 140 | msgstr "沙箱" 141 | 142 | msgid "Simple sandbox for OpenWRT" 143 | msgstr "一个简易沙箱" 144 | 145 | msgid "This action will reboot device" 146 | msgstr "此操作将重启设备" 147 | 148 | msgid "Commit" 149 | msgstr "提交" 150 | 151 | msgid "Reset" 152 | msgstr "重置" 153 | 154 | msgid "cpufreq/sb_info" 155 | msgstr "cpufreq/sb_info.zh-cn" 156 | 157 | msgid "cpufreq/sb_guide" 158 | msgstr "cpufreq/sb_guide.zh-cn" 159 | 160 | msgid "Network" 161 | msgstr "网络" 162 | 163 | msgid "Hardware Acceleration" 164 | msgstr "硬件加速" 165 | 166 | msgid "Enable PPPoE Acceleration" 167 | msgstr "启用PPPoE加速" 168 | 169 | msgid "Improve PPPoE TX performace, only support built-in NICs" 170 | msgstr "提升PPPoE发送(TX)性能,只支持内置网卡" 171 | 172 | msgid "Exit Sandbox" 173 | msgstr "退出沙箱" 174 | 175 | msgid "Enable WAN Port Acceleration" 176 | msgstr "启用WAN口加速" 177 | 178 | msgid "Improve built-in WAN port (eth0) TX performace" 179 | msgstr "提升WAN口(eth0)发送(TX)性能" 180 | 181 | msgid "Drivers" 182 | msgstr "驱动" 183 | 184 | msgid "Drivers Settings" 185 | msgstr "驱动设置" 186 | 187 | msgid "Realtek r8125 driver" 188 | msgstr "Realtek r8125 驱动" 189 | 190 | msgid "Realtek r8168 driver" 191 | msgstr "Realtek r8168 驱动" 192 | 193 | msgid "Backported Intel GPU driver (i915-oot)" 194 | msgstr "移植 Intel GPU 驱动 (i915-oot)" 195 | 196 | msgid "Enable additional drivers" 197 | msgstr "启用额外的驱动" 198 | 199 | msgid "Configure device drivers, kernel modules, etc. Changes here will take effect on next boot" 200 | msgstr "配置设备驱动程序,内核模块等。这里的变更将在下次启动时生效" 201 | 202 | msgid "Please do not choose a driver you do not understand. Choosing the wrong driver may cause the system to fail to start" 203 | msgstr "请勿选择不了解的驱动程序,选择错误可能导致系统无法启动" 204 | 205 | msgid "Kernel Cmdline" 206 | msgstr "内核启动参数" 207 | 208 | msgid "Current Cmdline" 209 | msgstr "当前内核启动参数" 210 | 211 | msgid "This page configures Linux kernel boot parameters. After saving and applying, the GRUB configuration file of the boot partition will be modified. The parameters will take effect after restarting the system (the boot partition is not within the scope of sandbox protection, please be aware)" 212 | msgstr "此页面可配置 Linux 内核启动参数。保存并应用以后将修改 boot 分区的 GRUB 配置文件,重启系统以后参数生效(boot分区不在沙箱保护范围,请知悉)" 213 | 214 | msgid "Supports PCI device passthrough for virtual machines (KVM/QEMU)" 215 | msgstr "用于支持虚拟机(KVM/QEMU)的 PCI 设备直通" 216 | 217 | msgid "Parameters" 218 | msgstr "参数" 219 | 220 | msgid "Default" 221 | msgstr "默认" 222 | 223 | msgid "Default or empty will be automatically filled in according to the current platform" 224 | msgstr "默认或者空将自动按当前平台填写" 225 | 226 | msgid "Custom Parameters" 227 | msgstr "自定义内核参数" 228 | 229 | msgid "Danger! If you do not understand the kernel boot parameters, do not modify them to avoid being unable to start or damaging the hardware" 230 | msgstr "前方危险!如果不了解内核启动参数,请勿修改,以免无法启动或损坏硬件" 231 | -------------------------------------------------------------------------------- /luci-app-cpufreq/root/etc/config/cpufreq: -------------------------------------------------------------------------------- 1 | config cpufreq 2 | # option governor 'ondemand' 3 | # option speed '1000000' 4 | -------------------------------------------------------------------------------- /luci-app-cpufreq/root/etc/config/tuning: -------------------------------------------------------------------------------- 1 | config ipk 2 | option mirror 'disable' 3 | -------------------------------------------------------------------------------- /luci-app-cpufreq/root/etc/config/tuning_boot: -------------------------------------------------------------------------------- 1 | config fstab_delay 2 | option enabled '0' 3 | -------------------------------------------------------------------------------- /luci-app-cpufreq/root/etc/config/tuning_net: -------------------------------------------------------------------------------- 1 | config hw_acct 2 | option wan_acct '1' 3 | option hw_pppoe '1' -------------------------------------------------------------------------------- /luci-app-cpufreq/root/etc/init.d/await_fstab: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=11 4 | 5 | boot() { 6 | local enabled=`uci get tuning_boot.@fstab_delay[0].enabled 2>/dev/null` 7 | [ -z "$enabled" -o "$enabled" = 0 ] && return 0 8 | 9 | local timeout=`uci get tuning_boot.@fstab_delay[0].timeout 2>/dev/null` 10 | [ -z "$timeout" -o "$timeout" = 0 ] && return 0 11 | 12 | local devices=`uci get tuning_boot.@fstab_delay[0].device 2>/dev/null` 13 | 14 | if [ -n "$devices" ]; then 15 | echo "fstab_delay: wait up to $timeout seconds for device(s): $devices" >/dev/kmsg 16 | local i=0 17 | local dev 18 | local ready 19 | while [ $i -lt $timeout ]; do 20 | ready=1 21 | for dev in $devices ; do 22 | blkid --uuid $dev >/dev/null 2>&1 || { ready=0; break; } 23 | done 24 | [ $ready -eq 1 ] && break 25 | sleep 1 26 | i=$(($i+1)) 27 | done 28 | if [ $i -lt $timeout ]; then 29 | echo "fstab_delay: ready after $i seconds" >/dev/kmsg 30 | else 31 | echo "fstab_delay: wait device(s) timeout" >/dev/kmsg 32 | fi 33 | else 34 | echo "fstab_delay: sleep $timeout seconds before fstab" >/dev/kmsg 35 | sleep $timeout 36 | fi 37 | return 0 38 | } 39 | -------------------------------------------------------------------------------- /luci-app-cpufreq/root/etc/init.d/cpufreq: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=20 4 | 5 | get_config() { 6 | config_get governor $1 governor 7 | config_get speed $1 speed 8 | } 9 | 10 | start() { 11 | config_load cpufreq 12 | config_foreach get_config cpufreq 13 | 14 | [[ -n "$governor" ]] || return 1 15 | 16 | local policy 17 | for policy in `ls /sys/devices/system/cpu/cpufreq/ | grep '^policy'`; do 18 | sh -c "echo '$governor' > /sys/devices/system/cpu/cpufreq/$policy/scaling_governor" 2>/dev/null 19 | [[ "$governor" = "userspace" && -n "$speed" ]] && sh -c "echo '$speed' > /sys/devices/system/cpu/cpufreq/$policy/scaling_setspeed" 2>/dev/null 20 | done 21 | 22 | return 0 23 | } -------------------------------------------------------------------------------- /luci-app-cpufreq/root/etc/init.d/tuning: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=20 4 | 5 | ipk_config() { 6 | config_get ipk_mirror $1 mirror "disable" 7 | } 8 | 9 | start() { 10 | config_load tuning 11 | config_foreach ipk_config ipk 12 | 13 | if [ "$ipk_mirror" != "disable" -a -f "/rom/etc/opkg/distfeeds.conf" ]; then 14 | echo "# Generated file, do not edit" > /etc/opkg/distfeeds.conf 15 | cat "/rom/etc/opkg/distfeeds.conf" | \ 16 | sed -E 's# https?://[^ ]+/openwrt/# https://downloads.openwrt.org/#g' | \ 17 | sed -E 's#https?://downloads.openwrt.org/#'"$ipk_mirror"'#g' >> /etc/opkg/distfeeds.conf 18 | fi 19 | 20 | return 0 21 | } 22 | -------------------------------------------------------------------------------- /luci-app-cpufreq/root/etc/init.d/tuning_net: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=19 4 | 5 | hwacct_config() { 6 | config_get wanacct_enabled $1 wan_acct "1" 7 | config_get hwpppoe_enabled $1 hw_pppoe "0" 8 | } 9 | 10 | boot() { 11 | local feature=`ethtool -k eth0 2>/dev/null | grep -F hw-pppoe: 2>/dev/null` 12 | [[ -n "$feature" ]] || return 1 13 | 14 | echo "$feature" | grep -qF '[fixed]' && return 1 15 | 16 | local hwpppoe_enabled 17 | local wanacct_enabled 18 | local hwpppoe=off 19 | local wanacct=on 20 | config_load tuning_net 21 | config_foreach hwacct_config hw_acct 22 | [ "$wanacct_enabled" = 0 ] && wanacct=off 23 | [ "$wanacct_enabled" = 1 -a "$hwpppoe_enabled" = 1 ] && hwpppoe=on 24 | 25 | ethtool -K eth0 hw-pppoe $hwpppoe tx-checksum-ip-generic $wanacct tx-scatter-gather $wanacct generic-receive-offload $wanacct 2>/dev/null 26 | ethtool -K eth1 hw-pppoe $hwpppoe 2>/dev/null 27 | 28 | return 0 29 | } 30 | 31 | start() { 32 | boot && /etc/init.d/network restart 33 | } 34 | -------------------------------------------------------------------------------- /luci-app-cpufreq/root/etc/uci-defaults/21_cpufreq: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete ucitrack.@cpufreq[-1] 5 | add ucitrack cpufreq 6 | set ucitrack.@cpufreq[-1].init=cpufreq 7 | commit ucitrack 8 | EOF 9 | 10 | exit 0 -------------------------------------------------------------------------------- /luci-app-cpufreq/root/etc/uci-defaults/21_tuning: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete ucitrack.@tuning[-1] 5 | add ucitrack tuning 6 | set ucitrack.@tuning[-1].init=tuning 7 | commit ucitrack 8 | EOF 9 | 10 | exit 0 -------------------------------------------------------------------------------- /luci-app-cpufreq/root/etc/uci-defaults/21_tuning_net: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | uci -q batch <<-EOF >/dev/null 4 | delete ucitrack.@tuning_net[-1] 5 | add ucitrack tuning_net 6 | set ucitrack.@tuning_net[-1].init=tuning_net 7 | commit ucitrack 8 | EOF 9 | 10 | exit 0 -------------------------------------------------------------------------------- /luci-app-fan/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Openwrt.org 2 | # 3 | # This is free software, licensed under the Apache License, Version 2.0 . 4 | # 5 | 6 | include $(TOPDIR)/rules.mk 7 | 8 | LUCI_TITLE:=LuCI fan control 9 | LUCI_DEPENDS:=+coreutils-stat 10 | LUCI_PKGARCH:=all 11 | PKG_VERSION:=1.0.0-r3 12 | PKG_RELEASE:= 13 | PKG_MAINTAINER:=jjm2473<%:Thermal zone%> | <%=self.thermal_zone%> (<%:type:%> <%=self.thermal_type%>) |
<%:Trip point%> | trip_point_<%=self.trip_point%> |
<%:Fan start temperature%> | |
<%:Current temperature%> |