mirror of
https://github.com/Lakr233/vphone-cli.git
synced 2026-04-05 13:09:06 +08:00
Merge pull request #100 from TastyHeadphones/codex/setup-machine-ramdisk-panic-detect
setup_machine: fail early on ramdisk panic while waiting for SSH
This commit is contained in:
@@ -395,6 +395,20 @@ wait_for_ramdisk_ssh() {
|
||||
|
||||
echo "[*] Waiting for ramdisk SSH on ${RAMDISK_SSH_USER}@127.0.0.1:${RAMDISK_SSH_PORT} (timeout=${RAMDISK_SSH_TIMEOUT}s)..."
|
||||
while (( waited < RAMDISK_SSH_TIMEOUT )); do
|
||||
if [[ -f "$DFU_LOG" ]] && grep -Eiq 'panic|kernel panic|stackshot succeeded|panic\.apple\.com' "$DFU_LOG"; then
|
||||
echo "[-] Detected panic markers in boot_dfu log while waiting for ramdisk SSH."
|
||||
echo "[-] boot_dfu log tail:"
|
||||
tail -n 80 "$DFU_LOG" 2>/dev/null || true
|
||||
die "Ramdisk boot appears to have panicked before SSH became ready."
|
||||
fi
|
||||
|
||||
if [[ -n "$DFU_PID" ]] && ! kill -0 "$DFU_PID" 2>/dev/null; then
|
||||
echo "[-] boot_dfu process exited while waiting for ramdisk SSH."
|
||||
echo "[-] boot_dfu log tail:"
|
||||
tail -n 80 "$DFU_LOG" 2>/dev/null || true
|
||||
die "DFU boot exited before ramdisk SSH became ready."
|
||||
fi
|
||||
|
||||
if "$sshpass_bin" -p "$RAMDISK_SSH_PASS" ssh \
|
||||
-o StrictHostKeyChecking=no \
|
||||
-o UserKnownHostsFile=/dev/null \
|
||||
|
||||
Reference in New Issue
Block a user