forked from arti/vt1200
Isolated-netns test setup (a private tap-mess-0-0 so a second MAME can run without holding the owner's tap), the one-file/one-index TFTP servers, the trace/probe run wrappers, and the two server logs quoted in FONT_STORAGE_REPORT.md.
38 lines
1.6 KiB
Bash
Executable File
38 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Boot with fonttrace.lua + the chosen custom server and collect debug.log.
|
|
set -euo pipefail
|
|
NS=vt1test
|
|
ROOT=/home/arti/code/k-space/vt1200
|
|
WORK=$ROOT/harness/mame/fontwork
|
|
FILE="${1:-$ROOT/reference/fonts/baseline.pcf}"
|
|
SECS="${2:-20}"; TAG="$(basename "$FILE")"
|
|
|
|
sudo -n ip netns exec "$NS" pkill -x vt1200 2>/dev/null || true
|
|
sudo -n ip netns exec "$NS" pkill -x python3 2>/dev/null || true
|
|
sleep 0.3
|
|
rm -rf "$WORK/nvram-$TAG" "$ROOT/debug.log"
|
|
mkdir -p "$WORK/nvram-$TAG/vt1200"
|
|
cp "$WORK/nvram_pristine.bin" "$WORK/nvram-$TAG/vt1200/nvram"
|
|
|
|
sudo -n ip netns exec "$NS" python3 -u "$WORK/custom_serve.py" "$FILE" 192.168.99.1 \
|
|
>"$WORK/custom_serve_$TAG.log" 2>&1 &
|
|
SRV=$!
|
|
sleep 1.2
|
|
|
|
cd "$ROOT"
|
|
timeout $((SECS+12)) sudo -n ip netns exec "$NS" env -u DISPLAY \
|
|
SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy \
|
|
XDG_RUNTIME_DIR="$WORK" VT1200_SKIP_LEVEL1=1 \
|
|
/home/arti/code/k-space/mame0289/vt1200 vt1200 \
|
|
-rompath "$ROOT/harness/mame/roms" -video none -sound none -nothrottle \
|
|
-skip_gameinfo -cfg_directory "$ROOT/harness/mame/cfg-net" \
|
|
-nvram_directory "$WORK/nvram-$TAG" -networkprovider taptun \
|
|
-debug -debugger none -debuglog \
|
|
-autoboot_script "$ROOT/harness/mame/fonttrace.lua" -autoboot_delay 0 \
|
|
-seconds_to_run "$SECS" >"$WORK/mame_trace.log" 2>&1 || true
|
|
|
|
kill $SRV 2>/dev/null || true
|
|
sudo -n ip netns exec "$NS" pkill -x python3 2>/dev/null || true
|
|
echo "=== server ==="; cat "$WORK/custom_serve_$TAG.log"
|
|
echo "=== trace ==="; grep -E 'TFTP-ENTRY|EXPECTED|RECV|OPCODE|BLKREAD|BLKCHK|ACK|COPY|READ-RET|OPEN-OK|CLOSE' "$ROOT/debug.log" | head -80
|