Skip to content

Building

TL;DR. The installer has the headset build its own system; on a PC the same userspace build runs in the build container, for its package check, for trying a change to a package and for the manifest. Nothing of PICO OS's goes into the image: the install takes PICO OS's files from the headset's own backup, and assets writes the same files as folders for development. A weekly upgrade check says whether the image would still build on what Valve publishes meanwhile. The workflow from a change to the headset: development.md; the tests: tests.md.

Stock firmware

The system needs PICO OS's firmware and data files (DSP images, the head tracker, configuration). They are the same on every PICO 4 with that firmware. The image holds none of them: the install takes them from the headset's own backup (installed-system.md). For development, assets writes the same files as folders, from the same backup and with no download:

# Any system, no root and no Linux: every asset out of the backup (default: the one .env names)
# into assets/*-5.13.7
overpressure assets [--backup DIR] [--assets DIR] [KIND...]

assets (tooling/stock/assets.py) reads the backup's super (its system and vendor logical partitions), modem, dsp and bluetooth, checked against the backup's hashes, and writes each kind into a fresh assets/KIND-VERSION.new that replaces the old folder only when complete; VERSION is the backup's firmware number. It is Python only: the images are read by overpressure's read-only ext4 and FAT readers (overpressure/ext4.py, overpressure/fat.py), no e2fsprogs, mtools or Linux. stock-files packs the same kinds for the install. The results are proprietary: keep assets/ private.

Kind (assets/KIND-VERSION) Content From
graphics-firmware GPU firmware a650_*, the video codec's venus.* vendor /firmware, modem /image
sensor-data SLPI image, sensor configuration, lens configuration, controller models and data modem, vendor, system
wlan Wi-Fi chip firmware and board data modem
audio ADSP image, audio process files and DSP libraries, calibration database vendor, modem
stock-slam Compute DSP image, the tracker's bionic root, DSP modules and process shells modem, system, vendor, dsp

Each folder has a manifest.json (schema 2: the firmware, the sources by path prefix, every file's SHA-256), which stock-files --assets reads. Files keep the image's permissions and modification times where the host's file system has them, not its ownership. On Windows they carry no POSIX modes (the bind mount shows 0777 or 0755), so the userspace build installs them as 0644 files and 0755 directories, programs as 0755 explicitly.

Measured on PICO OS 5.13.7 (Windows 11, i7-12700KF, NVMe) Result
Assets compared with an extraction by debugfs and mtools every file byte-identical, every manifest identical
The ext4 reader on system, vendor, dsp and persist every file, link target, mode, owner and modification time as debugfs reads them
The FAT reader on modem.bin every file and its time as mtools reads them
Time and disk the five kinds from the backup in about 10 s, 128 MB of assets

For 5.13.7 every asset file from a backup is byte-identical to the same file from PICO's public full OTA of that firmware. The headset's own factory data (sensor registry and calibration, camera, IMU and lens calibration, the serial the fan's table follows, the Wi-Fi MAC addresses) stays in its persist partition, mounted read-only at boot (userspace.md). The recovery ramdisk image takes its stock boot image and the dev image its stock recovery (device-tree overlay and AVB footer) from the headset's EDL backup too. The user's backup remains the way back to stock and the reference of the write checks (installed-system.md).

The userspace build

# In the build container, as root (make userspace does the same with these defaults):
overpressure container run -- bash overpressure/build/build-userspace.sh devices/phoenix \
    /var/tmp/pico4-userspace-build out/userspace

The image holds no file of PICO OS's, only links to where they are on the headset (installed-system.md); the tracker's host pico4-slamd is one of the release's packages. The same build runs on the headset itself, which is how the installer builds (installed-system.md), and gives the same image root.

Option Effect
--refresh download current package databases and reinstall the base root; builds the project's packages here against them
--update-lock write OUTPUT_DIR/packages.lock for review instead of checking the build against the pinned lock (userspace.md)
--packages DIR a checkout of overpressure/packages instead of the commit userspace/packages.json pins: its recipes that differ from the pinned commit's are built here, the others come from the pinned release; a change to a package, tried in the image
--build-packages build every recipe here instead of taking the release's packages

Each step is skipped when its inputs did not change:

  1. Snapshot. The inputs (overpressure/, src/, userspace/, the shared recovery scripts, prebuilt/) and overpressure/packages at the pinned commit (fetched once with git into cache/packages/COMMIT, or the --packages checkout) are copied into the build root first, so the trees can be edited during a build.
  2. Build environment and project packages. overpressure/packages' build/packages.sh: Valve's Holo Core aarch64 preview root file system, pinned by SHA-256, unpacked once, with the packages the recipes build against, each pinned by the lock or the Holo snapshot. Package databases are downloaded by the first build and with --refresh only. The project's packages are the pinned release's, built on arm64 in that repository's CI, downloaded once into cache/packages-release/TAG and each checked against the release's SHA256SUMS, whose hash the pin holds; a --packages checkout's recipes that differ from the pinned commit's are built here in their place. With --build-packages or --refresh makepkg builds every recipe of the PICO 4's layers here, when its folder or the compiler changes. Each layer becomes a local pacman repository overpressure-LAYER.
  3. Base root. The definition's packages.txt installed by pacman from the project's layers, the Steam Frame hotfix repository and the Holo Core preview; reinstalled when the package list or pacman.conf changes, and with --refresh.
  4. Image root. An overlay on the base root: the project packages that differ from the base root's, the files the recovery shares (overpressure's runtime library and recovery policy, the PICO 4's values in /etc/overpressure/headset, pico4-reboot, pico4-splash), the session user and the SteamVR files from pico4-session in the user's home. The adaptation layer is the project's packages (overpressure-base, sm8250-base, pico4-base, -power, -audio, -xr, -session, -checks); their units are enabled as their presets (usr/lib/systemd/system-preset/50-*.preset) name them, the Frame's units the image does not use are masked. overpressure/elfdeps.py checks natively that the programs and libraries of the Frame's and the project's packages, and of those depending on them, find their libraries and symbol versions and that the programs' symbols are all defined; the script excludes a few optional programs by name.
  5. Manifest. The upstream packages are checked against the definition's packages.lock, then pico4-userspace.manifest.json with the sources, hashes, the installed size and package versions; the image root stays in the build root, where the headset's build makes super's file system from it.

Times on the same host (Docker on WSL2), with the pinned release; the image is 4.0 GiB installed:

Change Build time
nothing 2 min
everything: a new build root, the project's packages from the release and 1.9 GB of Valve's packages downloaded 8 min

Both still include writing an archive, about 1.5 min, which the build no longer does. A package built here (--packages, --build-packages) rebuilds in full; makepkg's stripping, debug packages and compression run emulated: about a minute for Monado.

Upgrade check

The image pins every package, which move only with a release (releasing.md). Whether the image would still build on what Valve publishes meanwhile is checked weekly in CI on GitHub's ARM64 runner (upgrade.yml, on overpressure's main, Mondays, or by hand), and on any computer with the build container:

overpressure container run -- bash overpressure/build/upgrade-check.sh devices/phoenix \
    /var/tmp/pico4-upgrade-check out/upgrade-check

overpressure's upgrade-check.sh needs none of PICO OS's files:

Part What it does Fails when
Userspace build-userspace.sh --refresh --update-lock in its own build root; upstream.py lock-diff lists every package that moved since the pinned packages.lock, the session's packages first a project package does not build, a patch does not apply, or a dependency stays unresolved

out/upgrade-check/upgrade-check.md is the summary; the CI run's page shows it. A moved package that still builds fails nothing: whether the session runs on it is the headset's check before a release.