uzbek-plus/r2/t2d-capnow.sh
q 8d7721c775 B7: add network time bootstrap and persistent B7C cache
B7A: QMI DMS time vs VNIIFTRI NTP (DMS = UTC - 0.28 s, sigma 1 ms; NITZ = DMS
truncated to 1 s). B7B: a 1970 -> 2026 date -s step is harmless for the modem
stack. B7C: aurora-modem probes DMS/NITZ along the start flow and steps
CLOCK_REALTIME once at the first valid sample (REG registered/attached), never
RTC; background SNTP check (query only) after START OK. 3/3 class-A cold boots
PASS (residual +0.04/+0.36/+0.84 s), cache 14fe453a written (B7C_WRITE_VERIFIED)
and verified by a normal power-on (V1, +0.26 s).

Also publishes the prerequisite R2 (boot-hang / lk eMMC investigation, T4
telnet baseline that B7C builds on) and R3 (autonomous cold boot, NCM loss)
material, and extends tools/publish-sanitize.py to r2/, r3/, b7/.
Binary images, initramfs, busybox and raw logs stay out (see b7/*/SHA256SUMS).
2026-10-02 20:18:25 +03:00

24 lines
1.8 KiB
Bash

#!/bin/bash
# R2/T2 watcher (480s; board side read-only). Usage: t2-watch.sh <UARTLOG> <ATTEMPT-TAG>
# For each SBL1 start: class A/B/C from pm_device_init, furthest stage, PASS/FAIL; Linux -> PON dump over UART (md5-checked);
# hang -> wait for auto-reset (max 120 s from start), next start is recorded as a follow-up of the same attempt.
L=$1; TAG=$2; TTY=/dev/ttyUSB0
OUT=~/doc/modem/jz08-aurora/logs/r2/t2d; mkdir -p $OUT; RES=$OUT/results.tsv
[ -f $RES ] || printf 'attempt\tstart#\tstart\tclass\tsblS\tpm_device\tcdt\tpm_driver\tsbl_end\tsbl_delta\tbatt\tsbl1End\tlk\tlinux\tstage\tresult\tautoreset\trtc\t807\t808\t80a\t80c\t80d\tnote\n' > $RES
lg() { tr -d '\000' < $L; }
dumpcmd() {
printf '%s\r' "grep -q ' /sys/kernel/debug ' /proc/mounts || mount -t debugfs debugfs /sys/kernel/debug; R=/sys/kernel/debug/regmap/0-00/registers; { dd if=\$R bs=9 skip=2048 count=256 2>/dev/null; dd if=\$R bs=9 skip=2304 count=256 2>/dev/null | grep -v ': 00\$'; } > /tmp/t2.txt; echo T2-BEGIN-$1; sed 's/^/T2R /' /tmp/t2.txt; echo T2-SUM-$1 \$(md5sum < /tmp/t2.txt) up=\$(cut -d' ' -f1 /proc/uptime); echo T2-END-$1" > $TTY
}
capture() { # id startline
for try in 1 2 3; do
dumpcmd $1-$try
for i in $(seq 1 25); do sleep 1; lg | tail -n +$2 | grep -a -q "T2-END-$1-$try" && break; done
seg=$(lg | tail -n +$2 | sed -n "/T2-BEGIN-$1-$try/,/T2-END-$1-$try/p")
body=$(echo "$seg" | grep -a -o "T2R [0-9a-f]\{4\}: [0-9a-f]\{2\}" | cut -c5-)
want=$(echo "$seg" | grep -a -o "T2-SUM-$1-$try [0-9a-f]\{32\}" | awk '{print $2}' | tail -1)
got=$(printf '%s\n' "$body" | md5sum | awk '{print $1}')
[ -n "$want" ] && [ "$want" = "$got" ] && { printf '%s\n' "$body" > $OUT/$1-regs.txt; return 0; }
echo "try $try md5 mismatch want=$want got=$got" >> $OUT/$1-meta.txt
done; return 1
}
n=$(lg | wc -l); capture $3 $n && echo CAPTURED || echo CAPTURE-FAILED