17 lines
1.7 KiB
Bash
17 lines
1.7 KiB
Bash
#!/bin/sh
|
|
# 480s: B23 RAM test (charge 720 mA). Waits for lk1st fastboot (RESET held at power-on, USB to 480s), `fastboot boot` the b23 image,
|
|
# waits for NCM, checks kernel + LBC state (IBAT_MAX must be 07), pushes (telnet) and starts the read-only observer b23-mon.sh on the board
|
|
# (/tmp/b23-mon.log, every 30 s; ALERT-TEMP > 60 C). Nothing flashed; a power cycle returns to the eMMC cache (B18).
|
|
# Then: move USB from 480s to the 2 A adapter (board stays on battery), watch with b23-view.sh over Wi-Fi.
|
|
cd ~/doc/modem/jz08-aurora; O=logs/b23/ram${1:-1}; mkdir -p $O; IMG=b23/out/aurora-b23.img
|
|
A=$O/host-actions.txt; act() { echo "$(date -u +%H:%M:%S) $*" | tee -a $A; }
|
|
grep " aurora-b23.img\$" b23/out/SHA256SUMS | sed "s| | b23/out/|" | sha256sum -c || exit 1
|
|
act "B23 ram: waiting for fastboot <EMMC_SERIAL> (RESET held at power-on)"
|
|
i=0; until fastboot devices 2>/dev/null | grep -q <EMMC_SERIAL>; do i=$((i+1)); [ $i -ge 900 ] && { act ABORT; exit 1; }; sleep 2; done
|
|
act "fastboot present"; { fastboot boot $IMG 2>&1; echo rc=$?; } | tee -a $A
|
|
i=0; until ping -c1 -W1 172.16.42.1 >/dev/null 2>&1; do i=$((i+1)); [ $i -ge 240 ] && { act "ABORT NCM"; exit 1; }; sleep 1; done; act "NCM up"
|
|
sleep 20; tn() { { sleep 1; sed "s/\$/\r/" "$1"; sleep $2; } | ncat -i 30 172.16.42.1 23 | tr -d "\000\r"; }
|
|
{ echo "cat > /tmp/b23-mon.sh <<'EOFX'"; cat b23/b23-mon.sh; echo EOFX
|
|
echo 'uname -r; cat /proc/device-tree/model; echo; grep -q " /sys/kernel/debug " /proc/mounts || mount -t debugfs debugfs /sys/kernel/debug; cat /sys/kernel/debug/pm8916_lbc/state; (nohup sh /tmp/b23-mon.sh 30 >/dev/null 2>&1 &); sleep 4; echo ST=; tail -1 /tmp/b23-mon.log'; } > $O/.w
|
|
tn $O/.w 10 | sed -n '/^[0-9]\.[0-9]*\.[0-9]*-aurora/,$p' | grep -av "^/ #\|^~ #" | tee -a $A
|
|
act "READY"
|