uzbek-plus/b15/B15-rollback.sh

12 lines
911 B
Bash

#!/bin/bash
# B15 rollback - restore the B12R cache (e85d862e: Alpine primary root + router, kernel b12 without WireGuard). Needs 9008 via HW EDL.
# boot/aboot/userdata untouched (aurora-vpn just logs "kernel has no WireGuard" under b12). Deeper: b12/b12r/B12R-rollback.sh (B12Q).
cd ~/doc/modem/jz08-aurora || exit 1
L=firehose/007050e100000000_394a2e47cf830150_fhprg_peek.bin ; O=logs/b15/rollback ; mkdir -p $O
B=b12/b12r/cache/cache-extlinux-b12r.img
[ "$(sha256sum $B | cut -d' ' -f1)" = e85d862e463aa4affd7ec1cea9b1f2c7f765bb08e2a6bdce4af9539278f80d33 ] || { echo "STOP: rollback image hash"; exit 1; }
lsusb | grep -q 05c6:9008 || { echo "STOP: no 9008"; exit 1; }
edl --loader=$L printgpt > $O/00-printgpt.log 2>&1
edl --loader=$L w cache $B > $O/cache-w.log 2>&1
edl --loader=$L r cache $O/cache-rb.bin > /dev/null 2>&1 ; cmp $B $O/cache-rb.bin && echo CACHE_RESTORED_B12R
sha256sum $B $O/cache-rb.bin