The recovery: the bootable Linux image¶
TL;DR. The recovery is overpressure's recovery in recovery of the original PICO 4 (A8110, phoenix), where
the installed system is built, written and rescued: an Android boot image with Valve's kernel and device tree
(below) and a ramdisk of Alpine Linux 3.24 with the project's init. build makes
its stock form, the stock kernel (4.19.81-perf+) and device trees byte for byte with that ramdisk, which is
the acceptance runner's boot image; dev image puts Valve's kernel in for recovery. Over USB-C it offers NCM
networking with SSH, telnet and a status page. Every disk and partition is read-only, except what
pico4-install writes on purpose (installed-system.md). With no PC using it, it returns to fastboot by
itself.
| Build | overpressure build --firmware 5.13.7-global-seko → out/pico4-recovery-<firmware>.img |
Into recovery |
overpressure dev image, dev flash (hardware-testing.md) |
| Connect | ssh root@172.16.42.1 or http://172.16.42.1/ |
| Code | tooling/stock/image.py on overpressure/recovery_ramdisk.py with overpressure's headset runtime; the PICO 4's overlay initramfs/ |
The installed system (stage 2, userspace.md) starts without it: its boot image has no ramdisk (installed-system.md).
In recovery: Valve's kernel¶
dev image builds the recovery image from this image with
tooling/development/boot_images.py: the same ramdisk and command line with Valve's kernel and
device tree from out/kernel (so kernel fetch comes first), the stock recovery_dtbo, as a whole recovery
partition with the stock vbmeta behind it; dev-image.json records recovery_kernel: valve. The kernel is the
installed system's, so the headset builds its system on the same kernel wherever it builds it
(installed-system.md), with the fan's MCU on ttyHS1; Windows 11 takes its USB link
without the NCM initialization, and the dev loop sends it none.
| Check on Valve's kernel | Result |
|---|---|
| Start | SSH 18 s after dev flash, without the NCM initialization |
| Storage | every one of the 99 sd* disks and partitions read-only; loop and nbd devices are left alone, as on the stock kernel |
| Writes | pico4-install makes the partition and its disk writable for a write (this kernel counts the disk's flag) and both read-only again; a data mount that BusyBox falls back to read-only counts as a failure |
| Deadline | pico4-reboot bootloader reaches fastboot in 6 s; dev reboot starts the recovery again from there (20 s) |
| Hardware | /dev is devtmpfs; the battery reads; the GPU, Wi-Fi and Bluetooth firmware is missing (the recovery needs none) |
| Clock | starts in 1971 (no RTC): pico4-install build takes the PC's time |
A panic reboots after 5 s (panic=5) into the recovery again (the bootloader message); not tried.
The image¶
| Part | Content |
|---|---|
| Kernel and device trees | the stock image's, byte for byte, with every other header field (load addresses, page size, OS version, patch level) |
| Kernel command line | the stock one plus printk.devkmsg=on (the init's /dev/kmsg lines are not rate-limited), rng_core.default_quality=1000 (the hardware RNG credits entropy, so dropbear's first host key cannot block) and console=none (the tree's UART console at 115200 baud delayed /init from 1.0 s to 14 s; dmesg and pstore keep every message) |
| Ramdisk | Alpine 3.24.2 aarch64: the minirootfs, the packages of PACKAGES in tooling/stock/image.py (BusyBox extras, dropbear, an SFTP server, e2fsprogs for the data partition and the check of super, zstd for the build host's archive, OpenSSL for fast SHA-256, curl and GNU tar for the headset's own build, exploration tools), overpressure's runtime (runtime.md) under the initramfs/ overlay (the PICO 4's values in etc/overpressure/headset and pico4-install; the probe, overpressure-info, the status page, the login profile and the QEMU self-test are the runtime's) and pico4-reboot |
| PID 1 | the runtime's overpressure-init, which runs /etc/inittab like busybox init (runtime.md) |
Over the USB-C cable:
| Function | What it offers |
|---|---|
| Network (CDC NCM) | the headset at 172.16.42.1/24; DHCP gives the PC 172.16.42.2, no router or DNS, so the PC keeps its internet route. SSH with SFTP, telnet, HTTP |
| Serial shell (CDC ACM) | only on kernels with ACM; the stock kernel has none |
Prerequisites¶
- An original PICO 4 with an unlocked bootloader and the engineering ABL (device-preparation.md). The tools refuse the Pro and Enterprise and the PICO OS builds outside their verified list (device-preparation.md).
adb,fastboot(overpressure tools) and an SSH client on the PC; Python 3.12+ on Windows, Linux or macOS. development.md lists what the other builds and the QEMU tests need.
Preflight on the unmodified headset¶
Optional, before any bootloader work; needs only USB debugging (the bootloader may still be locked):
It runs the image's own binaries (BusyBox, the DHCP, telnet and web servers, dropbear and host-key
generation, the other tools) on the stock kernel from adb shell, without root, through the image's
musl loader. It prints what the recovery relies on (USB device controller, LED names, DRM and backlight devices,
CPU governors and idle state, pstore, kernel options) and the fingerprint and OEM state for match. It uses
a directory under /data/local/tmp and removes it; results go to out/hardware-<id>/; a failure exits
nonzero. --serial selects a headset when several are attached.
Building¶
Pick the firmware entry that matches the headset (with PICO OS running):
adb shell getprop ro.build.fingerprint # e.g. Pico/Phoenix_ovs/PICOA8110:10/5.13.8/smartcm.1788408867:user/dev-keys
adb shell getprop ro.oem.state # true = "seko" build, empty = "sek" build
overpressure match --fingerprint "Pico/Phoenix_ovs/..." --oem-state false
tooling/stock/firmware.json lists PICO's official full OTAs: 5.13.3 (global), 5.13.7
(global and CN) and 5.13.8 (global), each as sek and seko; the same OTA serves PICO 4, Pro and Enterprise.
match returns the entry with the same fingerprint, else the one with the same version, region (_ovs =
global) and OEM state, with a note that the build number (_bNNNN_ in ro.pvr.internal.version) is not
confirmed. Kernel, trees and configuration are identical across the 5.13.7 and 5.13.8 builds compared, so a
close match works, but an exact match is safer: the stock boot image of the same build restores PICO OS. The
build does not download it: the stock boot image is the headset's own boot partition in its EDL backup.
| Option | Effect |
|---|---|
--firmware NAME |
the headset's build in firmware.json (default 5.13.7-global-seko): the image's name, checked against the verified list |
--backup DIR |
the EDL backup whose boot partition the image takes (default PICO4_BACKUP in .env), checked against its manifest |
--stock-boot PATH |
instead, for development: another boot.img, an OTA zip, or a URL of either |
--cmdline-append ARG... |
extra kernel arguments (options) |
--out DIR |
output directory (default out/) |
--force |
build even if the kernel checks fail (not RD_GZIP) |
The first build downloads about 12 MB of Alpine packages into cache/, and nothing of PICO's. The build:
- Takes the stock
boot.imgfrom the backup (overpressure/backup.py,verified_partition: the image's size and SHA-256 are the manifest's), or--stock-boot's (overpressure/ota.py, by HTTP range requests checked against the zip's CRC-32; A/B OTAs withpayload.binwork too, overpressure/payload.py). - Parses it (overpressure/bootimg.py, header v0–4) and analyses the
kernel (overpressure/kernelinfo.py). It stops if the kernel lacks
BLK_DEV_INITRD,RD_GZIP,USB_CONFIGFS,CONFIGFS_FSorUNIX98_PTYS, or has none of the NCM, RNDIS and ECM gadget functions. - Assembles the root file system in memory (overpressure/cpio.py), so nodes,
modes and ownership are right on Windows too: the minirootfs (checked against its SHA-256); the packages
with dependencies, each verified through Alpine's checksum chain
(overpressure/alpine.py) and each APKINDEX's RSA signature against
Alpine's aarch64 keys pinned in overpressure/apksign.py (a bad or
unknown signature stops the build and drops the index from the cache); modules from the stock ramdisk
(current firmware has none); the overlay;
pico4-reboot; static device nodes (console,null,zero,kmsg,tty,ptmx,random,urandom: the kernel opens/dev/consolebefore/init); a root account without password, host namepico4, the build record/etc/overpressure/build-info. - Writes a gzip newc cpio, extends the command line and repacks with every other stock header field, then
parses its own output and checks kernel, trees, header fields, the header ID and an executable
/init.
Output in out/ |
Use |
|---|---|
pico4-recovery-<firmware>.img |
the boot image |
pico4-recovery-<firmware>-initramfs.cpio.gz |
the bare ramdisk, for the QEMU tests |
pico4-recovery-<firmware>-rootfs.tar |
the root file system without device nodes, for the preflight |
pico4-recovery-<firmware>.json |
build record: SHA-256 and size, command line, package versions, stock analysis |
stock-boot-<name>.img |
with --stock-boot only: that untouched stock boot image (the backup holds the headset's own) |
overpressure inspect (the backup's, or --stock-boot) prints the analysis without building and
writes out/inspect/<firmware>/analysis.json and kernel.config. With SOURCE_DATE_EPOCH set the image is
byte-reproducible on Windows and Linux; without it only the build time in build-info differs. The build
warns when the image is larger than the stock partition.
Freestanding helpers¶
pico4-reboot (source, about 1.5 KB, no libc) passes a command string to the
kernel, which BusyBox's reboot cannot; the Qualcomm restart driver picks the next boot target (fastboot,
recovery) from it. The system image carries the same file. pico4-splash (source,
about 21 KB with Inter's outlines, no libm), the installed system's boot indication in the lenses, is in the system image only, so
preinit runs it before the data partition is mounted. From devices/phoenix/, with any aarch64 cross
compiler:
aarch64-linux-gnu-gcc -Os -static -nostdlib -ffreestanding -fno-stack-protector \
-fno-asynchronous-unwind-tables -Wl,--build-id=none -s \
-o prebuilt/aarch64/pico4-reboot src/reboot/pico4-reboot.c
aarch64-linux-gnu-gcc -Os -static -nostdlib -ffreestanding -fno-stack-protector \
-fno-asynchronous-unwind-tables -fno-builtin -Wall -Wextra -Werror \
-Wl,--build-id=none,-z,max-page-size=4096 -s \
-o prebuilt/aarch64/pico4-splash src/splash/pico4-splash.c
The build container's cross compiler lacks arm64 kernel headers: in a container run, first
apt-get install linux-libc-dev-arm64-cross. The splash picture is tested on the host
(test_pico4_splash.c in scripts/c-tests.sh), which writes it as a PPM when
given a name. Its text is Inter's outlines in src/splash/pico4-splash-font.h; a change of the characters it draws
writes that header again from the pinned font file (python src/splash/font.py InterVariable.ttf
src/splash/pico4-splash-font.h, the file from Inter's repository at the commit font.py names, checked by its
SHA-256).
Booting¶
The recovery boots from a partition: overpressure dev flash writes the dev image to recovery (the
overpressure's recovery); hwtest flash-run and cycle write a test image to boot and restore it
(hardware-testing.md). The engineering ABL rejects fastboot boot (unknown command
after the transfer, even with persistent normal and critical unlock), so overpressure's
RAM boot has no target on the PICO 4. pico4-reboot bootloader returns to
fastboot; overpressure dev restore returns to PICO OS.
Writing boot by hand¶
The tools check the backup and the image and restore the original. The manual sequence replaces the only boot
partition (no A/B slots), so PICO OS cannot start until the original is back; with the system installed, the
way back is dev restore. Keep the engineering ABL and a working EDL path
(device-preparation.md):
fastboot oem <token> unlock # engineering ABL: authorizes writes in this session
fastboot flash boot out/pico4-recovery-5.13.7-global-seko.img
fastboot reboot # every normal boot now starts the recovery
# back: into fastboot (pico4-reboot bootloader, or the 5-minute auto-reboot), then:
fastboot oem <token> unlock
fastboot flash boot out/stock-boot-5.13.7-global-seko.img
fastboot reboot
overpressure device token CHIP_ID prints the oem command for the SoC ID that device probe
records; it is a per-session authorization, not flashing unlock, and resets nothing. Flash back the stock
image that matches the headset's firmware, or the boot image of its EDL backup. Only boot is written.
Connecting¶
About 20–40 s after boot the headset answers on the USB link:
| How | Command |
|---|---|
| SSH (Windows has a client) | ssh root@172.16.42.1, empty password |
| Telnet | telnet 172.16.42.1 |
| Browser: status, logs, report, probe and reboot buttons | http://172.16.42.1/ |
| Copy files (SFTP) | scp root@172.16.42.1:/run/overpressure/report.tar.gz . |
| Serial shell, kernels with CDC ACM | the gadget's serial port (/dev/ttyACM0 on Linux); any login name, no password |
dropbear runs with -R (host keys generated at the first connection, new every boot), -B (empty root
password accepted) and -W 4194304: a 4 MiB receive window carries 26 to 28 MB/s, the link's limit, against
4.4 MB/s with the 24 KiB default. On this kernel BusyBox's SHA-256 does 42 MB/s, OpenSSL's 1.77 GB/s:
pico4-install hashes with OpenSSL, reads partitions with dd in 4 MiB blocks (about 190 MB/s with the hash;
head -c reads a block device in small pieces) and writes without a hash beside the stream (tee held it to
25 MB/s); the readback checks it. Runner and dev images also carry an authorized_keys entry for the run's or
the loop's key (hardware-testing.md).
The web server is BusyBox httpd on port 80, with overpressure's status page (/srv/www, runtime.md) in the PICO 4's words:
| Path | Content |
|---|---|
/ |
status, refreshed every 5 s; links; buttons to rerun the probe and to reboot into PICO OS, fastboot or recovery |
/cgi-bin/status |
overpressure-info as text |
/cgi-bin/log?boot, ?dmesg, ?services, ?pstore |
boot.log, kernel log, service logs (last 200 lines each), pstore of the previous boot |
/report/, /cgi-bin/report |
the hardware report, browsable and as report.tar.gz (collected first if missing) |
POST /cgi-bin/probe |
rerun overpressure-probe |
POST /cgi-bin/reboot, body target=android, bootloader or recovery |
reboot after 2 s |
The USB device is a composite gadget 1d6b:0104 (class EF/02/01 with interface association descriptors for
Windows), product PICO 4 Linux, serial androidboot.serialno (normally the fastboot serial; the ADB serial
can differ). The network function is the first of overpressure.usbnet the kernel has; its MAC addresses are locally
administered and derived from the serial, so the PC sees the same adapter every boot. If the controller rejects
the set of functions, the setup binds again without the serial function. The gadget carries no drive: a host
re-reads a drive whose medium changes, which on Linux keeps udev from setting up the network.
What happens during boot¶
The runtime's steps (runtime.md), on the PICO 4:
| Step | What happens | Status LED |
|---|---|---|
| 1 | pseudo file systems; /dev by mdev (the stock kernel has no devtmpfs), kept running for hotplug |
|
| 2 | every disk and partition read-only as it appears, /dev/block/by-name/* links |
blue |
| 3 | modules of the stock ramdisk's modules.load (none in current firmware) |
|
| 4 | USB gadget: NCM, ACM if the kernel has it; usb0 = 172.16.42.1/24, udhcpd gives the PC 172.16.42.2 |
amber once bound, green when a PC configures it |
| 5 | CPU power management as PICO OS's post-boot script: schedutil, deep idle states after 30 s, Qualcomm crash-dump mode off |
|
| 6 | overpressure-init becomes PID 1: udhcpd, telnetd, dropbear, httpd, the serial getty, the USB link watcher, the recovery deadline |
|
| 7 | overpressure-probe collects a hardware inventory 15 s after the USB setup |
Steps 4 to 7 run concurrently. The stock kernel boots with performance and deep idle disabled
(lpm_levels.sleep_disabled=1); without step 5 every core stays at its maximum clock. Firmware requests fall
back to userspace; /init fails them after 5 s instead of 60 s (Android's ueventd is absent). The USB setup
waits up to 60 s for a device controller. Only LEDs named red, green and blue are driven (never flash, torch,
IR or backlight); a failed USB setup blinks red. Valve's kernel has no /sys/class/leds.
Every step is logged to the kernel log (lines start with overpressure:), /run/overpressure/boot.log and
pstore's pmsg (survives a warm reboot); services log to /run/overpressure/svc-<name>.log.
Recovery behaviour¶
- Watchdog.
recovery-watch, independent of the USB setup, reboots into fastboot after 300 s (overpressure.autoreboot) unless a packet from the PC arrived on the USB network or a login shell started (SSH, telnet or serial: the profile creates/run/overpressure/no-autoreboot). Enumeration and carrier alone do not count. - Test images use the runner's deadlines instead: SSH authentication within the connection deadline and a maximum runtime, also when the image disables the watchdog (hardware-testing.md). On the headset, a test image with a configured but unusable link returns to fastboot this way and the runner restores PICO OS without a button press.
- USB re-plug. On a configured link with no packet from the PC for 20 s (
overpressure.usbkick), the link watcher unbinds and rebinds the gadget (at most twice per boot, never after the first packet), then re-applies the address and restartsudhcpd. A PC whose side is up sends packets at once (DHCP, IPv6 router solicitations). In QEMU the PC side sometimes misses NCM's "connected" notification; the re-plug fixes it. Toggling the controller'ssoft_connectinstead leaves the QEMU controller unable to enumerate. - Kernel panics. The stock kernel enables Qualcomm download mode (crash-dump mode, USB
05c6:900e, until the power button is held). The recovery setsmsm_poweroff'sdownload_modeto 0, so a panic reboots and the deadlines apply;overpressure.ramdump=1keeps crash-dump mode. - Limits. A kernel hard hang or loss of host power can need a hardware reset (power button held for more than 10 s) or EDL recovery.
Kernel command-line options¶
Add them at build time, e.g. overpressure build --cmdline-append overpressure.autoreboot=0
overpressure.cpugov=keep. The runtime's words (USB functions, deadlines, addresses, storage, power, the probe)
are in runtime.md. The PICO 4's the recovery has no ACM in the stock kernel and
NCM only. The PICO 4's own words:
| Option | Meaning |
|---|---|
overpressure.part=recovery |
the dev image, so the dev loop knows which partition started it |
overpressure.kernel=valve |
the dev image runs on Valve's kernel (above) |
overpressure.test_run=ID |
set by the acceptance runner |
For the test harnesses: overpressure.selftest=1 (the QEMU self-test;
overpressure.selftest_hostdelay=N keeps the PC side silent for N s, overpressure.selftest_poweroff=0 keeps the
VM on; the runner refuses such images).
Never add a bare earlycon (without a value): according to PICO's published kernel source
(bytedance/phoenix-kernel, 4.19.81, without the board DTS), its
earlycon parser dereferences the missing argument and the kernel panics before anything is logged.
Commands on the headset¶
| Command | Purpose |
|---|---|
overpressure-info |
status summary, also the login banner |
overpressure-probe |
hardware inventory into /run/overpressure/report/ and report.tar.gz |
overpressure-mount-ro PART [DIR] |
mount a stock partition read-only (default /mnt/PART): ext4 with noload (no journal replay), f2fs with norecovery, vfat; not the partitions inside super |
pico4-reboot [bootloader\|recovery\|edl\|poweroff] |
reboot into a mode (edl: EDL mode, kernel.md), without argument a normal reboot; -r STRING passes another reason; unknown words are refused; aliases fastboot-mode, android |
pico4-install write\|format-data\|keys\|stock\|stock-hash\|build\|build-file\|hash\|wipe\|bootmode\|status |
overpressure's recovery's installer (overpressure's overpressure-install under the PICO 4's name), the only writer of boot, super, userdata (its file system, the SSH keys, install ID, PICO OS's files and the headset's build on it), metadata and misc's bootloader message, each against the backup's size and read back where it writes raw (installed-system.md) |
drm_info, modetest, evtest, i2cdetect, gpioinfo, tinymix, lsusb, lspci, lsblk, dtc, dmsetup, strace, htop |
exploration tools |
overpressure-probe reads procfs, sysfs and device-tree data only. It skips debugfs GPIO and clock dumps, PCIe
configuration reads and audio mixer reads, which can hard-crash Qualcomm SoCs; run those by hand knowing the
risk. Its progress also goes to pstore, so a crash during the probe can be located. A PC terminal that echoes
text back cannot run commands on the serial console: the getty asks for a login name first, every line of the
banner starts with #, and pico4-reboot refuses unknown words.
Troubleshooting¶
What an owner meets during an install or a restore, in plain words: troubleshooting.
- "PICO 4 Linux" appears but no network adapter (Windows). Windows 11's in-box
UsbNcm.sysshould load for CDC NCM (Microsoft); if not: Device Manager, Update driver → Browse my computer → Let me pick → Network adapters → Microsoft → UsbNcm Host Device. Windows 10 has no NCM driver and the stock kernel no RNDIS: use Windows 11, Linux, or a Linux VM with USB passthrough. - An NCM adapter, but no DHCP or SSH, and
Wrong NDP SIGNin the kernel log. Only the stock kernel (the runner's the recovery) shows it: it needs one CDC request through UsbDk after every boot, which the runner sends (hardware-testing.md). Leave the adapter on DHCP. - Nothing appears on the PC. After 5 minutes the watchdog reboots into fastboot. The next recovery boot shows
the previous boot's logs from pstore (
/cgi-bin/log?pstore); under PICO OS they are in/sys/fs/pstore/console-ramoops*andpmsg-ramoops*(root only). Every recovery line starts withpico4. check-unlockedfails although the bootloader is unlocked. The stock ABL reportsDeviceUnlocked=true, which the tools refuse; stage the engineering ABL (device-preparation.md).- SSH warns about a changed host key. New host keys every boot:
ssh-keygen -R 172.16.42.1. - The headset is stuck. Hold the power button for more than 10 s (hardware reset). The next boot starts the
overpressure's recovery while
mischolds its request, else whatbootholds: the installed system, or PICO OS afterdev restore.
Safety notes¶
- No A/B slots:
fastboot flash bootreplaces the only boot partition, and PICO OS does not start until the original is back. Copies of the stock image:cache/stock/*.boot.img,out/stock-boot-<firmware>.imgand the boot image in the headset's EDL backup. - The recovery makes every disk and every partition read-only individually: the 4.19 kernel tracks a partition's
flag separately from its disk's. Newer kernels treat a partition as read-only while its disk is, so making a
partition writable there takes
blockdev --setrwon both. persist(sensor and camera calibration) andfsg(PICO VR data) are unique to each headset and cannot be downloaded again: irreplaceable in every stage.- overpressure's recovery's shell has no password: its only network is the USB cable to one PC, and nothing is forwarded (security.md).
The stock kernel as found¶
Read from the PICO OS 5.13.8 boot image and the kernel's IKCONFIG; 5.13.7 has the same kernel, trees and
configuration.
| Boot image | header v2, page 4096, 96 MiB partition, kernel 0x8000, ramdisk 0x1000000, DTB 0x1f00000 (base 0) |
| Kernel | 4.19.81-perf+, clang 8, uncompressed Image (35 MB), CMDLINE_EXTEND, PANIC_TIMEOUT=-1 |
| Ramdisk | gzip only (RD_GZIP); the stock one is Android 10's first-stage init with fstab.qcom and no modules, so no skip_initramfs patch is needed |
| DTB | 7 trees: kona v1/v2/v2.1, kona-iot v1/v2/v2.1, RTIC |
/dev |
no DEVTMPFS, hence mdev; UEVENT_HELPER=y; firmware loading falls back to userspace (FW_LOADER_USER_HELPER_FALLBACK) |
| USB gadget | configfs with NCM, mass storage, gser, FunctionFS, UAC1/2, UVC, HID, MIDI, MTP, Qualcomm GSI; no ACM, no generic RNDIS, no ECM |
| Logs | PSTORE_RAM, PSTORE_CONSOLE, PSTORE_PMSG |
| Graphics | DRM and KGSL (QCOM_KGSL); the display driver comes from techpack (not in IKCONFIG); video=vfb:640x400 on the command line (graphics.md) |
| Other | HID_QVR, LEDs QTI_TRI_LED and AW210XX, ANDROID_PARANOID_NETWORK, SELinux (no policy loaded, permissive), cpufreq default performance, 39-bit VA with 4K pages |
| Modules | MODULE_SIG_FORCE: only modules signed with PICO's per-build key load, so new drivers mean rebuilding the kernel |
| Storage | UFS; dynamic partitions (system, vendor, product, odm in super); f2fs userdata with file-based encryption; separate persist, fsg, modem, dsp, bluetooth, cache |
Verification¶
Offline¶
- Stock image.
inspectfetches only the OTA'sboot.imgmember and checks it against the zip's CRC-32 (5.13.8 global sek, b10113:87016fbf, 17 MB of the 3.72 GB zip). - Image format. Google's
unpack_bootimg.pyparses the output (header v2, addresses, OS version and patch level as stock);mkbootimg.pyreproduces it byte for byte from the parts, except the unusedsecond_addr, which keeps the stock0x00f00000where mkbootimg writes 0. Kernel and DTB are identical to stock; the header ID is computed as mkbootimg does, which also reproduces the stock image's. - Ramdisk. GNU cpio lists the expected nodes, symlinks and modes; the scripts pass
sh -nunder the image's BusyBox. - Recovery policy. overpressure's
tests/test_recovery_policy.shchecks the deadline's decisions (recovery-policy.sh) on the host.
QEMU self-test¶
overpressure's tests/qemu/ boots the exact ramdisk on a mainline arm64 kernel (6.18.56) configured like the
stock one where it matters (no devtmpfs, no modules, a configfs gadget, 4K pages, 39-bit VA). dummy_hcd
connects the gadget to a virtual host controller in the same kernel, so the VM is both headset and PC. A 32 MiB
GPT disk has a recovery_test partition for the read-only checks and a recovery_export partition for the report.
Optional; it covers the recovery only.
# once, in the build container: cache/qemu/Image
overpressure container run -- bash tests/qemu/build-test-kernel.sh
tests/qemu/run-selftest.sh # Linux, with qemu-system-aarch64: PASS or FAIL
Further arguments are kernel arguments: overpressure.usbserial=none gives the stock kernel's functions,
overpressure.selftest_hostdelay=35 forces the re-plug path. Console log: out/qemu-console.log; report:
out/qemu-report/. make qemu-recovery runs it for the Makefile's firmware. It checks: /dev by mdev, the gadget
bound and addressed; the PC side's enumeration, the controller state and a DHCP lease of 172.16.42.2; SSH,
telnet and HTTP, root login with the empty password, the status page and boot log; the by-name links, a
read-only partition and a refused write; a login shell on ACM; the hardware
report over HTTP; with 35 s of silence two re-plugs, after which DHCP and the serial shell work.
On the headset¶
The acceptance runner (hardware-testing.md) checks the recovery on a prepared headset. Results on the tested headset (original PICO 4, PICO OS 5.13.7, engineering ABL, Windows 11 host):
| Check | Result |
|---|---|
| Preflight under PICO OS | all checks pass |
| Kernel and userspace | stock 4.19.81-perf+, Alpine 3.24.2; build metadata matches the image |
| Shell | SSH with the per-run key; run identifier and SoC ID match; aarch64, UID 0 |
| Storage | all 99 physical block devices (disks and partitions) read-only; root in RAM; no device file system mounted writable |
| HTTP | status, boot log and hardware report of the same boot |
| Flashed image | boot reads back with the SHA-256 of the per-run image |
| Restoration | original boot image flashed; PICO OS boots with the original identity; full EDL readbacks of boot (96 MiB) and abl (1 MiB) match the backup |
| Watchdog | a test image with a configured but unusable link returns to fastboot; the runner restores PICO OS without a button press |
| Windows | the automatic NCM initialization makes DHCP, SSH and HTTP work; no button presses, administrator actions or manual network commands |