#!/bin/sh # 480s side: verification of the persistent B7C cache. Normal power-on (no RESET, no fastboot). New UART log, wait for lk + Linux, then read-only collect. K=${1:-V1}; cd ~/doc/modem/jz08-aurora; mkdir -p logs/b7/b7c/$K OLD=$(ps -eo pid,cmd | grep "[u]artlog.py /dev/ttyUSB0" | awk '{print $1}'); [ -n "$OLD" ] && kill $OLD; sleep 1 U=logs/uart/b7c$K-$(date +%Y%m%d-%H%M%S); setsid nohup python3 tools/uartlog.py /dev/ttyUSB0 $U > $U.stderr 2>&1 < /dev/null & echo "$(date -u +%T) uartlog -> $U.log; waiting for a new SBL1 + lk 'Trying to boot'" i=0; until grep -aq "Trying to boot" $U.log 2>/dev/null; do i=$((i+1)); [ $i -ge 900 ] && { echo "no lk boot line in 30 min"; exit 1; }; sleep 2; done echo "$(date -u +%T) lk: $(grep -a "Trying to boot" $U.log | tail -1)"; echo "$(date -u +%T) SBL1 starts: $(grep -ac 'SBL1, Start' $U.log)" i=0; until ping -c1 -W1 172.16.42.1 >/dev/null 2>&1; do i=$((i+1)); [ $i -ge 120 ] && { echo "NCM not up"; exit 1; }; sleep 1; done exec sh b7/b7c/b7c-boot.sh $K collect