Skip to content

Adding a headset

TL;DR. A headset is a repository of its own, overpressure/<codename> (the vendor's internal name, a Python identifier), cloned into devices/<codename>/ of an overpressure checkout while it is developed. It starts from overpressure/headset-template, which loads, passes its CI and offers one step from the first commit. Its headset.json names it and the headset interface it was made for; its package tooling exports HEADSET, a Headset subclass that names its commands and its window's steps. Add an installer plan, dependency checks and a RAM boot where it has them, build on the generic modules below, and check it with overpressure devices and overpressure --device CODENAME steps. Once it has a release, an entry in overpressure/catalogue.py makes it downloadable. The PICO 4 (overpressure/phoenix) is the worked example.

The repository

An owner of the organization creates overpressure/<codename> from the headset template (Use this template), together with the headset's team and its rulesets (GOVERNANCE.md, the organization's part). The team clones it into the overpressure checkout and gives it its names, once:

git clone https://github.com/overpressure/<codename> devices/<codename>
python devices/<codename>/scripts/new-headset.py <codename> "<Name>" "<SoC>"
overpressure devices

That commit is a headset with everything below except its images: headset.json, HEADSET with one command (dev status) and two steps, its settings and doctor checks, host tests, a README in the template's form, CLAUDE.md, docs/, CI, the release workflow, issue forms and CODEOWNERS.

devices/<codename>/   a clone of overpressure/<codename>
  headset.json     codename, name, version, the headset interface (api), commit and date (git archive's)
  __init__.py      makes devices.<codename> importable
  README.md        what works and what doesn't, and how to install it: the headset README template's form
  CLAUDE.md        its rules and hardware workflow
  env.example      its keys, with their comments: a developer's overrides (docs/reference/settings.md)
  tooling/         its host tooling: HEADSET in __init__.py, the command modules
  tests/           its host tests (with an __init__.py), run by python -m unittest
  docs/            its documents: use/, internals/, develop/ and reference/, as overpressure's
  .github/         its CI (against overpressure's main) and its release workflow
  ...              whatever its images need (the recovery, userspace, sources, scripts)

Its README.md is for owners, not developers, and follows the template: the same sections and rows of what works for every headset, so that they read alike. python scripts/check-docs.py --repo devices/<codename>, which the headset's CI runs, checks it against the template.

headset.json

{
 "codename": "example",
 "name": "Example VR 1",
 "version": "2026.12.0.dev0",
 "api": "2.0",
 "commit": "$Format:%H$",
 "date": "$Format:%ct$"
}

api is the headset interface it was made for, MAJOR.MINOR (the headset interface): discover() loads only a headset this overpressure runs, and lists the others as refused with the reason (overpressure devices). A new headset is made for the newest interface: its recovery and its installed system run on the headset runtime. .gitattributes marks headset.json export-subst, so a release zip carries its commit and time.

version is the headset's calendar version (releasing.md): main carries the next release as a development version, which a release's version pull request turns into the release (python scripts/release.py bump beta --version-file devices/<codename>/headset.json, from the overpressure checkout's root).

Releases

An annotated tag that is headset.json's version (2026.12.0b0) makes a GitHub release with the source zip (git archive, one top folder) and its .sha256. A headset's release.yml runs its CI on the tag, then calls overpressure's headset-release.yml, which takes the codename and the name from headset.json, checks the tag, writes the notes, makes the release and closes the issues it brings. overpressure headset add CODENAME and the app's + take it from there (headsets in devices/).

CI

A headset's ci.yml calls overpressure's headset-ci.yml with its codename (and kernel: true when it pins a release of overpressure/linux), and keeps one job of its own, ci, the check its rulesets require, which passes when that run did. The shared run checks out overpressure's main, the headset into devices/<codename>, and runs its tests on Linux, Windows and macOS, ruff/ty on its folder, its shell tests (tests/test_*.sh, in dash) and scripts/c-tests.sh where it has them, shellcheck, the documents' links, the private-data scan over its history, actionlint, and with kernel the kernel's pin and contracts; a tree that passed against the same main is not tested again. overpressure's CI runs its main, and the oldest of its releases that overpressure still runs, against every change of the generic code (the headsets job, its codename in the matrix and a required check of each). For a change both sides need, the headset's pull request passes overpressure: with the branch of overpressure's pull request while both are in review, and drops it before it merges, once overpressure's has. The workflows' pins agree: uv is the app bundle's version, and setup-uv and actionlint are pinned the same in each (tests/test_workflows.py).

Images on Valve's kernel

A headset on Valve's kernel and Holo builds with overpressure's build/ scripts, which overpressure runs with its folder: its userspace/build.sh gives its prefix (PREFIX, SUPER_MIB), the units and ELF dependencies it leaves out and its adaptation hooks (headset_snapshot, headset_files, headset_system, headset_session), its userspace/build-on-headset-hook.sh what runs beside the build on the headset (before_build, after_build; an older headset's scripts/build-on-headset-hook.sh counts too), and its kernel.json pins its release of overpressure/linux and, under build, gives its device tree, config fragment and host name, which build-kernel.sh builds the kernel with (an older headset's kernel/build-tree.sh, which sets them and sources build-kernel-tree.sh, counts too). Its system takes the headset runtime's share: overpressure-base from overpressure/packages and the runtime's library and recovery files, and its etc/overpressure/headset. How the images are built is otherwise the headset's own business. The PICO 4 keeps overpressure's recovery (Alpine) and boots its userspace, built from Valve's Holo packages, on Valve's kernel, which its kernel.json pins.

The organization's part

What the owners and core set up for a new headset, so that its team can start with its first pull request (GOVERNANCE.md, A new headset joins). The PICO 4's (phoenix) is the model for every setting; <codename> is the headset's codename, <soc> its SoC's layer.

The owners, in the organization's settings, in this order:

Step What
The tracking issue [Headset] <Name> in overpressure's issues: the headset, its SoC, the people, where their work is today
The repository overpressure/<codename> from the headset template, public; its settings as phoenix's: squash and rebase merges only, auto-merge, branches deleted after merging, no wiki, projects or discussions, overpressure as its homepage, topics for the headset and its SoC
Its rulesets main only by pull request with a green ci (no deletion, no force push, linear history, review threads resolved); the shared files, which its CODEOWNERS gives core (.github/, headset.json), by a code owner's review; release tags (refs/tags/v*, refs/tags/20*) never move, and only the team <codename> creates them
The team <codename> closed; maintain on overpressure/<codename>, write on overpressure/linux and overpressure/packages; on the new repository core gets write and triage triage. A new SoC also gets its team soc-<soc>; maintainers of a headset on an existing SoC join that team only once they maintain its layer
The social preview brand's github/social/<codename>.png, uploaded in the repository's settings (Social preview)
The invitation last, with the welcome, since GitHub mails it at once: into the organization (two-factor authentication) and into the team <codename>

core, by pull request (branches and rulesets through the API), as soon as the repository exists:

Repository What
overpressure/<codename> the naming commit (scripts/new-headset.py), unless the team makes it
overpressure/brand before the room and the social preview, the first: the room's icon matrix/<codename>.svg, the headset seen from the front as it really looks (its shape, cameras and straps), in the visor's blue on the dark tile and without the maker's branding, rendered to its .png (its name in scripts/render.py, its entry in mockups/matrix.html); the repository's social card github/social/<codename>.png (1280 × 640): its name, description and topics an entry in github/social/cards.json, its name in scripts/render.py, which renders it
overpressure/matrix the headset's room #overpressure-<codename>:matrix.org, which the README's chat badge links: config/rooms/<codename>.yaml (a headset's room copied: its name, address, topic, icon <codename>, the names it may have had) and its key in config/space.yaml's rooms. Merged, the Space workflow run by hand with create ticked (after a dry run without) creates it with phoenix's permissions, its icon and its place in the space. Goggles, the bot, announces the headset once its repository is public, and each of its releases
overpressure/linux the branch <codename>/7.2 from <soc>/7.2; its line in .github/layers and its row in .github/README.md, by a pull request into common/7.2 that moves up the layers; rulesets as phoenix's: the branch in Layers change by pull request, <codename>/7.2 is merged by <codename>, <codename>'s kernels are tagged by <codename> (refs/tags/<codename>/*), and those tags left out of Other tags are made by core. Until the headset's repository has kernel/build-tree.sh, its branch builds nothing and passes
overpressure/packages the folders <codename>/ (its layer) and headsets/<codename>/ (its image definition), each with a .gitkeep until its first packages; their CODEOWNERS entries (@overpressure/<codename> @overpressure/core); its row in the README
overpressure/.github its row in the organization's profile, profile/README.md, the page GitHub shows for the organization: the repository, and the headset as in development
overpressure its row in the README's Headsets table (in development, until its first release) and in CLAUDE.md's table of headsets

Later, when the headset gets there:

When What
Its first packages its image definition in headsets/<codename>/ (the .gitkeeps go), its codename in packages.yml's HEADSETS, its packages' name prefix in the layout tests
Its kernel.json with its build values its branch in overpressure/linux builds. Its first build starts by itself from the ccache of another headset on its SoC's layer, as long as it compiles in the same paths and with the same compiler as theirs (build-kernel.sh does); the build's ccache statistics show how much the two configurations share
Its first release its entry in overpressure/catalogue.py and its codename in the headsets job of ci.yml, whose checks become required; the profile names it among the supported headsets

What overpressure already does

Most of what a headset on its stock Android kernel needs is generic:

Need Module
Its settings: serials, the EDL backup, the Firehose loader, edl-ng, the NCM Python, the owner's SSH key overpressure.localconfig.DeviceSettings
Its dependency checks: settings, EDL backup and tools, adb and fastboot, Windows' USB link (the build container is checked for every headset) overpressure.doctor
Stock firmware: a boot image or partitions from the vendor's OTA, checked against the zip overpressure.ota
A file pinned by size and SHA-256 out of a vendor's remote zip (a loader, say), over HTTP ranges overpressure.ota.PinnedMember, fetch_pinned
A recovery: Alpine Linux in the stock boot image, kernel and device trees untouched overpressure.recovery_ramdisk (a Spec: packages, overlay, prebuilt files)
overpressure's recovery on that ramdisk and the installed system's first process and policies: init, PID 1, services, the USB link, the read-only storage, the recovery deadline, preinit with the headset's hooks, boot attempts (runtime.md) overpressure/runtime/, overpressure/packages' overpressure-base, overpressure.contract
A boot image's ramdisk and command line changed, the result checked overpressure.bootimg.ramdisk_tree, with_ramdisk
adb and fastboot, fail-closed, every command naming the serial; the wait for Android's boot; a partition's size overpressure.android
Flashing through fastboot, big images sparse; the RAM boot overpressure.fastboot (flash, ram_boot)
Qualcomm: the SoC ID, EDL with edl-ng or bkerler/edl, into EDL from Android, partition sizes from the rawprogram maps overpressure.qualcomm
A full EDL backup with its manifest, an EDL write verified by readback overpressure.qualcomm.capture_backup, write_verified
Counting a vendor's USB devices (EDL) on every system, no device opened overpressure.qualcomm.usb_count, edl_devices
Backups that every write is checked against, a partition's image in them overpressure.backup
A run on the headset that records every step and command, with bounded waits and HTTP fetches overpressure.evidence.Runner
The read-only storage policy a Linux stage enforces overpressure.storage
Bounded waits, running tools, SSH with the project's key, Windows' USB network overpressure.process, overpressure.ssh, overpressure.windows_ncm
Its assets out of the stock folder: the folder checked, files out of its ext4 images (dump) and FAT images (copy_matching), the assets manifest overpressure.assets
Reading ext4 and FAT12/16/32 images without mounting them overpressure.ext4, overpressure.fat
A Linux build script taking a file out of a stock ext4 image scripts/stock-lib.sh

The headset interface

A headset imports overpressure only through overpressure.api.vMAJOR, the interface's module for its major version: from overpressure.api.v2 import REPO, qualcomm and from overpressure.api.v2.headset import Step. Its headset.json names the version it was made for, "api": "MAJOR.MINOR". overpressure stays backwards compatible, so an older headset release keeps installing:

  • A minor version only adds. A new name, a new optional argument or a new field raises the minor of its major in SUPPORTED (overpressure/headset.py). A headset made for 2.2 runs on every overpressure that runs 2.2 or a later 2.x.
  • A change that breaks anything makes a new major. overpressure.api.v3 gets the new interface, and v2's modules become adapters that keep interface 2's names and behaviour on top of it. Both stay in SUPPORTED until the old major is retired, at the earliest in the release after its headsets moved on.
  • A retired major leaves SUPPORTED for RETIRED, with the last overpressure version that ran it: a release made for it is refused with that version to use.
  • CI keeps it true. overpressure's headsets job runs each headset's main and the oldest of its releases this overpressure still runs (overpressure headset releases CODENAME --oldest-supported): their tests against the change.
  • Downloads take what runs. headset releases marks each release this overpressure cannot run, with the reason; stable and beta take the newest that runs; the window lists only those.

Today v2's modules are overpressure's own, the same objects at run time, so a patch in a headset's test reaches every caller. Interface 1 is retired (overpressure 2026.11.0b1 was the last to run it): interface 2 is its last minor with every name of overpressure's recovery in its new form (overpressure.recovery with Recovery and QualcommRecovery, overpressure.recovery_ramdisk, Roles.start_recovery_task, the look's MAKER_RECOVERY for the maker's own recovery).

What a headset may use

A headset declares; overpressure draws and runs. A headset has no UI code: the app builds every page from what the headset declares: its steps, its plan's stages and tasks, the questions it asks, the notes it writes and its finished page. Interface 2 is what overpressure.api.v2 exports: this list groups it by purpose, and the reference lists every module and name with its signature. A headset's tests use the same (the command line and the app are overpressure's to test).

What Where
The headset and its steps: Headset, Info, Command, Step, Param, Workflow, Action, AfterInstall, BackupSet, INSTALL, tools_step, ram_boot_step, manifest overpressure.headset
The installer: Stage, Task, Ask, Field, Failed, NoBackup and the Context a task runs in (run, output, progress, note, log, ask, settings, set_setting, remember, recall, clock, memory, completed) overpressure.install
Words for the window's backup controls: HOW_TO_IMPORT, HOW_TO_EXPORT, missing(folder, needed_for) overpressure.backup
Settings and checks: DeviceSettings, load, update; Check, Host and the check states; UsbMode overpressure.localconfig, overpressure.doctor, overpressure.usbaccess
Waits for the headset in a new USB mode: replug_until (a wait that runs out asks for a replug, or for the link's fix), replug, link_ask; what the USB bus holds (seen) and a listing that leaves a device out (unusable); adb's and fastboot's device lists (device_rows) overpressure.install, overpressure.usbaccess, overpressure.android
The headset's USB network link on Linux: its Gadget (IDs, product, network, lease, NetworkManager profile), links, problem and its fix; the doctor's link_check overpressure.usblink, overpressure.doctor
The owner's answers: Wi-Fi (ask, remember, held, problem, keyfile, COMMAND: a NetworkManager keyfile over SSH's stdin), the owner's SSH key (ask_public_key); the headset's own battery before writes (headset_refusal) overpressure.wifi, overpressure.ssh, overpressure.power
Valve's kernel: the pinned release (Release, release, fetch, current, mismatches, build) and the contracts (Contract, check, source_file, IN_PACKAGES); a boot image with it (command_line, keyed_words, appended, with_kernel, DEBUG, trace_words) overpressure.kernelpin, overpressure.kernelimage
The image's packages: pacman's databases and closures (Database, closure, repositories, lock), the downloads before the install (Prefetch, manifest, local) overpressure.pacman, overpressure.prefetch
The headset runtime (runtime.md): overpressure's recovery and the installed system on it (unless Spec.runtime and RUNTIME decide otherwise), the PC's side of its contract (RUN, LIB, ETC, CONTACT, TEST_RUN, TEST_AUTHENTICATED, TEST_CONNECT_TIMEOUT, TEST_TIMEOUT, BUILD_INFO, HEADSET, WORD, word) overpressure.recovery_ramdisk, overpressure.contract
The executor's side: overpressure.roles.Roles, which a headset's plan derives from, holds the tasks every plan shares (its steps, the computer check, find, the consent, Wi-Fi, the SSH key and the Wi-Fi profile, the recovery's flash_task and connect_task with the done checks prepared and flashed, the EDL backup, the check workflow's check_part), with hooks (client, link, step_values, saved_identity, capture_backup, verify_backup, before_edl) and texts the headset words; overpressure.recovery.Recovery is the PC's side of its own systems by a Profile (its names: image prefix, folder, build tree, installer, reboot program, session, data label) and hooks (authenticate, same_headset, partition_size, prepare_stock, before_login, link_retry, check_before_install, installed_started, build_epoch, build_commit, headset_folder, prefetch_cache), with Modes (fastboot, the maker's system, our own; before_leaving_stock) and InRun (the replug waits); overpressure.look.Look the look, which a headset's look completes (maker_system, bootloader, edl_workflows); overpressure.edl.QualcommHeadset a Qualcomm headset's adb and EDL steps (before_leaving_stock), and overpressure.recovery.QualcommRecovery the two together, which a Qualcomm headset's development class derives from (EDL mode again from the maker's system or our own); Recovery.image its recovery image (recovery_ramdisk_image, with_kernel) and the restore's writes (authorize_fastboot); overpressure.acceptance.AcceptanceRunner its acceptance runner (FINGERPRINT, STOCK, PREFLIGHT_SCRIPT, STATUS_MARKER, REBOOT, authorization), to which it adds its checks of the installed system; overpressure.devicecli.DeviceCommands and overpressure.devcli.DevCommands its command lines, which a headset extends with its own words (add_own, run_own); the runtime's overpressure-install writes on the headset by its values (OP_IMAGE_PREFIX, OP_HEADSET_DIR, OP_VENDOR_DIR, OP_WRITE_PARTS, OP_WIPE_PARTS) overpressure.roles, overpressure.recovery, overpressure.look, the runtime
A task's parts: Task.parts, a tuple of Part(title, estimate), its parts in order, one bar across them by their estimates (the window shows such a task as one task, its bar across its parts); the task tells which part begins with ctx.begin_part(index) (from 0) or its program's line progress part N: text (progress.begin(N, text), from 1), and its progress lines then fill that part: the bar never goes back, and a part without them moves to and fro overpressure.install, overpressure.progress
The stock system's debug start after a restore: Recovery.first_start_boot(stock) gives the boot image of its first start with USB debugging on, made from its own (none by default: ValueError), which restore(debug_start=True) and dev restore --debug-start write in place of the backup's for the system part, and Roles.restore_part(part, *options) passes; a yes or no before the start, Field(choice=True), a checkbox whose answer is "1" or "" overpressure.recovery, overpressure.devcli, overpressure.roles, overpressure.install
The install's downloads and parts: Recovery.install(send_downloads=False) and dev install --download-on-headset send none of this PC's downloads (the headset fetches everything through its connection); the install's parts are SEND, BUILD (the build on the headset, whose end makes the file system on the system partition) and START (the boot image, the keys, the stock system's files, the start); every event the engine writes for the window carries its time (seconds); doctor.run(headset, builds=False) runs none of the build container's checks, which start the container, and Roles passes it where the plan installs no builds (doctor.BUILDS in NOT_INSTALLED); the look's version of an installed branch carries the commit it was built from (the image's /usr/share/PREFIX/version), as the app's headset page shows the support's after its branch overpressure.recovery, overpressure.devcli, overpressure.install, overpressure.look
Tasks without a row, and the install in halves: Task(shown=False) runs in its place but is not listed (its status and progress stay in its log; its asks and notes show), for a task that only takes an answer the window asks before the start; Recovery.install(only=BUILD_ONLY) and dev install --only build build the system into super and stop, only=START_ONLY and --only start go on from that build (the boot image, the keys, the stock system's files, the start), so each half is a task of its own; Roles.start_recovery_task(title, where) flashes overpressure's recovery and logs in to it as one task. The window shows no parts: a task of parts shows as one task. A doctor check's role, Check.role: OWNER (the default: what this computer must have), INSTALLER (what the installer downloads or records itself) or DEVELOPMENT (what only development needs); doctor.owners(checks) is the owner's view, which overpressure doctor and the installer's computer check show (--development: every check), and the shared checks carry their roles (the serials, the backup, the tools and the loader the installer's, the build container and Windows' NCM development's); The look fetches the pinned platform-tools (Look.fetch, by default look.DEFAULT_FETCH) when a headset is on USB and this computer has no adb yet; a failed download is the look's note (look.NO_TOOLS). An install's build records recovery.BUILDING before its first write, and restore() then brings everything back as after an install; restore(only="system" or "data") writes only from overpressure's recovery in recovery overpressure.install, overpressure.recovery, overpressure.devcli, overpressure.roles, overpressure.doctor, overpressure.look
Every question before the start: Headset.questions(workflow, found) names the asks a workflow needs (a consent, a form, something to do first), leaving out an action the latest look (found, None when there is none) shows done, which the app's server then answers for the engine; which the app asks on its ready page and the engine takes with --early (ctx.ask of one of them asks nothing); a form's Field.setting fills it in from the owner's settings (wifi_ssid, wifi_password, ssh_public_key); a consent's Ask.consent is the sentence the start button agrees to ("I agree that …"); what the owner does mid-run with the headset is no question but ctx.instruct_until(ask, what, seconds, operation), which shows it and waits until the headset shows it is done, as replug_until does with its replug overpressure.headset, overpressure.install
A headset's own folders and several backups: Settings.CODENAME puts each default under backup/ or assets/ into the headset's own folder there (own_place; SHARED), load finds a file not moved yet where it is, and take_over moves what an earlier release kept in the shared folders, once, from Headset.settle_files (which overpressure calls as it starts, settle); a headset's backups are the folders beside its way back (backup.kept, Kept), one of which backup.use checks whole before Headset.adopt_backup names it, backup.delete deletes one that is neither the way back nor the headset's only backup, and an import becomes the way back only when there is none (backup.adopts) overpressure.localconfig, overpressure.backup, overpressure.headset
Settings without .env: load reads the defaults, the records (records, record: RECORDS), the owner's settings (owner_settings, save_owner_settings: OWNER_FILE, OWNER) and a developer's .env and environment; update without a path records; migrate and retire move an earlier .env out (RETIRED), leaving where programs came from (DEVELOPER) overpressure.localconfig
An EDL loader freed after a session that broke mid-transfer: unstick reads what it still sends (drain_session with ComReader, Qualcomm's serial driver on Windows, or UsbReader.queued), then restarts it normally, and the caller enters EDL mode again from the system that starts; nothing is sent to it before the restart overpressure.qualcomm
A new super's layout: op_list reads a full OTA's dynamic_partitions_op_list, build writes the metadata of its partitions (each one read-only extent, aligned on the disk) for a Layout; partitions reads it back overpressure.lp
A catalog build's mirrors: sources (its url, then its mirrors) and fastest (the host that serves a range of the archive fastest, a host with another size left out) overpressure.ota
A look at the plugged-in headset without changing it: Headset.assess returns a Found (its state, one of STATES: ABSENT, MAKER, OVERPRESSURE, BOOTLOADER, MAKER_RECOVERY (the maker's recovery), EDL, UNKNOWN; what runs, short facts, the workflows that fit, a note), and the app offers what fits overpressure.headset
A whole backup written back over EDL: write_back_plan (LUN by LUN from the maps, WIPED zeroed at their start, NOT_KEPT left alone), backup_lun_sectors and storage_sectors with check_storage (the LUNs' own sizes against the backup's), write_back (each write read back and compared), Write overpressure.qualcomm
The bootloader's restart: Fastboot.restart_bootloader returns once the headset has left fastboot and is listed again (macOS's fastboot otherwise writes to the leaving headset) overpressure.fastboot
Paths and programs: REPO, bounded waits and running tools (a failed one raises CommandFailed, a RuntimeError with the whole output), progress lines, a step's command line, the pinned host tools, HTTPS downloads (read, urlopen, answers, DownloadError) overpressure.api.v2 itself, .process, .progress, .runner, .tools, .web
Formats and devices: everything in the table above, and avb, compress, cpio, kernelinfo, payload the modules named there

Two rules keep the window the core's own:

  • A headset's texts never name the window's controls. Where a message has to point at one, it takes the core's words: backup.HOW_TO_IMPORT and backup.HOW_TO_EXPORT, or backup.missing(folder) for a backup that is not on this computer. A task fails for a missing backup with NoBackup(folder); the window then offers Import backup… beside Retry.
  • What a second headset needs moves into overpressure, with its tests, and joins this list.

HEADSET

devices/<codename>/tooling/__init__.py exports HEADSET, an instance of a subclass of overpressure.headset.Headset:

from overpressure.api.v2.headset import Command, Headset, Info, Param, Step


class Example(Headset):
    info = Info("example", "Example VR 1", "SoC name", "one line about the approach")

    def commands(self):
        # command word -> module of this package whose main(argv) runs it
        return {"build": Command("image", "build the boot image"), "dev": Command("devloop", "the development loop")}

    def steps(self):
        # the window's steps, in order: building the images, then working on the headset
        return (
            Step(
                "boot-image",
                "Boot image",
                "Image",
                ("build", "--firmware", "{firmware}"),
                "The recovery boot image.",
                (Param("firmware", "Firmware", "1.0", "choice", ("1.0", "1.1")),),
            ),
            Step("flash", "Flash", "Headset", ("dev", "flash"), "Writes the boot image.", writes=True),
        )


HEADSET = Example()
  • Commands are the headset's command line: overpressure --device example build ... runs devices/example/tooling/image.py's main(["--firmware", ...]). With keep=True the command word is passed on too (one module behind several commands). headset=True, or a tuple of subcommands, marks what touches the headset: the disclaimer and the power check come first (the command line).
  • Steps are what the window offers, in the groups Setup, Image and Headset. {name} in a word takes a parameter's value. script=True runs a program from the headset's folder; linux_root=True runs as root in the build container (Linux-root steps): its paths lie in the repository or under /var/tmp, and a tool it needs goes into the build image, by pull request to overpressure/builder, then a new pin in overpressure/linux.py. writes=True makes the window ask first.
  • Settings are a dataclass derived from overpressure.localconfig.Settings with the headset's own key prefix, read in layers: the defaults, what the installer recorded, the owner's settings and a developer's overrides (settings). Give a place or a tool a default, never a setting the owner must fill in: the installer records what it finds out. A headset on a stock Android bootloader derives from DeviceSettings: adb_serial, fastboot_serial, edl_serial, identity (default backup/<codename>/device.json), backup (backup/<codename>/stock), loader (assets/<codename>/firehose.elf), edl, ncm_python and ssh_public_key, with edl_program() and ncm() resolving the tools. Name its CODENAME: its defaults under backup/ and assets/ are then in its own folders there, so that several headsets share one computer; without it they are the shared backup/stock, backup/device.json and assets/firehose.elf. The headset adds only its own fields (the PICO 4's).
  • Output goes to the data root's out/, downloads to cache/ (overpressure.REPO: a checkout's or a release's own folder, the app's data folder, or OVERPRESSURE_HOME); the headset itself lies in its devices/. A headset names its own files relative to that root or by its own folder, never by overpressure's.

Dependencies

Headset.dependencies() returns the headset's checks for overpressure doctor: callables that take an overpressure.doctor.Host and return Check objects (name, what it is needed for, status, what was found, the fix). doctor.version_check covers programs that answer a version query; Host.linux(script) runs a probe in the build container. The build container itself is checked for every headset, and its image holds every Linux tool of the builds. A headset with DeviceSettings builds the rest from the shared checks: env_check, serial_checks, backup_check, loader_check, edl_tool_check, tool_checks (adb, fastboot), ncm_checks (Windows' USB link), usb_check (Linux's USB access to each of Headset.usb_modes(): the UsbModes, vendor and product ID, its tools open, such as adb, fastboot and EDL; a USB network needs none; a mode that carries a drive is storage=True, whose udev watch is turned off, label its USB product string, and access=False when no tool opens it) and driver_check (Windows' drivers for the modes whose driver names the package they need, as fastboot's and EDL's do: qualcomm.EDL_MODE names Qualcomm's). Example: devices/phoenix/tooling/doctor.py.

The installer

Headset.install_plan() returns the installer's stages (overpressure.install.Stage, each a list of Tasks); empty, the default, means no installer. A task runs in an overpressure.install.Context: it runs programs with their output streamed, reports progress (ctx.progress, or the programs' own progress lines; a task without them is shown against its estimate) and notes, asks the owner (Ask: a consent, an action, a form; secret fields never leave the engine) and records what it finds out (ctx.set_setting); a done check skips work whose output is already there. The engine keeps the state in out/install/<codename>/, resumes after a failure and drives the window through JSON events (the installer's engine). Reuse the headset's steps' command lines. Example: devices/phoenix/tooling/installer/install.py.

More than the install. Headset.workflows() returns the installer's workflows (Workflow: key, title, summary, whether it erases the headset), the install alone by default, and Headset.plan(key) each one's stages; with more than one, the window asks which. Headset.workflow_problem(key) says why one cannot run now. Workflow.changes=False marks one that only looks, such as a check: it starts afresh on every run and leaves the other workflows' progress and the record of what was installed as they are. The PICO 4 has an upgrade, the way back to stock and a check of the headset.

The backup as one file. Headset.backup_set() returns the backup, the identity, the other files and the settings the way back needs on another computer (BackupSet), and Headset.adopt_backup() records an imported one; with them overpressure backup export|import FILE and the window's backup card work.

Logs for a bug report. The window's Save logs… (overpressure support-bundle FILE) writes one zip with the installer's records of the headset (each step's log, every workflow's state) and this computer's system, the serial settings' values and the home folder masked in every text file. Headset.support_files(folder) adds the headset's own files there: its tools' logs, its device's own bundle. Headset.support_masks() names what else the zip must not show, each value with what it becomes, such as a code derived from the headset's chip that its tools log: masked in every text file as the serials are.

What the window says comes from the headset; the generic window names no product, OS or store:

  • Its Info names its card on the headset page (the name: the card speaks to owners in plain words) and heads Advanced mode (name, SoC, summary). A headset without an installer opens in Advanced mode only.
  • The finished page: Headset.after_install() returns an AfterInstall (title, text, Actions), and Headset.finished_page(workflow) another workflow's. An Action is a label and either a workflow (workflow=, opened at its start page) or the key of a step, opened in Advanced mode. By default the page says Installed, "Your headset is ready.", and offers nothing; the app adds Save logs and Done. Offer only what makes sense right after it. The PICO 4's:
from overpressure.api.v2.headset import Action, AfterInstall


def after_install(self):
    return AfterInstall(
        "Unplug it and put it on",
        "Your headset is ready. Unplug the cable, put the headset on and sign in to Steam.",
        (Action("Check the headset", workflow="check"),),
    )
  • Everything else (stages, tasks, asks, notes, the headset's state after a failure) comes from the plan's texts.

Flavours

A flavour is the system the install builds on the headset; every flavour runs on the same kernel, recovery and support for the headset's hardware. overpressure knows them (overpressure.headset.FLAVOURS, each a Flavour: key, name, summary, whether it can be installed yet):

Key Name What it is Can be installed
steamos SteamOS Valve's SteamOS as on the Steam Frame: Steam, SteamVR, Steam Link yes, every headset's default
overpressure-os overpressure OS Linux with open-source VR in place of Steam and SteamVR (its issue) not yet

A headset names the ones it offers in headset.json, the default first: "flavours": ["steamos", "overpressure-os"]; without the list it offers SteamOS alone. Headset.flavours() returns them. With two or more, overpressure.install.flavour_ask(flavours) is the install's question which one (a form whose field takes one of several options, Field.options: the app shows each as a card, one that cannot be installed yet with its note, never chosen), and chosen_flavour reads the answer. The install passes the key to the build (dev install --flavour KEY, dev prefetch --flavour KEY); an upgrade passes none and builds the one this computer installed (recovery.installed_flavour). To change it, the owner installs again.

Each flavour has three parts:

  • overpressure's, overpressure/build/flavours/KEY.sh: its session user, its masks, ELF exceptions and the hooks flavour_base, flavour_image, flavour_files, flavour_identity, flavour_state, flavour_system and flavour_session, each at its point of build-userspace.sh.
  • overpressure/packages', headsets/CODENAME/KEY/: the image's definition for that flavour (layers, pacman.conf, packages.txt, packages.lock). An older release's headsets/CODENAME/ is SteamOS's.
  • the headset's own, userspace/flavours/KEY.sh, when it needs one: sourced after userspace/build.sh, it adds to its settings and defines its hooks anew for that flavour (the PICO 4's SteamVR controller remapping and Steam Link's layer).

The installed system records its flavour (flavour= in /usr/share/PREFIX/version, flavour in the build's manifest), and the look shows it.

RAM boot

A headset whose bootloader has fastboot boot gets overpressure ram-boot and its window step by returning a target from Headset.ram_boot(), a subclass of overpressure.fastboot.RamBootTarget, and putting ram_boot_step(default_image) among its steps.

from overpressure.api.v2 import REPO
from overpressure.api.v2.fastboot import Fastboot, RamBootTarget


class ExampleRamBoot(RamBootTarget):
    up_timeout = 120
    refused_hint = "Boot the recovery from a partition instead: overpressure dev flash."

    def __init__(self, settings):  # the headset's settings (localconfig)
        self.settings = settings

    @property
    def fastboot(self):  # fastboot with the headset's serial
        return Fastboot("fastboot", self.settings.fastboot_serial)

    def image(self):  # the image to boot when none is given
        return REPO / "out" / "example-recovery.img"

    def enter(self):  # into fastboot, e.g. adb reboot bootloader
        ...

    def check_unlocked(self):  # raise unless the bootloader may boot an unsigned image
        ...

    def reached(self):  # raise until the booted image answers (network, ADB, ...)
        ...

ram_boot checks the image and that this headset is the only device in fastboot, calls the target in that order, and tells a refusal (Refused: no fastboot boot) apart from a failure.

Checks

overpressure devices lists the new headset, and overpressure --device CODENAME steps prints its steps with their command lines. The generic tests (tests/test_overpressure.py) check that every registered headset's command modules and step scripts exist; its own tests run with python -m unittest discover -t . -s devices/<codename>/tests.