Skip to content

XNU as a loadable kernel module inside Linux (macOS personality for arm64 Linux)

C

vm-m2-stream.sh: stream dmesg over ssh so logs survive a VM hang

Heyang Zhou8d23d15e2566
diff --git a/scripts/vm-m2-stream.sh b/scripts/vm-m2-stream.sh
new file mode 100644
index 0000000..3a1839c
--- /dev/null
+++ b/scripts/vm-m2-stream.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+# On the Mac host: stream the VM's kernel log over ssh while XNU runs, so the last lines survive a VM hang.
+# Usage: KMAX=100000 IDLE_MAX=300 bash scripts/vm-m2-stream.sh OUT
+OUT=${1:-../stream.out}
+bash scripts/vm.sh 'sudo dmesg -C' >/dev/null 2>&1
+bash scripts/vm.sh 'sudo dmesg -w' > "$OUT" 2>&1 &
+SP=$!
+sleep 2
+timeout ${TMO:-150} bash scripts/vm.sh "IDLE_MAX=${IDLE_MAX:-300} SHOW=1 bash ~/w/poc/scripts/vm-m2-kbisect.sh ${KMAX:-100000}" >/dev/null 2>&1
+echo "run rc=$?"
+sleep 3; kill $SP 2>/dev/null