Merge Mainline

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2021-05-09 22:02:09 +08:00
commit b3be7ef94b
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
12 changed files with 99 additions and 51 deletions

View File

@ -65,11 +65,22 @@ $(eval $(call TestHostCommand,perl-data-dumper, \
Please install the Perl Data::Dumper module, \
perl -MData::Dumper -e 1))
$(eval $(call TestHostCommand,perl-findbin, \
Please install the Perl FindBin module, \
perl -MFindBin -e 1))
$(eval $(call TestHostCommand,perl-file-copy, \
Please install the Perl File::Copy module, \
perl -MFile::Copy -e 1))
$(eval $(call TestHostCommand,perl-file-compare, \
Please install the Perl File::Compare module, \
perl -MFile::Compare -e 1))
$(eval $(call TestHostCommand,perl-thread-queue, \
Please install the Perl Thread::Queue module, \
perl -MThread::Queue -e 1))
$(eval $(call SetupHostCommand,tar,Please install GNU 'tar', \
gtar --version 2>&1 | grep GNU, \
gnutar --version 2>&1 | grep GNU, \

View File

@ -3,7 +3,7 @@
net.netfilter.nf_conntrack_acct=1
net.netfilter.nf_conntrack_checksum=0
net.netfilter.nf_conntrack_max=65535
net.netfilter.nf_conntrack_max=65536
net.netfilter.nf_conntrack_tcp_timeout_established=7440
net.netfilter.nf_conntrack_udp_timeout=60
net.netfilter.nf_conntrack_udp_timeout_stream=180

View File

@ -221,24 +221,6 @@ endef
$(eval $(call KernelPackage,fb-tft-ili9486))
define KernelPackage/multimedia-input
SUBMENU:=$(VIDEO_MENU)
TITLE:=Multimedia input support
KCONFIG:=CONFIG_RC_CORE \
CONFIG_LIRC=y \
CONFIG_RC_DECODERS=y \
CONFIG_RC_DEVICES=y
FILES:=$(LINUX_DIR)/drivers/media/rc/rc-core.ko
AUTOLOAD:=$(call AutoProbe,rc-core)
endef
define KernelPackage/multimedia-input/description
Enable multimedia input.
endef
$(eval $(call KernelPackage,multimedia-input))
define KernelPackage/drm
SUBMENU:=$(VIDEO_MENU)
TITLE:=Direct Rendering Manager (DRM) support

View File

@ -1,16 +1,15 @@
# Copyright (C) 2016 Openwrt.org
#
# This is free software, licensed under the Apache License, Version 2.0 .
# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021 ImmortalWrt.org
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI for CPU Freq Setting
LUCI_DEPENDS:=@(arm||aarch64)
PKG_NAME:=luci-app-cpufreq
PKG_VERSION:=1
PKG_RELEASE:=6
PKG_RELEASE:=$(COMMITCOUNT)
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -50,20 +50,19 @@ for _, policy_num in ipairs(string.split(policy_nums, " ")) do
if e ~= "" then maxfreq:value(e) end
end
sdfactor = s:taboption(policy_num, Value, "sdfactor" .. policy_num, translate("CPU Switching Sampling rate"))
sdfactor.datatype="range(1,100000)"
sdfactor.description = translate("The sampling rate determines how frequently the governor checks to tune the CPU (ms)")
sdfactor.placeholder = 10
sdfactor.default = 10
sdfactor:depends("governor", "ondemand")
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
return mp

View File

@ -32,14 +32,14 @@ msgstr "待机 CPU 最小频率"
msgid "Max Turbo Boost CPU Freq"
msgstr "最大 Turbo Boost CPU 频率"
msgid "CPU Switching Threshold"
msgstr "CPU 切换频率触发阈值"
msgid "Kernel make a decision on whether it should increase the frequency (%)"
msgstr "当 CPU 占用率超过 (%) 的情况下触发内核切换频率"
msgid "CPU Switching Sampling rate"
msgstr "CPU 切换周期"
msgid "The sampling rate determines how frequently the governor checks to tune the CPU (ms)"
msgstr "CPU 检查切换的周期 (ms)。注意:过于频繁的切换频率会引起网络延迟抖动"
msgid "CPU Switching Threshold"
msgstr "CPU 切换频率触发阈值"
msgid "Kernel make a decision on whether it should increase the frequency (%)"
msgstr "当 CPU 占用率超过 (%) 的情况下触发内核切换频率"

View File

@ -20,8 +20,8 @@ start()
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 "sdfactor$i" > "/sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor"
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

@ -1,5 +1,37 @@
#!/bin/sh
uci_write_config() {
uci -q set cpufreq.cpufreq.governor$1="$2"
uci -q set cpufreq.cpufreq.minfreq$1="$3"
uci -q set cpufreq.cpufreq.maxfreq$1="$4"
[ -n "$5" ] && uci -q set cpufreq.cpufreq.sdfactor$1="$5"
[ -n "$6" ] && uci -q set cpufreq.cpufreq.upthreshold$1="$6"
uci -q commit cpufreq
}
CPU_POLICYS="$(find '/sys/devices/system/cpu/cpufreq/policy'* -maxdepth 0 | grep -Eo '[0-9]+')"
source "/etc/openwrt_release"
case "$DISTRIB_TARGET" in
"bcm27xx/bcm2710")
uci_write_config 0 ondemand 600000 1200000 10 50
;;
"ipq40xx")
uci_write_config 0 ondemand 300000 716000 10 50
;;
"ipq806x")
uci_write_config 0 ondemand 600000 716000 10 50
echo "$CPU_POLICYS" | grep -q "1" && uci_write_config 1 ondemand 600000 716000 10 50
;;
"rockchip/armv8")
if echo "$CPU_POLICYS" | grep -q "4"; then
uci_write_config 0 schedutil 600000 1608000
uci_write_config 4 schedutil 600000 2016000
else
uci_write_config 0 schedutil 816000 1512000
fi
;;
esac
uci -q batch <<-EOF >/dev/null
delete ucitrack.@cpufreq[-1]
add ucitrack cpufreq

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=uqmi
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/uqmi.git

View File

@ -195,19 +195,36 @@ proto_qmi_setup() {
uqmi -s -d "$device" --sync > /dev/null 2>&1
uqmi -s -d "$device" --network-register > /dev/null 2>&1
echo "Waiting for network registration"
sleep 1
local registration_timeout=0
while uqmi -s -d "$device" --get-serving-system | grep '"searching"' > /dev/null; do
[ -e "$device" ] || return 1
if [ "$registration_timeout" -lt "$timeout" -o "$timeout" = "0" ]; then
let registration_timeout++
sleep 1;
local registration_state=""
while true; do
registration_state=$(uqmi -s -d "$device" --get-serving-system 2>/dev/null | jsonfilter -e "@.registration" 2>/dev/null)
[ "$registration_state" = "registered" ] && break
if [ "$registration_state" = "searching" ] || [ "$registration_state" = "not_registered" ]; then
if [ "$registration_timeout" -lt "$timeout" ] || [ "$timeout" = "0" ]; then
[ "$registration_state" = "searching" ] || {
echo "Device stopped network registration. Restart network registration"
uqmi -s -d "$device" --network-register > /dev/null 2>&1
}
let registration_timeout++
sleep 1
continue
fi
echo "Network registration failed, registration timeout reached"
else
echo "Network registration failed"
proto_notify_error "$interface" NETWORK_REGISTRATION_FAILED
proto_block_restart "$interface"
return 1
# registration_state is 'registration_denied' or 'unknown' or ''
echo "Network registration failed (reason: '$registration_state')"
fi
proto_notify_error "$interface" NETWORK_REGISTRATION_FAILED
proto_block_restart "$interface"
return 1
done
[ -n "$modes" ] && uqmi -s -d "$device" --set-network-modes "$modes" > /dev/null 2>&1

View File

@ -29,6 +29,8 @@ $(BIN_DIR)/$(IB_NAME).tar.xz: clean
mkdir -p $(IB_KDIR) $(IB_LDIR) $(PKG_BUILD_DIR)/staging_dir/host/lib \
$(PKG_BUILD_DIR)/target $(PKG_BUILD_DIR)/scripts $(IB_DTSDIR)
-cp $(TOPDIR)/.config $(PKG_BUILD_DIR)/.config
$(SED) 's/^CONFIG_BINARY_FOLDER=.*/# CONFIG_BINARY_FOLDER is not set/' $(PKG_BUILD_DIR)/.config
$(SED) 's/^CONFIG_DOWNLOAD_FOLDER=.*/# CONFIG_DOWNLOAD_FOLDER is not set/' $(PKG_BUILD_DIR)/.config
$(CP) -L \
$(INCLUDE_DIR) $(SCRIPT_DIR) \
$(TOPDIR)/rules.mk \

View File

@ -9,7 +9,13 @@ while (<>) {
chomp;
next if /^CONFIG_SIGNED_PACKAGES/;
if (/^CONFIG_([^=]+)=(.*)$/) {
if (/^CONFIG_((BINARY)|(DOWNLOAD))_FOLDER=(.*)$/) {
# We don't want to preserve the build setting of
# BINARY_FOLDER and DOWNLOAD_FOLDER.
$var = "$1_FOLDER";
$val = '""';
$type = "string";
} elsif (/^CONFIG_([^=]+)=(.*)$/) {
$var = $1;
$val = $2;