From c8cd6c3a54e4e24acf71e014384a8c3d83b7bd8d Mon Sep 17 00:00:00 2001 From: MeowOS Date: Tue, 1 Sep 2026 10:27:53 +0800 Subject: [PATCH] =?UTF-8?q?chore(watchdog):=20=E8=A1=A5=20build=5Fwatchdog?= =?UTF-8?q?.sh(=E4=BA=A4=E5=8F=89+=E5=AE=BF=E4=B8=BB=E6=B5=8B=E8=AF=95),?= =?UTF-8?q?=20=E5=AF=B9=E9=BD=90=E5=90=84=E7=BB=84=E4=BB=B6=20build=5Fxxx.?= =?UTF-8?q?sh=20=E6=83=AF=E4=BE=8B;=20=E5=9B=BA=E4=BB=B6=E6=89=93=E5=8C=85?= =?UTF-8?q?=E5=94=AF=E4=B8=80=E5=85=A5=E5=8F=A3=E4=BB=8D=E6=98=AF=20script?= =?UTF-8?q?s/build/build=5Ffw=5Fapps.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patch_v2/meow_watchdog/build_watchdog.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 patch_v2/meow_watchdog/build_watchdog.sh diff --git a/patch_v2/meow_watchdog/build_watchdog.sh b/patch_v2/meow_watchdog/build_watchdog.sh new file mode 100755 index 0000000..3beacd5 --- /dev/null +++ b/patch_v2/meow_watchdog/build_watchdog.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# build_watchdog.sh — meow_watchdog 交叉编译(mipsel 静态)+ 宿主测试构建。 +# +# 用法: +# ./build_watchdog.sh # 交叉编译 → meow_watchdog(mipsel 静态,fw_content.conf 的 /usr/bin/meow_watchdog) +# ./build_watchdog.sh host # 宿主编译 test_wd_fw 并跑宿主回归 +set -e +cd "$(dirname "$0")" +ROOT=../../.. +CC="$ROOT/.tools/zig-mipsel-cc" + +if [ "$1" = "host" ]; then + gcc -Wall -Wextra -Os -DWd_NO_MAIN -Wno-unused-function -Wno-unused-parameter \ + test_wd_fw.c -o test_wd_fw -lm + ./test_wd_fw + exit $? +fi + +echo "== meow_watchdog (mipsel static) ==" +"$CC" -Os -Wall -Wextra -static meow_watchdog.c -o meow_watchdog +ls -la meow_watchdog +md5sum meow_watchdog +file meow_watchdog