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).
48 lines
3.6 KiB
Bash
Executable file
48 lines
3.6 KiB
Bash
Executable file
#!/bin/bash
|
|
# R2/T4 — the ONLY write: cache := ext2 extlinux -> T4 candidate (golden kernel/DTB/cmdline + B6P initramfs + telnetd on NCM). Run on 480s ONLY after explicit GO.
|
|
# Derived from b6p/B6P-write.sh (B6P write, CACHE_MATCH 2026-10-01); only image, expected hashes and log dir changed.
|
|
# Entry: HW EDL (battery on, D+->GND, plug USB, release). Never `edl reset`. Stops at first failed gate.
|
|
cd ~/doc/modem/jz08-aurora || exit 1
|
|
L=firehose/007050e100000000_394a2e47cf830150_fhprg_peek.bin
|
|
O=logs/r2/t4/W ; A3=logs/b5a/A3 ; P=logs/b5a/A4pre ; mkdir -p $O
|
|
NEW=r2/t4/cache-extlinux-t4.img ; NEW_SHA=9d3bc8900ab4b4ec26cfb16d2a0e83a8b3f8f4b74793e842bccfd366263368b7
|
|
OLD_SHA=9fea693a436b49ca56aed0857725ecdde8a0071700cf5d23b02dab9d9ff406b7 # current cache = B6P extlinux
|
|
BOOT_SHA=e9579f33c7304cd47f487f2b61cd9226dc04fd3a63775d62b4b95fc15bd3ebff
|
|
ABOOT_SHA=3b8cd2667837fc7083cb28991d849f9b408a07fa743bfd05eafee7b053760f85
|
|
die(){ echo "STOP: $*"; exit 1; }
|
|
sha(){ sha256sum "$1" | cut -d" " -f1; }
|
|
E(){ edl --loader=$L "$@"; }
|
|
echo "== G0 inputs"
|
|
[ "$(sha $L)" = 53f193500c03248f0d671ab57bfe9ca8a42967e97f28403294b4b3f854075aca ] || die loader
|
|
[ "$(sha $NEW)" = $NEW_SHA ] && [ $(stat -c %s $NEW) = 134217728 ] || die candidate
|
|
[ "$(sha b6p/cache-extlinux-b6p.img)" = $OLD_SHA ] || die rollback-image
|
|
[ "$(sha logs/b6p/W/11-cache-readback.bin)" = $OLD_SHA ] || die b6p-readback-backup
|
|
lsusb | grep -q 05c6:9008 || die "no 9008"
|
|
echo "== G1 identity + geometry + baseline"
|
|
E printgpt > $O/00-printgpt.log 2>&1 || die printgpt
|
|
grep -aq "Serial: *0x<SAHARA_SERIAL>" $O/00-printgpt.log || grep -aq "Mode detected: firehose" $O/00-printgpt.log || die serial
|
|
grep -a "^cache:" $O/00-printgpt.log | grep -q "Offset 0x000000004118c000, Length 0x0000000008000000" || die cache-geometry
|
|
E rs 0 34 $O/pre-gptp.bin >/dev/null 2>&1; cmp $O/pre-gptp.bin $A3/gpt-primary-34.bin || die gpt-changed
|
|
E r boot $O/pre-boot.bin >/dev/null 2>&1; [ "$(sha $O/pre-boot.bin)" = $BOOT_SHA ] || die boot-not-emmc1
|
|
E r aboot $O/pre-aboot.bin >/dev/null 2>&1; [ "$(sha $O/pre-aboot.bin)" = $ABOOT_SHA ] || die aboot-not-autoboot
|
|
E r cache $O/pre-cache.bin >/dev/null 2>&1; [ "$(sha $O/pre-cache.bin)" = $OLD_SHA ] || die cache-not-backup
|
|
echo "== W cache := candidate (LBA 2133088, 262144 sectors)"
|
|
E w cache $NEW > $O/10-cache-write.log 2>&1; echo "rc=$?"; grep -a "Wrote" $O/10-cache-write.log
|
|
E r cache $O/11-cache-readback.bin > $O/11-cache-readback.log 2>&1 || die readback-rc
|
|
sha256sum $NEW $O/11-cache-readback.bin
|
|
cmp $NEW $O/11-cache-readback.bin || die "CACHE READBACK MISMATCH — do NOT reboot; run r2/t4/T4-rollback.sh"
|
|
echo CACHE_MATCH
|
|
echo "== V everything else unchanged"
|
|
E rs 0 34 $O/post-gptp.bin >/dev/null 2>&1; cmp $O/post-gptp.bin $A3/gpt-primary-34.bin || die gptp
|
|
E rs 7634911 33 $O/post-gptb.bin >/dev/null 2>&1; cmp $O/post-gptb.bin $A3/gpt-backup-33.bin || die gptb
|
|
E rs 305184 1024 $O/post-tzbak.bin >/dev/null 2>&1; cmp $O/post-tzbak.bin $A3/tzbak-305184.bin || die tzbak
|
|
E r boot $O/post-boot.bin >/dev/null 2>&1; [ "$(sha $O/post-boot.bin)" = $BOOT_SHA ] || die boot
|
|
E r aboot $O/post-aboot.bin >/dev/null 2>&1; [ "$(sha $O/post-aboot.bin)" = $ABOOT_SHA ] || die aboot
|
|
for p in sbl1 rpm tz hyp recovery modemst1 modemst2 fsg fsc persist; do
|
|
E r $p $O/post-$p.bin >/dev/null 2>&1; cmp $O/post-$p.bin $A3/$p.bin || die "$p changed"; echo "$p == A3"
|
|
done
|
|
for p in modem system userdata; do
|
|
E r $p $O/post-$p.bin >/dev/null 2>&1; cmp $O/post-$p.bin $P/$p.bin || die "$p changed"; echo "$p == A4pre"; rm -f $O/post-$p.bin
|
|
done
|
|
(cd $O && sha256sum *.bin > SHA256SUMS)
|
|
echo "T4_WRITE_VERIFIED — power off fully (USB, then battery) before first boot"
|