Skip to content

usb: Keep each iPad's USB serial number the same across boots - #110

Merged
henrikklee merged 1 commit into
OrchardLinux:mainfrom
brkosebay:j71t/usb-stable-serial
Nov 12, 2026
Merged

henrikklee merged 1 commit into
OrchardLinux:mainfrom
brkosebay:j71t/usb-stable-serial

Conversation

@brkosebay

@brkosebay brkosebay commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Part 7 of 23 of the iPad 5 (J71t) series in this repository; merge after #108.

Problem

The USB serial number changed between installed boots and RAM sessions, so the host saw a new device every boot and could not keep its SSH known_hosts entry or serial console name.

Change

Share one BOARD/hashed-ID serial format between installed boots and RAM sessions (usb-identity), and get the per-boot SSH identity through the existing ACM console. Documented in docs/device-protocol.md, with tests.

Testing

  • Hardware: iPad 5 Wi-Fi (J71t). Hands-on testing on 2026-11-11 with an integrated build of this series, made before the final failure-path fixes, covered USB serial and SSH across boots.
  • 2026-11-12: no further hardware test of this change beyond the above. The top of this series applies to the same kernel tree as the release build tested on J71t that day (20+ warm restarts without a freeze).
  • Host: the Linux test suite passes at this branch's head, and the kernel and m1n1 patch series apply on apple-16k and apple-4k. At the top of the series the applied kernel tree is identical to the one in the built release image.
  • Other boards that share these drivers or compatibles have not been tested.

Dependencies

Depends on #108.

This branch is stacked on the PRs it depends on and carries their commits; the change of this PR is its last commit, "usb: Keep per-device system and RAM serials stable across boots".

This update keeps the branch's earlier history: it merges the current base into the branch and adds the reworked change as a new commit on top.

🤖 Generated with Claude Code

@brkosebay brkosebay changed the title usb: keep per-device system and RAM serials stable across boots usb: Keep per-device system and RAM serials stable across boots Nov 12, 2026
henrikklee pushed a commit to brkosebay/hardware that referenced this pull request Nov 12, 2026
Installed systems and RAM payloads told the host a new USB serial
number on every boot (BOOT:<boot id>), so the Mac saw a new device each
time: macOS asked again whether to allow the accessory, and the serial
console got a new name. Both now use BOARD:<board> ID:<12 hex>, the ID
being SHA-256 over "orchard-" and the device-tree serial-number that
m1n1 copies from Apple's tree, so the hardware serial is not
published. A RAM payload's boot and SSH host key are read over the
serial console on every connection instead of from the USB name.

Trees without a serial number, or a helper that fails, keep the
per-boot BOOT: serial, so USB serial and SSH always come up. Recovery,
install and the install-to-system handoff keep their serials.

From orchard PR OrchardLinux#110 (commit bbe62ba), the stable serial part. The
same PR also embedded every board's device tree in each initrd and a
feature table in the platform layer, for warm restart and the feature
registry; those are not part of this topic. The empty or malformed
hash fallback and the init fallback are additions.
@henrikklee
henrikklee force-pushed the j71t/usb-stable-serial branch from bbe62ba to 39d86cb Compare November 12, 2026 21:17
@henrikklee henrikklee changed the title usb: Keep per-device system and RAM serials stable across boots usb: Keep each iPad's USB serial number the same across boots Nov 12, 2026
@henrikklee
henrikklee marked this pull request as ready for review November 12, 2026 21:17
Installed systems and RAM payloads told the host a new USB serial
number on every boot (BOOT:<boot id>), so the Mac saw a new device each
time: macOS asked again whether to allow the accessory, and the serial
console got a new name. Both now use BOARD:<board> ID:<12 hex>, the ID
being SHA-256 over "orchard-" and the device-tree serial-number that
m1n1 copies from Apple's tree, so the hardware serial is not
published. A RAM payload's boot and SSH host key are read over the
serial console on every connection instead of from the USB name.

Trees without a serial number, or a helper that fails, keep the
per-boot BOOT: serial, so USB serial and SSH always come up. Recovery,
install and the install-to-system handoff keep their serials.

From orchard PR OrchardLinux#110 (commit bbe62ba), the stable serial part. The
same PR also embedded every board's device tree in each initrd and a
feature table in the platform layer, for warm restart and the feature
registry; those are not part of this topic. The empty or malformed
hash fallback and the init fallback are additions.
@henrikklee
henrikklee force-pushed the j71t/usb-stable-serial branch from 39d86cb to 498ef45 Compare November 12, 2026 21:23
@henrikklee

Copy link
Copy Markdown
Contributor

Landing the stable serial part as your commit: one USB serial per unit (BOARD: ID:) for installed systems and RAM payloads, and the RAM boot and host key read over ACM on every connection. Added on top: a fallback to the per-boot BOOT: serial when the hash cannot be made, in both the initrd and usb-session, so USB serial and SSH always come up. Not in this topic: the per-board pristine DTBs in the initrd and device-features.json (warm restart and the feature registry). Your previous head is kept as tag contrib/brkosebay-j71t-usb-stable-serial. Please check on the next nightly that the Mac keeps recognising the J71t across reboots.

@henrikklee
henrikklee merged commit 023634f into OrchardLinux:main Nov 12, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants