From 6a72af510f99dc5ed7a705841cf9fde3bba1e1c6 Mon Sep 17 00:00:00 2001 From: pi-os3 Date: Mon, 9 Nov 2026 10:39:29 -0400 Subject: [PATCH] os/mini: ship the xHCI capture on the medium, so engine#823's plug test has an instrument The capture merged in #1606 lives at tools/xhci_boot_capture.sh, i.e. in the source tree - and engine#823's remaining question is answered ON a booted stick, by plugging into the rear USB-A and Type-C ports and reading per-port connect state. So the one person who can make the measurement could not run the tool: the issue would stay open for want of a script rather than for want of hardware. mkimage.sh installs it as /bin/1bit-xhci-capture (0755, from $src/tools, beside 1bit-release-check), and release-check.sh gains a row that says whether it is there - FAIL, not SKIP, because a medium without the instrument cannot answer the question that medium exists to answer. The verdict is a pure function (xhci_capture_verdict) with three self-test cases (1 -> PASS, 0 -> FAIL, empty -> FAIL), following the file's own convention. Verified: bash -n on both scripts (mkimage is bash; the first check of it with sh -n was mine being wrong, not the script), self-test rc=0 with 169 assertions, the installed copy is a valid sh script at 0755. --- os/mini/mkimage.sh | 5 +++++ os/mini/release-check.sh | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/os/mini/mkimage.sh b/os/mini/mkimage.sh index caf3afe3d..56036391a 100755 --- a/os/mini/mkimage.sh +++ b/os/mini/mkimage.sh @@ -501,6 +501,11 @@ cp /etc/mke2fs.conf "$root/etc/mke2fs.conf" # to the stick instead of booting the disk. copy_elf /usr/bin/efibootmgr cp "$here/release-check.sh" "$root/bin/1bit-release-check"; chmod +x "$root/bin/1bit-release-check" +# engine#823: the plug test's instrument has to be ON the medium. The capture answers "did a device appear on +# this port" from the booted system, which is the only place a plug can be observed - a tool that lives only in +# the source tree cannot be run by the person holding the stick, so the issue would stay open for want of a +# script rather than for want of hardware. +install -m 0755 "$src/tools/xhci_boot_capture.sh" "$root/bin/1bit-xhci-capture" install -m 0755 "$here/board.sh" "$root/usr/sbin/1bit-board" mkdir -p "$root/etc/1bit" install -m 0644 "$here/power.conf.example" "$root/etc/1bit/power" diff --git a/os/mini/release-check.sh b/os/mini/release-check.sh index 8400d019e..758fe7275 100755 --- a/os/mini/release-check.sh +++ b/os/mini/release-check.sh @@ -902,6 +902,14 @@ payload_home_layout_verdict() { # + case "${1:-}" in + 1) printf 'PASS /bin/1bit-xhci-capture is installed and executable: a boot can capture the xHCI state for engine#823, which is the only place a plug can be observed' ;; + 0) printf 'FAIL /bin/1bit-xhci-capture is not installed: engine#823 asks whether a rear USB-A or Type-C port sees a device, and nothing on this medium can read that' ;; + *) printf 'FAIL whether the xHCI capture is installed could not be read (%s)' "${1:-empty}" ;; + esac +} + # --self-test: assert the lemonade verdict on the cases that matter (tests/release_check_row.sh runs # this in CI). The unprepared-stick case is the one that used to false-PASS: 200 with the key, an empty # body and no status without it. @@ -953,6 +961,9 @@ if [ "${1:-}" = --self-test ]; then ln -s /home/nonexistent-xyz "$_hl_st/opt/home" # a home directory target: named, not failed check "bin/leak|/home/nonexistent-xyz/wt/build/1bit|dangling" "$(payload_home_layout_bad "$_hl_st" | grep '^bin/leak|')" rm -rf "$_hl_st" + check PASS "$(xhci_capture_verdict 1)" + check FAIL "$(xhci_capture_verdict 0)" + check FAIL "$(xhci_capture_verdict '')" check PASS "$(payload_runpath_verdict 0)" check FAIL "$(payload_runpath_verdict 3 '/opt/1bit-package/1bit/1bit runs /home/x/wt/release-rc/work/build')" check FAIL "$(payload_runpath_verdict 1)" @@ -2362,6 +2373,17 @@ else fi +# engine#823: the instrument the plug test needs must be on the medium (see os/mini/mkimage.sh). +if [ -x /bin/1bit-xhci-capture ]; then + XC=$(xhci_capture_verdict 1) +else + XC=$(xhci_capture_verdict 0) +fi +case "$XC" in + PASS*) pass xhci-capture "${XC#PASS }" ;; + *) fail xhci-capture "${XC#FAIL }" ;; +esac + # ── the NPU's locked memory in force (the driver asks for unlimited; this fleet's own 99- file can override ours) ── MEMLOCK_PID=${MEMLOCK_PID:-} MEMLOCK_NAME=${MEMLOCK_NAME:-}