Repository navigation
usb: Keep each iPad's USB serial number the same across boots - #110
Conversation
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.
bbe62ba to
39d86cb
Compare
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.
39d86cb to
498ef45
Compare
|
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 |
Bring this branch onto current main. Main has since merged OrchardLinux#124, OrchardLinux#122, OrchardLinux#118, OrchardLinux#121, OrchardLinux#110, OrchardLinux#127, OrchardLinux#101, OrchardLinux#126, OrchardLinux#108 and OrchardLinux#111, several in part or reworked, and OrchardLinux#123 and OrchardLinux#128 were closed. Where main carries a topic, main's version is kept; the left-out parts that warm restart and suspend need come back in OrchardLinux#107 and OrchardLinux#117.
Bring this branch onto current main. Main has since merged OrchardLinux#124, OrchardLinux#122, OrchardLinux#118, OrchardLinux#121, OrchardLinux#110, OrchardLinux#127, OrchardLinux#101, OrchardLinux#126, OrchardLinux#108 and OrchardLinux#111, several in part or reworked, and OrchardLinux#123 and OrchardLinux#128 were closed. Where main carries a topic, main's version is kept; the left-out parts that warm restart and suspend need come back in OrchardLinux#107 and OrchardLinux#117. This branch's own patches in drivers/usb are renumbered to follow main's.
Bring this branch onto current main. Main has since merged OrchardLinux#124, OrchardLinux#122, OrchardLinux#118, OrchardLinux#121, OrchardLinux#110, OrchardLinux#127, OrchardLinux#101, OrchardLinux#126, OrchardLinux#108 and OrchardLinux#111, several in part or reworked, and OrchardLinux#123 and OrchardLinux#128 were closed. Where main carries a topic, main's version is kept; the left-out parts that warm restart and suspend need come back in OrchardLinux#107 and OrchardLinux#117. This branch's own patches in devices/s8000, drivers/base and drivers/usb are renumbered to follow main's.
Bring this branch onto current main. Main has since merged OrchardLinux#124, OrchardLinux#122, OrchardLinux#118, OrchardLinux#121, OrchardLinux#110, OrchardLinux#127, OrchardLinux#101, OrchardLinux#126, OrchardLinux#108 and OrchardLinux#111, several in part or reworked, and OrchardLinux#123 and OrchardLinux#128 were closed. Where main carries a topic, main's version is kept; the left-out parts that warm restart and suspend need come back in OrchardLinux#107 and OrchardLinux#117. This branch's own patches in devices/s8000, drivers/base and drivers/usb are renumbered to follow main's.
Bring this branch onto current main. Main has since merged OrchardLinux#124, OrchardLinux#122, OrchardLinux#118, OrchardLinux#121, OrchardLinux#110, OrchardLinux#127, OrchardLinux#101, OrchardLinux#126, OrchardLinux#108 and OrchardLinux#111, several in part or reworked, and OrchardLinux#123 and OrchardLinux#128 were closed. Where main carries a topic, main's version is kept; the left-out parts that warm restart and suspend need come back in OrchardLinux#107 and OrchardLinux#117. This branch's own patches in devices/s8000, drivers/base, drivers/pmdomain and drivers/usb are renumbered to follow main's.
From OrchardLinux#110, the part main did not take with the stable USB serial: the platform layer embeds each supported board's pristine DTB and a compatible-to-file map in the initrd. Before switching root, the initrd copies the running board's tree to /run/orchard-kexec/pristine.dtb, or, after a warm restart, the retained tree the previous kernel named with orchard_warm.dtb=, and records the boot ID next to it. Warm restart boots the next kernel with that tree, never with one rebuilt from an updated /boot. No feature table is added: whether warm restart is offered is decided from the mechanisms it uses, not from a feature state. Assisted-by: LLM
Bring this branch onto current main. Main has since merged OrchardLinux#124, OrchardLinux#122, OrchardLinux#118, OrchardLinux#121, OrchardLinux#110, OrchardLinux#127, OrchardLinux#101, OrchardLinux#126, OrchardLinux#108 and OrchardLinux#111, several in part or reworked, and OrchardLinux#123 and OrchardLinux#128 were closed. Where main carries a topic, main's version is kept; the left-out parts that warm restart and suspend need come back in OrchardLinux#107 and OrchardLinux#117. This branch's own patches in devices/s8000, drivers/base, drivers/pmdomain and drivers/usb are renumbered to follow main's.
Bring this branch onto current main. Main has since merged OrchardLinux#124, OrchardLinux#122, OrchardLinux#118, OrchardLinux#121, OrchardLinux#110, OrchardLinux#127, OrchardLinux#101, OrchardLinux#126, OrchardLinux#108 and OrchardLinux#111, several in part or reworked, and OrchardLinux#123 and OrchardLinux#128 were closed. Where main carries a topic, main's version is kept; the left-out parts that warm restart and suspend need come back in OrchardLinux#107 and OrchardLinux#117. This branch's own patches in devices/s8000, devices/t8010, drivers/base, drivers/media, drivers/pmdomain, drivers/power and drivers/usb are renumbered to follow main's. Main's versions apply first now, so 0011 in drivers/media keep their change with a diff regenerated for the new context.
Bring this branch onto current main. Main has since merged OrchardLinux#124, OrchardLinux#122, OrchardLinux#118, OrchardLinux#121, OrchardLinux#110, OrchardLinux#127, OrchardLinux#101, OrchardLinux#126, OrchardLinux#108 and OrchardLinux#111, several in part or reworked, and OrchardLinux#123 and OrchardLinux#128 were closed. Where main carries a topic, main's version is kept; the left-out parts that warm restart and suspend need come back in OrchardLinux#107 and OrchardLinux#117. This branch's own patches in devices/s8000, devices/s8003, devices/t8010, drivers/base, drivers/media, drivers/pmdomain, drivers/power and drivers/usb are renumbered to follow main's. Main's versions apply first now, so 0011 in drivers/media keep their change with a diff regenerated for the new context.
Bring this branch onto current main. Main has since merged OrchardLinux#124, OrchardLinux#122, OrchardLinux#118, OrchardLinux#121, OrchardLinux#110, OrchardLinux#127, OrchardLinux#101, OrchardLinux#126, OrchardLinux#108 and OrchardLinux#111, several in part or reworked, and OrchardLinux#123 and OrchardLinux#128 were closed. Where main carries a topic, main's version is kept; the left-out parts that warm restart and suspend need come back in OrchardLinux#107 and OrchardLinux#117. This branch's own patches in devices/s8000, devices/s8003, devices/t8010, drivers/base, drivers/media, drivers/pmdomain, drivers/power and drivers/usb are renumbered to follow main's. Main's versions apply first now, so 0011 in drivers/media keep their change with a diff regenerated for the new context.
Bring this branch onto current main. Main has since merged OrchardLinux#124, OrchardLinux#122, OrchardLinux#118, OrchardLinux#121, OrchardLinux#110, OrchardLinux#127, OrchardLinux#101, OrchardLinux#126, OrchardLinux#108 and OrchardLinux#111, several in part or reworked, and OrchardLinux#123 and OrchardLinux#128 were closed. Where main carries a topic, main's version is kept; the left-out parts that warm restart and suspend need come back in OrchardLinux#107 and OrchardLinux#117. This branch's own patches in devices/s8000, devices/s8003, devices/t8010, drivers/base, drivers/media, drivers/pmdomain, drivers/power, drivers/soc-apple and drivers/usb are renumbered to follow main's. Main's versions apply first now, so 0011 in drivers/media keep their change with a diff regenerated for the new context.
Bring this branch onto current main. Main has since merged OrchardLinux#124, OrchardLinux#122, OrchardLinux#118, OrchardLinux#121, OrchardLinux#110, OrchardLinux#127, OrchardLinux#101, OrchardLinux#126, OrchardLinux#108 and OrchardLinux#111, several in part or reworked, and OrchardLinux#123 and OrchardLinux#128 were closed. Where main carries a topic, main's version is kept; the left-out parts that warm restart and suspend need come back in OrchardLinux#107 and OrchardLinux#117. This branch's own patches in devices/s8000, devices/s8003, devices/t8010, drivers/base, drivers/media, drivers/pmdomain, drivers/power, drivers/soc-apple and drivers/usb are renumbered to follow main's. Main's versions apply first now, so 0011 in drivers/media keep their change with a diff regenerated for the new context.
|
Checked on an iPad 5 (J71t) on 2026-11-13 with a user install image built from main Confirmed: the Mac keeps recognising the J71t, with the same |
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
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