Build DiamaneOS
Build from recorded source and check the resulting files.
Before starting
Use Linux on x86-64 with a case-sensitive filesystem. Debian 13 is the reference host. Allow about 500 GB of free SSD space, at least 32 GB of memory, and a fast connection. More memory and CPU cores reduce build time.
Install the dependencies and initialise the source using the build quickstart. Dependency versions and the repo launcher pin live in the build environment, rather than being duplicated here.
Source and vendor inputs
The DiamaneOS manifest selects GrapheneOS, Android and device projects. Build tools are checked out with the source at tools/diamaneos. Run them from that source tree so the tools and manifest agree.
Vendor files are extracted from the factory package selected by the source configuration. Its hash is checked before extraction. Follow the Fairphone build instructions; GrapheneOS’s Pixel vendor-extraction steps are for different devices.
Build a user image
From the source directory created by the quickstart:
tools/diamaneos/bin/diamaneos build all --variant user --no-official
This synchronises source, prepares vendor inputs, compiles, packages and verifies the images. Compilation runs without network access in an unprivileged namespace. Source downloads happen separately. If that isolation is unavailable, fix the host rather than silently weakening it.
The user variant disables root debugging. It does not replace Android’s public test signing keys with private release keys. Keep the bootloader unlocked when using this source-built image, and do not distribute it as a production release.
--no-official keeps this build outside the project’s official update configuration. A build flag cannot establish release authenticity. The signing reference describes the separate signature and publication checks.
Keep the build record
The output records source revisions, the resolved manifest, vendor input hashes, tools and artifact hashes. Keep build.json, resolved-manifest.xml, checksums, target-files, otatools and the verification report together. They describe the exact build rather than whichever branches exist later.
To check an image set again, use:
tools/diamaneos/bin/diamaneos build verify
For source reproduction, use the recorded manifest and build record with the resolved-source workflow. Matching source provenance and passing checks do not by themselves prove bit-for-bit reproducibility or device behavior.
Installation and troubleshooting
Use the build reference for source-image flashing, firmware matching and recovery. Unlocking or wiping erases data. Do not improvise a relock command for a source build.
The same reference explains stopped builds and verification failures. Preserve the failure output and correct its cause. Do not edit recorded hashes, remove checks or mix artifacts from different builds to make verification pass.