chore: 优化开机初始化脚本

This commit is contained in:
Del Wang
2026-01-01 17:06:10 +08:00
parent 2027a61877
commit b07e7500c1
7 changed files with 9 additions and 10 deletions
-2
View File
@@ -13,8 +13,6 @@ v1.0.0 by: https://del.wang
EOF EOF
set -e
# 等待能够正常访问 baidu.com # 等待能够正常访问 baidu.com
while ! ping -c 1 baidu.com > /dev/null 2>&1; do while ! ping -c 1 baidu.com > /dev/null 2>&1; do
echo "🤫 等待网络连接中..." echo "🤫 等待网络连接中..."
+4 -2
View File
@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
set -eu exec > /dev/null 2>&1
WORK_DIR="/data/open-xiaoai" WORK_DIR="/data/open-xiaoai"
APP_BINARY="$WORK_DIR/stereo" APP_BINARY="$WORK_DIR/stereo"
@@ -24,6 +24,8 @@ while ! ping -c 1 baidu.com > /dev/null 2>&1; do
sleep 1 sleep 1
done done
sleep 3
echo "✅ 网络连接成功" echo "✅ 网络连接成功"
main() { main() {
@@ -60,7 +62,7 @@ main() {
# 6. 启动程序 # 6. 启动程序
echo "🔥 Stereo 立体声程序启动中..." echo "🔥 Stereo 立体声程序启动中..."
exec "$APP_BINARY" $ARGS "$APP_BINARY" $ARGS
} }
main "$@" main "$@"
-2
View File
@@ -13,8 +13,6 @@ v1.0.0 by: https://del.wang
EOF EOF
set -e
# 等待能够正常访问 baidu.com # 等待能够正常访问 baidu.com
while ! ping -c 1 baidu.com > /dev/null 2>&1; do while ! ping -c 1 baidu.com > /dev/null 2>&1; do
echo "🤫 等待网络连接中..." echo "🤫 等待网络连接中..."
+1 -1
View File
@@ -4,6 +4,6 @@
# Put your custom commands here that should be executed once # Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing. # the system init finished. By default this file does nothing.
+[ -f "/data/init.sh" ] && sh /data/init.sh & +[ -f "/data/init.sh" ] && sh /data/init.sh >/dev/null 2>&1 &
+ +
exit 0 exit 0
-2
View File
@@ -13,8 +13,6 @@ v1.0.0 by: https://del.wang
EOF EOF
set -e
# 等待能够正常访问 baidu.com # 等待能够正常访问 baidu.com
while ! ping -c 1 baidu.com > /dev/null 2>&1; do while ! ping -c 1 baidu.com > /dev/null 2>&1; do
echo "🤫 等待网络连接中..." echo "🤫 等待网络连接中..."
+2
View File
@@ -52,6 +52,8 @@ chmod +x ./flash
# 第 4 步:刷写固件(注意替换固件文件的实际路径) # 第 4 步:刷写固件(注意替换固件文件的实际路径)
./flash system system0 root-patched.squashfs ./flash system system0 root-patched.squashfs
# PS: 如果提示刷写错误,可以多试几次,不一定是真的无法刷机
``` ```
> [!TIP] > [!TIP]
+2 -1
View File
@@ -1,2 +1,3 @@
squashfs-root squashfs-root
root.squashfs root.squashfs
squashfs