29cf67154a
基于 v46 正式版(mt76)只恢复 UI 层: - luci-theme-argon 2.4.3: local-background-wins 登录页 + bg1.jpg fallback - luci-app-argon-config: 去 ui.changes.apply, ACL mutator 移 write - luci-app-wgtunnel: rpcd ucode 后端(get/status/prepare/apply/rollback/reconnect), JSONMap 前端, 60s 一次性 token, 快照回滚, 无全局 network ACL - luci-app-tr3000-status: 只读 rpcd ucode + 5s 轮询仪表盘 - tools/: audit_ui_packages.py + install_preview.sh + rollback_watchdog.sh - docs/: 开发经历与翻车记录 + 固件哈希记录 固件本体(含烤入 WG 私钥/PSK)不入 git, 仅 K 盘保存. kernel 成员与 v46 byte-identical; 尚未刷机.
87 lines
2.0 KiB
Bash
87 lines
2.0 KiB
Bash
#!/bin/sh
|
|
# v46.1 UI-only live install helper
|
|
# - Only installs the 5 audited IPKs (NO opkg update, NO network/firewall/wifi changes)
|
|
# - Pre-checks live immutable hashes, then installs, then post-checks
|
|
# - All operations are idempotent; safe to re-run after a partial failure
|
|
set -eu
|
|
|
|
BASE=/tmp/v46.1-ui
|
|
mkdir -p "$BASE"
|
|
cd "$BASE"
|
|
|
|
PKGS="
|
|
luci-theme-argon_2.4.3-r20250722_all.ipk
|
|
luci-app-argon-config_26.187.07912~668cdc6_all.ipk
|
|
luci-i18n-argon-config-zh-cn_26.187.07912~668cdc6_all.ipk
|
|
luci-app-wgtunnel_0_all.ipk
|
|
luci-app-tr3000-status_0_all.ipk
|
|
"
|
|
|
|
IMMU="
|
|
/etc/config/network
|
|
/etc/config/firewall
|
|
/etc/config/dhcp
|
|
/etc/config/wireless
|
|
/etc/rc.local
|
|
/etc/hotplug.d/iface/20-vxlan
|
|
/etc/hotplug.d/iface/30-mss-clamp
|
|
/usr/share/nftables.d/chain-pre/mangle_forward/30-mss-clamp.nft
|
|
"
|
|
|
|
sha256() { sha256sum "$1" 2>/dev/null | awk '{print $1}'; }
|
|
|
|
echo "=== pre-install snapshot ==="
|
|
{
|
|
for f in $IMMU; do
|
|
s=$(sha256 "$f" 2>/dev/null) || s=missing
|
|
printf "%s %s\n" "$s" "$f"
|
|
done
|
|
} > pre.sha256
|
|
cat pre.sha256
|
|
|
|
missing=""
|
|
for p in $PKGS; do
|
|
if [ ! -f "$BASE/$p" ]; then
|
|
missing="$missing $p"
|
|
fi
|
|
done
|
|
if [ -n "$missing" ]; then
|
|
echo "FAIL: missing IPK files in $BASE:$missing"
|
|
exit 1
|
|
fi
|
|
|
|
for p in $PKGS; do
|
|
echo "=== opkg install --force-reinstall $p ==="
|
|
opkg install --force-reinstall --noaction "$p" || true
|
|
done
|
|
|
|
for p in $PKGS; do
|
|
opkg install --force-reinstall "$p"
|
|
done
|
|
|
|
# Keep the active theme on Bootstrap until admin chooses Argon.
|
|
# To activate Argon:
|
|
# uci set luci.main.mediaurlbase=/luci-static/argon
|
|
# uci commit luci
|
|
# /etc/init.d/rpcd restart; /etc/init.d/uhttpd restart
|
|
|
|
rm -rf /tmp/luci-cache /tmp/luci-indexcache 2>/dev/null || true
|
|
/etc/init.d/rpcd restart
|
|
/etc/init.d/uhttpd restart
|
|
|
|
echo "=== post-install snapshot ==="
|
|
{
|
|
for f in $IMMU; do
|
|
s=$(sha256 "$f" 2>/dev/null) || s=missing
|
|
printf "%s %s\n" "$s" "$f"
|
|
done
|
|
} > post.sha256
|
|
cat post.sha256
|
|
|
|
if cmp -s pre.sha256 post.sha256; then
|
|
echo "PASS: immutable files unchanged"
|
|
else
|
|
echo "FAIL: immutable files differ; diff:"
|
|
diff -u pre.sha256 post.sha256 || true
|
|
fi
|