update-12.01

This commit is contained in:
github-actions[bot] 2021-12-01 22:50:52 +08:00
parent 65e2d5e836
commit 426f1ac2c6
15 changed files with 724 additions and 677 deletions

View File

@ -8,8 +8,8 @@ appname = "gpsysupgrade"
curl = "/usr/bin/curl"
curl_args = {"-skfL", "--connect-timeout 3", "--retry 3"}
wget = "/usr/bin/wget"
wget_args = {"--no-check-certificate", "--quiet", "--timeout=100", "--tries=3"}
command_timeout = 40
wget_args = {"--quiet", "--connect-timeout=3", "--timeout=6", "--tries=2"}
command_timeout = 60
LEDE_BOARD = nil
DISTRIB_TARGET = nil

View File

@ -96,7 +96,7 @@ function to_download(url,md5)
local tmp_file = util.trim(util.exec("mktemp -u -t firmware_download.XXXXXX"))
local result = api.exec(api.curl, {api._unpack(api.curl_args), "-o", tmp_file, url}, nil, api.command_timeout) == 0
local result = api.exec(api.wget, {api._unpack(api.wget_args), "-O", tmp_file, url}, nil, api.command_timeout) == 0
if not result then
api.exec("/bin/rm", {"-f", tmp_file})

View File

@ -2,8 +2,8 @@
local fs = require "nixio.fs"
local uci = require 'luci.model.uci'.cursor()
if fs.access('/etc/config/system') then
autoupgrade_fm = uci:get_first('system', 'system', 'autoupgrade_fm', '1')
if fs.access('/etc/config/wizard') then
autoupgrade_fm = uci:get('wizard', 'default', 'autoupgrade_fm')
end
if autoupgrade_fm ~= '0' then
-%>

View File

@ -50,7 +50,7 @@ msgid "New version found, but failed to get new version download url."
msgstr "发现新版本,但未能获得新版本的下载地址。"
msgid "File download failed or timed out: %s"
msgstr "固件下载失败或超时:%s"
msgstr "固件下载失败或超时, 请重试. 或下载%s 到本地, 通过 系统->备份/升级 上传更新."
msgid "Firmware file required."
msgstr "固件文件未找到。"

View File

@ -26,9 +26,9 @@ fi
c2=0
c3=0
c4=0
while ! curl --retry 3 -m 5 https://op.dllkids.xyz >/dev/null 2>&1;do
while ! curl --retry 3 -m 5 https://op.supes.top >/dev/null 2>&1;do
echo "无法连接仓库服务器,请检查网络. $c1" | sed -e "s/^/$(date +%Y-%m-%d" "%H:%M:%S) /" >>/tmp/opkgupdate.log
[ $c1 eq 120 ] && return || let c1++
[ $c1 -eq 120 ] && return || let c1++
sleep 5
done
while :; do
@ -41,9 +41,12 @@ fi
upopkg="$insed $def"
if [ "$upopkg" != " " ]; then
for ipk in $upopkg; do
while [ ! "$(opkg list-installed | cut -f 1 -d ' ' | grep -w $ipk)" ]; do
while :; do
opkg install --force-overwrite --force-checksum --force-depends $ipk 2>&1 | sed -e "s/^/$(date +%Y-%m-%d" "%H:%M:%S) /" >>/tmp/opkgupdate.log 2>&1 || true
[ $c2 eq 3 ] && {
[[ "$(opkg list-installed | cut -f 1 -d ' ' | grep -w $ipk)" ]] && {
break
}
[ $c2 -eq 3 ] && {
echo $ipk >> $BKOPKG/failed.txt
sed -i "/^$ipk$/d" $BKOPKG/user_installed.opkg
break
@ -52,7 +55,7 @@ fi
rm -f /var/lock/opkg.lock
done
if [[ $ipk == luci-app-* ]]; then
opkg install --force-overwrite --force-checksum luci-i18n-"$(echo $ipk | cut -d - -f 3-4)"-zh-cn 2>&1 | sed -e "s/^/$(date +%Y-%m-%d" "%H:%M:%S) /" >>/tmp/opkgupdate.log 2>&1 || true
opkg install --force-overwrite --force-checksum luci-i18n-"$(echo $ipk | cut -d - -f 3-)"-zh-cn 2>&1 | sed -e "s/^/$(date +%Y-%m-%d" "%H:%M:%S) /" >>/tmp/opkgupdate.log 2>&1 || true
fi
done
rm -f /etc/config/*-opkg
@ -70,29 +73,29 @@ fi
rm -f /var/lock/opkg.lock
done
if [[ $ipk == luci-app-* ]]; then
opkg install --force-overwrite --force-checksum luci-i18n-"$(echo $ipk | cut -d - -f 3-4)"-zh-cn 2>&1 | sed -e "s/^/$(date +%Y-%m-%d" "%H:%M:%S) /" >>/tmp/opkgupdate.log 2>&1 || true
opkg install --force-overwrite --force-checksum luci-i18n-"$(echo $ipk | cut -d - -f 3-)"-zh-cn 2>&1 | sed -e "s/^/$(date +%Y-%m-%d" "%H:%M:%S) /" >>/tmp/opkgupdate.log 2>&1 || true
fi
mv $BKOPKG/failed.txt $BKOPKG/failed_.txt >/dev/null 2>&1
touch /etc/inited
rm -f /var/lock/opkg.lock
break
fi
[ $c3 eq 10 ] && break || let c3++
[ $c3 -eq 10 ] && break || let c3++
done
rm -f /var/lock/opkg.lock
}
(
if [[ ! -f /etc/inited || -f $BKOPKG/failed.txt ]]; then
opkgupgrade || true
elif [[ -f /etc/inited && `uci -q get system.@system[0].autoupgrade_pkg || echo "1"` != '0' ]]; then
elif [[ -f /etc/inited && "$(uci -q get wizard.default.autoupgrade_pkg)" != '0' ]]; then
opkgupgrade || true
fi
rm -f /var/lock/opkg.lock
[[ -f "/bin/coremark" && ! -f "/etc/bench.log" ]] && {
[[ -f "/bin/coremark" && ! -f "/etc/bench.log" && "$(uci -q get wizard.default.coremark)" == '1' ]] && {
sleep 5
/bin/coremark >/tmp/coremark.log
cat /tmp/coremark.log | grep "CoreMark 1.0" | cut -d "/" -f 1 >/etc/bench.log
cat /tmp/coremark.log | grep "CoreMark 1.0" | cut -d "/" -f 1 | cut -d "." -f -2 >/etc/bench.log
sed -i 's/CoreMark 1.0/(CpuMark/g' /etc/bench.log
echo " Scores)" >>/etc/bench.log
}

View File

@ -57,6 +57,8 @@ define Package/my-autocore-arm/install
endef
define Package/my-autocore-x86/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/x86/autocore $(1)/etc/init.d/autocore
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) ./files/x86/cpuinfo $(1)/sbin/cpuinfo
$(INSTALL_BIN) ./files/common/ethinfo $(1)/sbin/ethinfo

View File

@ -0,0 +1,50 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2017 lean <coolsnowwolf@gmail.com>
START=99
start()
{
rfc=4096
cc=$(grep -c processor /proc/cpuinfo)
rsfe=$(echo $cc*$rfc | bc)
sysctl -w net.core.rps_sock_flow_entries=$rsfe >/dev/null
for fileRps in $(ls /sys/class/net/eth*/queues/rx-*/rps_cpus)
do
echo $cc > $fileRps
done
for fileRfc in $(ls /sys/class/net/eth*/queues/rx-*/rps_flow_cnt)
do
echo $rfc > $fileRfc
done
uci set network.@globals[0].packet_steering=1
uci commit network
a=$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq)
b=$(echo -n ' : ')
c=$(cat /proc/cpuinfo | grep 'core id' | sort -u | wc -l)
d=$(echo -n ' Core ')
e=$(cat /proc/cpuinfo | grep 'processor' | wc -l)
f=$(echo -n ' Thread ')
g=${b}${c}${d}${e}${f}
mkdir -p /tmp/sysinfo
sed -i "s/\(.\+\)/\1$g /" /tmp/sysinfo/model
a=$(ip address | grep ^[0-9] | awk -F: '{print $2}' | sed "s/ //g" | grep '^[e]' | grep -v "@" | grep -v "\.")
b=$(echo "$a" | wc -l)
for i in $(seq 1 $b)
do
c=$(echo "$a" | sed -n ${i}p)
ethtool -K $c rx-checksum on >/dev/null 2>&1
ethtool -K $c tx-checksum-ip-generic on >/dev/null 2>&1 || (
ethtool -K $c tx-checksum-ipv4 on >/dev/null 2>&1
ethtool -K $c tx-checksum-ipv6 on >/dev/null 2>&1)
ethtool -K $c tx-scatter-gather on >/dev/null 2>&1
ethtool -K $c gso on >/dev/null 2>&1
ethtool -K $c tso on >/dev/null 2>&1
ethtool -K $c ufo on >/dev/null 2>&1
done
}

View File

@ -89,7 +89,6 @@ function storage_info()
# query various systems and send some stuff to the background for overall faster execution.
# Works only with ambienttemp and batteryinfo since A20 is slow enough :)
ip_address=$(get_ip_addresses &)
storage_info
critical_load=$(( 1 + $(grep -c processor /proc/cpuinfo) / 2 ))
@ -120,6 +119,17 @@ swap_info=$(LC_ALL=C free -m | grep "^Swap")
swap_usage=$( (awk '/Swap/ { printf("%3.0f", $3/$2*100) }' <<<${swap_info} 2>/dev/null || echo 0) | tr -c -d '[:digit:]')
swap_total=$(awk '{print $(2)}' <<<${swap_info})
[ ! -f /etc/config/network ] && {
printf " System initializing please wait..."
echo ""
echo ""
}
c=0
while [ ! -f /etc/config/network ];do
[ $c -eq 8 ] && break || let c++
sleep 1
done
ip_address="$(get_ip_addresses)"
# display info
display "系统负载" "${load%% *}" "${critical_load}" "0" "" "${load#* }"
@ -132,20 +142,11 @@ display "交换内存" "$swap_usage" "10" "0" " %" " of $swap_total""Mb"
printf "IP 地址: \x1B[92m%s\x1B[0m" "$ip_address"
echo "" # fixed newline
a=0;b=0;c=0
display "CPU 温度" "$board_temp" "45" "0" "°C" "" ; a=$?
display "环境温度" "$amb_temp" "40" "0" "°C" "" ; b=$?
(( ($a+$b) >0 )) && echo "" # new line only if some value is displayed
display "启动存储" "$boot_usage" "90" "1" "%" " of $boot_total"
display "系统存储" "$root_usage" "90" "1" "%" " of $root_total"
printf "CPU 信息: \x1B[92m%s\x1B[0m\t" "$(/sbin/cpuinfo)"
echo ""
display "数据存储" "$data_usage" "90" "1" "%" " of $data_total"
display "媒体存储" "$media_usage" "90" "1" "%" " of $media_total"
echo ""
echo ""

View File

@ -158,12 +158,3 @@ msgstr "客户端缓存的最小 DNS TTL"
msgid "Modify DNS entries minimum TTL (max is 86400, 0 is no modify)"
msgstr "修改发送到客户端的域名记录的 TTL 时间 (最大 86400, 0 表示不修改)"
msgid "Firmware Settings"
msgstr "固件设置"
msgid "Packages Auto Upgrade"
msgstr "软件包自动更新"
msgid "Firmware Upgrade Notice"
msgstr "固件更新提醒"