Skip to content

Installer: pick up iOS that checkra1n started in an earlier session - #168

Open
brkosebay wants to merge 7 commits into
OrchardLinux:mainfrom
brkosebay:submit/checkra1n-pick-up
Open

brkosebay wants to merge 7 commits into
OrchardLinux:mainfrom
brkosebay:submit/checkra1n-pick-up

Conversation

@brkosebay

Copy link
Copy Markdown
Contributor

Stacked on the named-device PR (#167). The first four commits are that PR; this one adds the last three.

What changes for people

On iOS 12 to 14, if the installer stops without quitting (a crash, a force quit, a Mac that lost power) while the device still runs iOS as checkra1n started it, starting the installer again goes straight back to the split. Before, it sent the device through another round into DFU mode, which restarts the device, possibly under a split that is running.

How

When the device is named by its ECID and checkra1n is the helper, the driver checks whether checkra1n's SSH server answers on that device (access_checkra1n::running). If it does:

  • the companion's helper is put there again, and an earlier helper is stopped first;
  • a split that helper was doing is in the engine's journal, and the new helper continues it;
  • the flow picks up at the split once the helper answers.

Only one pick-up runs at a time, and none while this run already holds a checkra1n session. The companion's token is now the one of the helper this run started.

access_checkra1n::companion is split into companion (start with checkra1n) and companion_on (a device it already started), which share one put_helper.

A clean quit is unchanged: at the split screen it still restarts the device into normal iOS through the companion.

Tested

iPhone 7 (D101, iOS 14.1), Apple silicon Mac, two other devices on USB running Linux:

  1. orchard install omarchy-a --ecid … --access checkra1n --split in a terminal: DFU from iOS, checkra1n "All Done", the split screen. Then the installer was killed with SIGKILL, so no restart request was sent.
  2. The same command again 5 s later: connect → choose-split in 2.3 s, with no DFU round and the helper answering ("Inspecting disk0; no storage changes have started").

Nothing was approved in either run. cargo test -p orchard-runtime -p orchard-flow passed.

🤖 Generated with Claude Code

brkosebay and others added 7 commits December 4, 2026 12:42
With the device named (--ecid, --location), the installer still waited
for other Apple devices to go: a second phone running iOS held up a
launch by the ibss route, and a device elsewhere running m1n1 or an
installed system held up any run. People who work on several devices
keep them plugged in.

With the target named, the driver no longer lists other devices as in
the way, and a device elsewhere in m1n1 or Linux doesn't count as
another device: palera1n and checkra1n only take devices in DFU,
recovery, Pongo or iOS, and everything of ours follows the target by
its ECID or port. What can't be addressed is guarded where it runs
(palera1n's start, and checkra1n's in the next commits). Unnamed, every
device still counts, and one in DFU mode always does.

Watcher::is_target says whether a listed device is the target itself
(by ECID, else by its last port), not merely one the rule ignores; the
list of devices in the way uses it to show the target beside them.

Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The flow held every start (the install system, the launcher's entries,
iOS with the helper) while other Apple devices were on USB. Some starts
are addressed to the device itself and can't take another one: the
ibss route (gaster's worker matches the ECID, chip and board, and
everything after it goes to the device's port), and checkra1n's start
of iOS, which waits for the devices checkra1n could take by itself.
Those no longer wait; palera1n and checkra1n as boot routes still do.

The command line's install passes the route named with --boot (or
ORCHARD_BOOT) to the flow, which decides by it.

Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
checkra1n can't be told which device to start: it takes any device in
DFU mode, and after it is done it waits for the next one. Its start of
iOS for the split needed exactly one device running iOS on USB, and
could take a second device that came into DFU mode meanwhile.

The start now knows the target's ECID (and its port while in DFU mode):
- before checkra1n runs, it waits up to a minute until no other device
  is in DFU, recovery or Pongo mode, and refuses with the devices'
  names after that;
- while it runs, another device coming into one of those modes stops
  it at once;
- once its log says "All Done" it is stopped, so it doesn't wait for
  the next device;
- only the device that tells the target's ECID over lockdown is asked
  for checkra1n's SSH greeting; other devices running iOS may stay.

Without an ECID there must still be one device running iOS, as before.

Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closing and starting the installer again while the device runs iOS as
checkra1n started it (its SSH server answers) sent it through another
round into DFU mode, which restarts the device, possibly under a split
that is running.

With the device named by its ECID and checkra1n chosen as the helper,
the driver now asks whether checkra1n's SSH server answers on that
device. If it does, the companion's helper is put there again (an
earlier helper is stopped first; a split it was doing is in the
engine's journal, and the new helper goes on with it), and the flow
picks up at the split when the helper answers. One pick-up runs at a
time, and none while this run already holds a checkra1n session.

access_checkra1n::companion splits into running() and companion_on()
for this.

Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…arted

The driver picked the companion's token by the helper the flow names.
Before the device's iOS version is known the flow names none, so the
overlay's token was sent to the helper this run had started through
checkra1n's SSH, and that helper refused every connection.

A helper this run put on the device through checkra1n has its own token,
and that token is used whatever the flow names. With checkra1n chosen
there is no overlay, so no token is sent until that helper runs.

Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant