haiku: USB backend (Storage Kit), bundled doctest, VM sync tooling
CI / Linux arm64 (push) Waiting to run
CI / Linux x86_64 (push) Waiting to run
CI / ASan + UBSan (push) Waiting to run

- usb_haiku.cpp: lists /dev/disk/usb/* drives (never the boot volume),
  formats MBR + FAT32 at 1 MiB through BDiskDevice/BPartition, mounts,
  unmounts and ejects; modifications are cancelled on failure
- third_party/doctest (MIT single header) used when no system package
  exists (HaikuPorts has none)
- tools/haiku-vm.sh: sync command, dedicated SSH key; tools/qmp.py:
  typefile command and slower key pacing
- builds on Haiku R1/beta6 x86_64; usb-list sees the virtual stick.
  Known issue: some unit tests still fail on Haiku (to investigate).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDASLCiN764v685boRVYar
This commit is contained in:
yann64andClaude Opus 5.5 committed 2026-11-28 20:20:43 +01:00
1 parent 114976b912
commit b2ca454d44
8 files changed
+7376 -3

No files matched your search

+7 -1
View File
@@ -69,9 +69,15 @@ stop)
;;
ssh)
shift
exec ssh -p "$SSH_PORT" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR \
exec ssh -p "$SSH_PORT" -i "$VM_DIR/id_ed25519" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR \
user@127.0.0.1 "$@"
;;
sync)
# Copy the working tree (without .git) to ~/openpu in the VM.
SRC=$(cd "$(dirname "$0")/.." && pwd)
tar -C "$SRC" --exclude=.git -cf - . | "$0" ssh "mkdir -p openpu && tar -xf - -C openpu"
echo "synced $SRC -> VM:~/openpu"
;;
status)
running && echo "running (pid $(cat "$PIDFILE"))" || echo "stopped"
;;
+9 -2
View File
@@ -6,6 +6,7 @@ usage: python3 tools/qmp.py [--socket PATH] COMMAND...
click X Y [right|double] click at screen pixel X,Y (needs a usb-tablet device)
move X Y move the pointer
type TEXT type text with a US keyboard layout
typefile FILE type the content of FILE (newlines press Return)
key COMBO... press key combos, e.g. ret, tab, ctrl-alt-delete, alt-f4
powerdown ACPI power button
hmp COMMAND human monitor command (prints the answer)
@@ -125,8 +126,10 @@ def keys_for(ch):
def press(q, names):
q.cmd("send-key", keys=[{"type": "qcode", "data": n} for n in names], **{"hold-time": 50})
time.sleep(0.03)
# send-key returns before QEMU replays the keys: wait longer than the hold time, or
# consecutive keys overlap (and a held shift leaks into the next characters).
q.cmd("send-key", keys=[{"type": "qcode", "data": n} for n in names], **{"hold-time": 30})
time.sleep(0.08)
def main():
@@ -152,6 +155,10 @@ def main():
elif cmd == "type":
for ch in " ".join(rest):
press(q, keys_for(ch))
elif cmd == "typefile":
with open(rest[0], encoding="utf-8") as f:
for ch in f.read():
press(q, keys_for(ch))
elif cmd == "key":
for combo in rest:
press(q, combo.split("-"))