update 2026-05-10 09:48:30

This commit is contained in:
action committed 2026-05-10 09:48:30 +08:00
1 parent 95ac96413e
commit 0b362674f1
6244 files changed
+2992248

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
#!/bin/ash
/bin/coremark | grep "CoreMark 1.0" | cut -d "/" -f 1 | cut -d "." -f -2 | sed -e 's/CoreMark 1.0\(.*\)/(CpuMark\1 Scores)/g' | tee /etc/bench.log
+55
View File
@@ -0,0 +1,55 @@
#!/bin/sh
board_name() {
[ -e /tmp/sysinfo/board_name ] && cat /tmp/sysinfo/board_name || echo "generic"
}
wifi_setup_radio(){
local radio=$1
htmode="$(uci -q get wireless.${radio}.htmode)"
if uci -q get wireless.${radio} >/dev/null; then
uci -q del wireless.${radio}.disabled
uci -q set wireless.${radio}.country='CN'
if [ "$(uci -q get wireless.${radio}.band)" = "5g" ]; then
uci -q set wireless.default_${radio}.ssid="${SSID}_5G"
if [[ "$DISTRIB_TARGET" == *ipq60xx ]]; then
uci set wireless.${radio}.htmode='HE80'
fi
elif [ "$(uci -q get wireless.${radio}.band)" = "2g" ]; then
uci -q set wireless.default_${radio}.ssid="${SSID}_2.4G"
fi
uci -q set wireless.default_${radio}.device="${radio}"
SSID_PASSWD="${SSID_PASSWD:-$(uci -q get wireless.default_${radio}.key)}"
if [ "${SSID_PASSWD}" ]; then
uci -q set wireless.default_${radio}.encryption='psk2'
uci -q set wireless.default_${radio}.key="${SSID_PASSWD}"
else
uci -q set wireless.default_${radio}.encryption='none'
fi
fi
}
for i in $(seq 1 10); do
[[ "$(uci -q get base_config.@status[0].inited)" == 1 && "$(cat /etc/config/wireless)" ]] && break
[ "$(cat /etc/config/wireless)" ] || /sbin/wifi config
sleep 1s
done
if [[ "$(cat /etc/config/wireless)" ]]; then
. /etc/openwrt_release
SSID="$(uci -q get wizard.default.wifi_ssid || uci -q get system.@system[0].hostname || echo Kwrt)"
SSID_PASSWD="$(uci -q get wizard.default.wifi_key)"
sed -i '/option disabled/d' /etc/config/wireless
[ "$(uci -q get wireless.radio1.band)" == "5g" ] && uci -q set wireless.radio0.band="2g"
widx=0
while uci rename wireless.@wifi-iface[$widx]=default_radio$widx >/dev/null 2>&1; do widx=$((widx+1)); done
for radio in radio0 radio1 radio2 radio3; do
wifi_setup_radio ${radio}
done
uci commit wireless
uci -q set base_config.@status[0].wifi=1
uci commit base_config
/sbin/wifi reload
fi
+68
View File
@@ -0,0 +1,68 @@
#!/bin/ash
# 默认使用关机命令
ACTION="poweroff"
# 获取shutdown参数
# Qemu-GA 默认调用 -h -P +0的方式
while [ -n "$1" ]; do
case "$1" in
-r)
ACTION="reboot"
shift
;;
-k)
ACTION="warning"
shift
;;
-h|-H)
ACTION="halt"
shift
;;
-n)
ACTION="poweroff"
shift
;;
-c)
echo "Cancel shutdown, but not support the Openwrt!" > /dev/kmsg
ACTION="stop"
shift
;;
-p|-P)
ACTION="poweroff"
shift
;;
-*)
shift
;;
*)
break
;;
esac
done
if [ $# == 0 ]; then
echo "Shutting down without any params" > /dev/kmsg
/sbin/poweroff
elif [ "$ACTION" = "poweroff" ]; then
/sbin/poweroff;
elif [ "$ACTION" = "reboot" ]; then
/sbin/reboot
elif [ "$ACTION" = "warning" ]; then
echo "关机警告">/dev/kmsg
/sbin/poweroff;
elif [ "$ACTION" = "halt" ]; then
/sbin/halt
fi