Files
makronix/mobile/tools/reboot-loop.sh
T
lotherkandClaude Opus 5.5 b9c0affdb8 mobile: hotdogb stable state: msm built in, display warnings fixed, self-flashing, serial console
Kernel (7.0.0-sm8150-g1299aab93171):
- msm DRM built in again: up at 0.6-0.8 s instead of 4.2 s, safe since
  0003 and 0004.
- 0005: CLK_OPS_PARENT_ENABLE on the pixel RCGs (as sdm845): "rcg didn't
  update its configuration" is gone.
- 0006: dsi_err_worker reported every error as status=4, a FIFO error
  that was none (lane FIFOs empty) and hid the ACK error (bit 0); it now
  reads status=40 ack_err=..., the panel's report on the first read after
  the takeover.
- ftrace (dynamic, function_graph), Landlock.

Without a button: the DTB gets the PON's mode-bootloader/mode-recovery
(fdtput on the pinned binary until the DTS moves in; new pin), Void gets
reboot-mode(1) and a runit stage-3 hook that restarts with the mode
(base/reboot2.c, built static by mkrootimg.sh).  flash.sh and
flash-root.sh reboot a running phone into fastboot themselves and wait for
ABL without ever cutting a command off or resetting the device -- two
usbresets after the userdata flash crashed it into 05c6:900e.  Writing the
fallback slot no longer makes it active.

Access: dnsmasq (DHCP only) on usb0, so the host keeps 172.16.42.2 after
the initramfs; an ACM function next to NCM with the kernel console and a
login on ttyGS0; phone_addr falls back to IPv6 link-local;
tools/reboot-loop.sh for boot races.  zram swap (half the RAM, zstd).

Measured: 20 of 20 warm reboots reachable; the self-flash
(build/logs/selfflash3-2026-11-08.log).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 09:52:05 +00:00

52 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
#
# Warm-reboot a running phone N times (sysrq b) and count the boots that do
# not come back: a test for boot races. Each round waits up to WAIT
# seconds (default 90) for ssh -- at the phone's IPv4 address or, when the
# host has lost its IPv4 on the USB link, at its IPv6 link-local address
# (phone_addr, tools/lib.sh), so a missing host address is not taken for a
# hang. Stops at the first boot that answers neither: an unreachable phone
# cannot be rebooted. With netconsole running (tools/netconsole-listen.sh
# LOG), each line names the LOG lines of its boot.
#
# Usage: reboot-loop.sh [N] [LOG]
set -u
. "$(dirname "$0")/lib.sh"
n=${1:-10}
log=${2:-}
wait=${WAIT:-90}
lines() {
if [ -n "$log" ] && [ -f "$log" ]; then
wc -l < "$log" | tr -d ' '
else
echo 0
fi
}
a=$(phone_addr) || die "phone not reachable"
hangs=0 i=1
while [ "$i" -le "$n" ]; do
start=$(lines)
phone_ssh "$a" 'sync; echo b > /proc/sysrq-trigger' >/dev/null 2>&1
sleep 15
t=0
while ! a=$(phone_addr) && [ "$t" -lt "$wait" ]; do
sleep 3
t=$((t + 3))
done
if [ -z "$a" ]; then
hangs=1
echo "run $i: NOT REACHABLE (log lines from $start)"
break
fi
echo "run $i: up at $a (log lines $start-$(lines))"
sleep 5
i=$((i + 1))
done
[ "$i" -gt "$n" ] && i=$n
echo "$i runs, $hangs not reachable"
[ "$hangs" -eq 0 ]