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).
47 lines
4.8 KiB
Bash
47 lines
4.8 KiB
Bash
#!/bin/sh
|
|
# 480s side, B7C RAM cold boot K. Board: full power-off >= 90 s, then RESET held at power-on (battery -> USB) -> lk1st fastboot.
|
|
# This script: new UART log -> wait fastboot <EMMC_SERIAL> -> fastboot boot b7c image -> passive waits -> read-only collection over telnet.
|
|
# No input on the boot path except `fastboot boot`; nothing is written to eMMC/cache.
|
|
K=$1; MODE=$2; [ -n "$K" ] || { echo "usage: $0 K [collect|now]"; exit 2; } # collect = skip uartlog/fastboot, only wait + collect; now = boot a board already sitting in fastboot (NOT a cold boot)
|
|
cd ~/doc/modem/jz08-aurora; O=logs/b7/b7c/c$K; mkdir -p $O; IMG=b7/b7c/out/aurora-mm1-b7c.img
|
|
A=$O/host-actions.txt; act() { echo "$(date -u +%H:%M:%S.%3N) $*" | tee -a $A; }
|
|
tn() { { sleep 1; sed "s/\$/\r/" "$1"; sleep $2; } | ncat 172.16.42.1 23 | tr -d "\000\r"; }
|
|
echo "d0c4cc0011ba9d463dbdc9cc5ca4ca1753912ae2f319a37cdfb33a0867412815 $IMG" | sha256sum -c || exit 1
|
|
if [ "$MODE" != collect ]; then
|
|
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 &
|
|
act "B7C c$K: uartlog PID $! -> $U.log; waiting for fastboot <EMMC_SERIAL> (power off >= 90 s, then RESET held + battery -> USB)"
|
|
# require a real power-off: if the board already sits in fastboot, first wait until it disappears (power removed)
|
|
if [ "$MODE" != now ] && fastboot devices 2>/dev/null | grep -q <EMMC_SERIAL>; then act "board already in fastboot - waiting for it to disappear (power-off) first"
|
|
until ! fastboot devices 2>/dev/null | grep -q <EMMC_SERIAL>; do sleep 1; done; act "fastboot device gone (power removed)"; fi
|
|
i=0; until fastboot devices 2>/dev/null | grep -q <EMMC_SERIAL>; do i=$((i+1)); [ $i -ge 600 ] && { act "ABORT: no fastboot in 20 min"; exit 1; }; sleep 2; done
|
|
act "fastboot device present"; { fastboot boot $IMG 2>&1; echo "rc=$?"; } | tee -a $A
|
|
else U=$(ls -t logs/uart/b7c$K-*.log | head -1); U=${U%.log}; act "collect-only mode, UART $U.log"; fi
|
|
i=0; until ping -c1 -W1 172.16.42.1 >/dev/null 2>&1; do i=$((i+1)); [ $i -ge 90 ] && { act "ABORT: NCM not up after ~180 s - nothing touched, collect UART only"; cp $U.log $O/uart.log; exit 1; }; sleep 1; done; act "NCM ping 172.16.42.1 ok"
|
|
R=$(grep -a "rtc-pm8xxx.*setting system clock" $U.log | tail -1 | sed -n 's/.*(\([0-9]*\)).*/\1/p'); C=B; [ -n "$R" ] && [ "$R" -lt 40 ] && C=A
|
|
act "PM8916 RTC at Linux boot = ${R:-?} s -> class $C (A = PMIC POR; <40 s allows for the lk fastboot wait)"
|
|
printf 'grep -E "START OK|FAIL in|rollback" /run/aurora-modem/lifecycle.log | tail -1\n' > $O/.w
|
|
i=0; until tn $O/.w 3 | grep -qE "^\[[0-9.]+\] .*(=== START OK|FAIL in|rollback)"; do i=$((i+1)); [ $i -ge 80 ] && { act "no START OK/FAIL after ~12 min"; break; }; sleep 6; done
|
|
act "controller end: $(tn $O/.w 3 | grep -E '^\[[0-9.]+\] .*(=== START OK|FAIL in|rollback)' | tail -1)"
|
|
printf 'grep -E "SNTP (check|STEP|: )" /run/aurora-modem/lifecycle.log | tail -2\n' > $O/.s
|
|
i=0; until tn $O/.s 3 | grep -qE "^\[[0-9.]+\] SNTP"; do i=$((i+1)); [ $i -ge 15 ] && break; sleep 4; done; act "sntp: $(tn $O/.s 3 | grep -E '^\[[0-9.]+\] SNTP' | tail -2 | tr '\n' ' ')"
|
|
cat > $O/.c <<'C'
|
|
echo B7C-SNAP-BEGIN; cat /proc/uptime; date -u; /usr/libexec/aurora/busybox adjtimex | grep -E "status|offset|time.tv"
|
|
dmesg | grep -E "rtc-pm8xxx|setting system clock"; cat /sys/class/rtc/rtc0/since_epoch /sys/class/rtc/rtc0/date /sys/class/rtc/rtc0/time
|
|
sha256sum /usr/sbin/aurora-modem /usr/libexec/aurora/busybox; cat /etc/aurora/build-epoch
|
|
/etc/init.d/aurora-modem status
|
|
echo ---time.tsv; cat /run/aurora-modem/time.tsv; echo ---time-set; cat /run/aurora-modem/time-set
|
|
echo ---lifecycle; cat /run/aurora-modem/lifecycle.log
|
|
echo ---sntp; cat /run/aurora-modem/sntp.txt
|
|
echo ---routes; ip route; cat /run/aurora-modem/routes
|
|
echo ---ping; ping -c3 -W3 -I wwan0 77.88.8.8 | tail -2
|
|
echo ---ntp-verify; timeout 12 /usr/libexec/aurora/busybox ntpd -w -d -p 89.109.251.22 2>&1 | grep "reply from"
|
|
echo ---dmesg-err; dmesg | grep -ciE "error|fail|oops|watchdog"; dmesg | grep -E "aurora-modem\] (TIME|SNTP)"
|
|
echo ---emmc; awk "{print \"w=\"\$5\" s=\"\$7}" /sys/block/mmcblk0/stat
|
|
echo B7C-SNAP-END
|
|
C
|
|
tn $O/.c 30 > $O/snapshot.txt; act "snapshot: $(grep -c B7C-SNAP-END $O/snapshot.txt) end markers"
|
|
printf 'cd /run/aurora-modem && tar cf /tmp/b7c-run.tar . 2>/dev/null; sha256sum /tmp/b7c-run.tar; nc -l -p 9938 < /tmp/b7c-run.tar &\n' > $O/.t
|
|
tn $O/.t 3 | grep b7c-run.tar > $O/run-tar.sha; sleep 1; ncat --recv-only 172.16.42.1 9938 > $O/run-aurora-modem.tar; sha256sum $O/run-aurora-modem.tar | tee -a $A
|
|
cp $U.log $O/uart.log; grep -aE "SBL1, Start|pm_device_init, Delta|pm_driver_init, Delta|MMC card|Done initialization|CID|Linux version|EMMC-RO|B1_OK|T4:|aurora-modem\] (STATE|TIME|SNTP|REG t|registered|=== START)|FAIL" $U.log | cut -c1-230 > $O/uart-markers.txt
|
|
act "B7C c$K END"
|