Merge Mainline

This commit is contained in:
CN_SZTL 2020-12-19 21:15:16 +08:00
commit d9b3d71f34
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
7 changed files with 77 additions and 68 deletions

View File

@ -563,6 +563,7 @@ define Device/Build/image
SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \
IMAGE_NAME="$(IMAGE_NAME)" \
IMAGE_TYPE=$(word 1,$(subst ., ,$(2))) \
IMAGE_FILESYSTEM="$(1)" \
IMAGE_PREFIX="$(IMAGE_PREFIX)" \
DEVICE_VENDOR="$(DEVICE_VENDOR)" \
DEVICE_MODEL="$(DEVICE_MODEL)" \

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=Docker Manager interface for LuCI
LUCI_DEPENDS:=+luci-lib-docker +docker-ce +e2fsprogs +fdisk +ttyd
LUCI_DEPENDS:=+luci-lib-docker +docker +e2fsprogs +fdisk +ttyd
PKG_NAME:=luci-app-dockerman
PKG_VERSION:=v0.4.7
PKG_RELEASE:=leanmod

View File

@ -1,60 +1,69 @@
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
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")
s = mp:section(NamedSection, "cpufreq", "settings")
s.anonymouse = true
governor = s:option(ListValue, "governor", translate("CPU Scaling Governor"))
for _, e in ipairs(governor_array) do
if e ~= "" then governor:value(translate(e,string.upper(e))) end
local policy_nums = luci.sys.exec("echo -n $(find /sys/devices/system/cpu/cpufreq/policy* -maxdepth 0 | grep -Eo '[0-9]+')")
for _, policy_num in ipairs(string.split(policy_nums, " ")) do
if not fs.access("/sys/devices/system/cpu/cpufreq/policy" .. policy_num .. "/scaling_available_frequencies") then return end
cpu_freqs = fs.readfile("/sys/devices/system/cpu/cpufreq/policy" .. policy_num .. "/scaling_available_frequencies")
cpu_freqs = string.sub(cpu_freqs, 1, -3)
cpu_governors = fs.readfile("/sys/devices/system/cpu/cpufreq/policy" .. policy_num .. "/scaling_available_governors")
cpu_governors = string.sub(cpu_governors, 1, -3)
freq_array = string.split(cpu_freqs, " ")
governor_array = string.split(cpu_governors, " ")
s:tab(policy_num, translate("Policy " .. policy_num))
governor = s:taboption(policy_num, ListValue, "governor" .. policy_num, translate("CPU Scaling Governor"))
for _, e in ipairs(governor_array) do
if e ~= "" then governor:value(translate(e,string.upper(e))) end
end
minfreq = s:taboption(policy_num, ListValue, "minfreq" .. policy_num, translate("Min Idle CPU Freq"))
for _, e in ipairs(freq_array) do
if e ~= "" then minfreq:value(e) end
end
maxfreq = s:taboption(policy_num, ListValue, "maxfreq" .. policy_num, translate("Max Turbo Boost CPU Freq"))
for _, e in ipairs(freq_array) do
if e ~= "" then maxfreq:value(e) end
end
upthreshold = s:taboption(policy_num, Value, "upthreshold" .. policy_num, translate("CPU Switching Threshold"))
upthreshold.datatype="range(1,99)"
upthreshold.description = translate("Kernel make a decision on whether it should increase the frequency (%)")
upthreshold.placeholder = 50
upthreshold.default = 50
upthreshold:depends("governor", "ondemand")
factor = s:taboption(policy_num, Value, "factor" .. policy_num, translate("CPU Switching Sampling rate"))
factor.datatype="range(1,100000)"
factor.description = translate("The sampling rate determines how frequently the governor checks to tune the CPU (ms)")
factor.placeholder = 10
factor.default = 10
factor:depends("governor", "ondemand")
end
minfreq = s:option(ListValue, "minfreq", 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)"
upthreshold.description = translate("Kernel make a decision on whether it should increase the frequency (%)")
upthreshold.placeholder = 50
upthreshold.default = 50
upthreshold:depends("governor", "ondemand")
factor = s:option(Value, "factor", translate("CPU Switching Sampling rate"))
factor.datatype="range(1,100000)"
factor.description = translate("The sampling rate determines how frequently the governor checks to tune the CPU (ms)")
factor.placeholder = 10
factor.default = 10
factor:depends("governor", "ondemand")
return mp

View File

@ -1,8 +1,3 @@
config settings 'cpufreq'
option governor ''
option minfreq ''
option maxfreq ''
option upthreshold '50'
option factor '10'

View File

@ -3,22 +3,25 @@ START=50
NAME="cpufreq"
config_get_cpufreq()
{
config_get "$NAME" "$1"
}
start()
{
config_load cpufreq
config_get "governor" "${NAME}" "governor"
config_get "minfreq" "${NAME}" "minfreq"
config_get "maxfreq" "${NAME}" "maxfreq"
config_get "upthreshold" "${NAME}" "upthreshold" "50"
config_get "factor" "${NAME}" "factor" "10"
config_load "$NAME"
[ -z "${governor}" ] && exit 0
for i in $(find /sys/devices/system/cpu/cpufreq/policy* -maxdepth 0 | grep -Eo '[0-9]+')
do
[ -z "$(config_get_cpufreq "governor$i")" ] && return
echo "${governor}" > "/sys/devices/system/cpu/cpufreq/policy0/scaling_governor"
echo "${minfreq}" > "/sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq"
echo "${maxfreq}" > "/sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq"
if [ "${governor}" = "ondemand" ]; then
echo "${upthreshold}" > "/sys/devices/system/cpu/cpufreq/ondemand/up_threshold"
echo "${factor}" > "/sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor"
fi
config_get_cpufreq "governor$i" > "/sys/devices/system/cpu/cpufreq/policy$i/scaling_governor"
config_get_cpufreq "minfreq$i" > "/sys/devices/system/cpu/cpufreq/policy$i/scaling_min_freq"
config_get_cpufreq "maxfreq$i" > "/sys/devices/system/cpu/cpufreq/policy$i/scaling_max_freq"
if [ "$(config_get_cpufreq "governor$i")" = "ondemand" ]; then
config_get_cpufreq "upthreshold$i" > "/sys/devices/system/cpu/cpufreq/ondemand/up_threshold"
config_get_cpufreq "factor$i" > "/sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor"
fi
done
}

View File

@ -51,6 +51,7 @@ image_info = {
"images": [
{
"type": getenv("IMAGE_TYPE"),
"filesystem": getenv("IMAGE_FILESYSTEM"),
"name": getenv("IMAGE_NAME"),
"sha256": image_hash,
}

View File

@ -8,8 +8,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libressl
PKG_VERSION:=3.2.1
PKG_HASH:=d28db224cfb6d18009b2a7e8cb213cd5c943bbec87550062fef6a38479250315
PKG_VERSION:=3.3.1
PKG_HASH:=a6d331865e0164a13ac85a228e52517f7cf8f8488f2f95f34e7857302f97cfdb
PKG_RELEASE:=1
PKG_CPE_ID:=cpe:/a:openbsd:libressl