Skip to content

Latest commit

 

History

History
107 lines (87 loc) · 5.7 KB

host.md

File metadata and controls

107 lines (87 loc) · 5.7 KB

This computer: install, update, doctor and setup

orchard fetches its own tools (palera1n, checkra1n, m1n1, Pongo) when a run needs them and talks to USB by itself, without libusb. What it takes from the computer is little, and doctor lists it with what each is for.

Installing and updating orchard

curl -fsSL https://github.com/OrchardLinux/tools/releases/latest/download/install.sh | sh
orchard update

The script puts orchard into ~/.local/bin (ORCHARD_BIN names another directory). It takes the file for this computer from the latest release (sh -s -- --nightly: the newest build of main that passed its tests), checks it against the published checksums, and replaces an older one in one step. On Linux it then runs orchard setup --ask usbmuxd: what installing on a device needs from this computer, installed with the system's package manager (apt, dnf, pacman, zypper, apk or xbps) only after you say yes; without a terminal it says the command instead. orchard update follows releases the same way (--nightly: main). macOS (Apple Silicon and Intel) and Linux (x86_64 and aarch64).

In WSL, Windows hands a device over only through usbipd-win, and only a device that is shared and attached. The device changes its USB identity at each step (iOS, recovery, DFU, Pongo, m1n1, the install system), and to Windows each identity is a new device. So the first time any command looks for a device, orchard shares every identity of the flows with WSL (usbipd policy add --effect Allow --operation AutoBind --hardware-id VID:PID, after one Windows administrator prompt) and keeps usbipd attach --wsl --auto-attach --busid BUSID running for the device's port for the rest of the WSL session, once however many commands run. Without usbipd-win it says orchard setup usbipd; when WSL may not start Windows programs or the prompt is refused, it prints the PowerShell commands to run instead, once. A device that waits a minute on Windows without reaching WSL is reported.

update does the same from the program itself and says when it is the newest already. orchard --version names the commit a build is from. A program built in a source checkout is not replaced: build it again.

doctor

orchard doctor

changes nothing. It lists what orchard takes from the computer, what each is for, whether it is there, and for what is not the command that gets it:

┌────────────┬──────────┬────────────┬───────────────────────┐
│ Check      │ For      │ State      │ Get it                │
├────────────┼──────────┼────────────┼───────────────────────┤
│ Python     │ building │ 3.14.0     │                       │
│ git        │ building │ ready      │                       │
│ Podman     │ building │ VM stopped │ orchard setup podman │
│ Free space │ building │ 30 GB      │                       │
│ ssh-keygen │ SSH      │ ready      │                       │
└────────────┴──────────┴────────────┴───────────────────────┘

A state in yellow is missing and orchard can get it with the command beside it. One in red is for you to do, and the last cell says what. In --json these are the states ready, missing and yours.

Name Is Needed for
usbipd (WSL) usbipd-win, and every USB identity of the device shared with WSL every command that works on a device
usb (Linux) a udev rule that lets your account open the device on USB in every stage, m1n1 and the serial consoles included every command that works on a device
python Python 3.11 or newer build, inputs: orchard's recipes are Python scripts
git git build, inputs: fetching the kernel's source, and a checkout's state
podman Podman, and on macOS its VM running build, inputs: the recipes compile in containers
ssh ssh-keygen install --ssh, and a RAM payload with the USB session
disk 10 GB free where the cache is build

Someone who only installs and starts systems needs none of the build's four. On macOS nothing is needed for USB.

--json gives {"ready": …, "checks": [{"name", "state", "needed_for", "detail", "setup"}]}.

setup

orchard setup podman
orchard setup usb git

gets the named things, one after the other, and prints each command before it runs it. Without a name it only shows what doctor shows.

Name Does
usb installs the udev rule (/etc/udev/rules.d/70-orchard-installer.rules) and has udev apply it; asks for your password (a window in a desktop session, else sudo). Reconnect a device that is plugged in
usbipd (WSL) installs usbipd-win with winget.exe install usbipd when it is missing, then shares every USB identity of the device with WSL (one Windows administrator prompt) and attaches a device that is plugged in
python, git, podman installs the package: with glu, else Homebrew, on macOS; with apt, dnf or pacman through sudo on Linux
podman, on macOS also creates its VM if there is none, and starts it

What is ready is left alone. ssh and disk are yours: orchard says what is missing and stops (unsupported). With no package manager it knows, a tool is yours too.

install and launch install the USB rule by themselves when access is refused, so setup usb is for the other commands, or for doing it ahead.