Skip to content

WebUSB Browser Installer

The browser installer at headless-phone.funnyhat.club flashes official GitHub Releases or local build archives straight over WebUSB — no fastboot, zstd, debugfs, or simg2img installation required.

Browser Mode Capabilities
Chrome, Edge, Brave (desktop, HTTPS or localhost) Full WebUSB Flasher Connects directly to fastboot over USB, streams & verifies release images, injects cloud-init seed in WASM, and flashes the phone.
Firefox, Safari, or mobile browsers Config & CLI Companion Configure Wi-Fi, SSH keys, static IP, charge limits, and Frigate options in the UI, then download node.yaml / NoCloud seed files and copy exact tools/flash.py commands.
  1. Boot the phone into fastboot mode

    Power off or reboot the phone while holding Volume Down until the bootloader screen appears. Connect the phone to your computer with a USB-C data cable.

  2. Open headless-phone.funnyhat.club and select your device & image source

    Pick your device (e.g., Pixel 6 Pro raven). Device profiles in web/ are auto-synced from devices/*/device.env so partition sizes, HAS_INIT_BOOT, BOOTCTRL_BACKEND, and BOOTCTRL_ALLOW_BOOTLOADERS always match the repository.

    Choose either:

    • GitHub Release (streamed through the same-origin Cloudflare Pages Functions proxy /api/releases/*), or
    • Local archives (headless-phone-boot-<device>.tar.zst and userdata-<device>.simg.zst / .simg / .ext4 from a local build).
  3. Configure first-boot settings (optional)

    Leave customization off for a zero-config wired DHCP install (pixel / headless), or enable Customize first-boot settings for Raspberry Pi Imager-style provisioning:

    • Identity & SSH: Custom hostname, timezone (auto-detected from browser), admin username (cannot be root; locks pixel if changed), password, SSH public keys (RFC 4253 wire-blob validated in the browser), and opt-in Disable SSH password authentication.
    • Networking: Wi-Fi (WPA2, WPA3, or Open) with optional ISO-3166-1 alpha-2 regulatory country code, plus optional static IPv4 (wired on en*/eth* or wifi) with gateway and DNS.
    • Battery Charge Limit Preset:
      • server-safe: 55%–70% (default)
      • balanced: 60%–80%
      • extended: 75%–90%
      • custom: any integer pair with 20 <= start < stop <= 100
    • Optional Frigate NVR Bootstrap: Pre-configure internal camera selection (wide, ultrawide, telephoto, rear, front — up to 2 concurrent streams) or external-RTSP-only mode, resolution, FPS, bitrate, and Edge TPU power state (0..7). Installs a non-blocking headless-frigate-bootstrap.timer (OnBootSec=10s; becoming frigate-bootstrap.timer once the descriptive CLI rename deploys) pinned to a release tag/SHA and verified archive SHA-256.
  4. Connect & run preflight checks

    Click Connect device and select your Pixel in the browser USB picker. The installer queries bootloader variables without mutating anything:

    • Verifies product matches the selected device, unlocked == yes, is-userspace != yes (bootloader fastboot, not fastbootd), and slot-count == 2.
    • Defaults to installing on the currently active slot whose version-bootloader was just verified in fastboot (so installs don’t jump onto an unverified inactive slot); you can still manually pick the other slot if desired, in which case the installer warns that the inactive slot’s bootloader couldn’t be verified.
    • Checks active version-bootloader against BOOTCTRL_ALLOW_BOOTLOADERS and warns if the bootloader is untested or the device profile is experimental (BOOTCTRL_BACKEND="none").
    • Predicts your fallback mDNS hostname locally (<codename>-<last-6-of-serial>.local) — the serial never leaves your browser.
  5. Flash and reboot

    Review the partition plan and click Install. The installer:

    • Streams and verifies SHA-256 against release SHA256SUMS.txt and inner boot-bundle checksums before writing a single byte to the phone.
    • Decompresses Zstandard in WASM (zstd-stream.wasm) into a per-session OPFS sparse store (~40–60 MiB peak RAM).
    • Injects /var/lib/cloud/seed/nocloud/{meta-data,user-data,network-config} using upstream e2fsprogs libext2fs compiled to WebAssembly (ext4-seed.wasm), setting 0700/0600 root:root permissions and verifying byte-for-byte read-back (full install only).
    • Flashes a browser-generated 4 KiB empty AVB0 vbmeta (flags = 0x03, zero proprietary blobs) to vbmeta_<slot> by default (or patches a user-supplied stock vbmeta.img, or skips if overridden under Image options).
    • Flashes boot partitions (plus userdata on a full install), activates the target slot only after every write returns OKAY, verifies current-slot, and reboots into Debian.

The WebUSB client enforces a strict partition and command allowlist in web/src/fastboot/guardrails.ts:

  • Allowlisted flash targets only: vbmeta_{a,b}, boot_{a,b}, init_boot_{a,b}, vendor_boot_{a,b}, dtbo_{a,b}, and userdata.
  • Hard-refused critical partitions: super, metadata, misc, devinfo, bootloader*, radio*, modem*, persist, efs*, pvmfw*, abl*, bl1/2/31, gsa, tzsw, unslotted vbmeta, vbmeta_system*, and vbmeta_vendor*.
  • Hard-refused commands: erase, format, oem, flashing, and boot. Only getvar, download, flash, set_active, reboot, and reboot-bootloader are permitted.
  • Fail-closed transport handling: Any mid-transfer USB timeout or error places the session in a terminal uncertain state and closes the USB handle, requiring a reconnect and fresh preflight before retrying.

If you want to run or develop the WebUSB installer on localhost (which Chromium treats as a secure context for WebUSB):

Terminal window
cd web
pnpm install
pnpm run dev # Vite dev server at http://localhost:5173
pnpm run dev:pages # Full Cloudflare Pages + /api/releases Functions via wrangler at http://localhost:8788

To rebuild the deterministic ext4-seed.wasm (e2fsprogs 1.47.2) and zstd-stream.wasm (zstd 1.5.7) modules from pinned upstream sources on Linux/WSL:

Terminal window
bash web/wasm/build-wasm.sh

See web/README.md for Cloudflare Pages deployment and Playwright/Vitest verification commands.