Building from source
The image contains Google's OS, so it is built locally from Google's public recovery image and is not distributed. The source is on GitHub. You need a Mac or Linux machine with Docker, Python 3, QEMU for tests, and about 30 GB free.
For most people: git clone https://github.com/linuxkid473/gbos-x86 && cd gbos-x86 && ./build.sh does steps 1, 2, 8 and 9 below for you (it downloads the prebuilt kernel modules and firmware instead of building them). The full process:
- Google's OS. Download the Googlebook recovery image from Google's servers and extract the logical partitions (system, vendor, product, system_ext, system_dlkm, vendor_dlkm; slot A) from its
superpartition. - super.img. Rebuild a dynamic-partition image from them, under 4 GB so it fits on FAT32.
- Kernel source. AOSP common kernel, branch
android17-6.18, with Google's prebuilt clang, kept in a Docker volume. - Configuration. Start from the recovery kernel's config, apply the gbOS86 overrides (built-in storage, input and platform drivers; Intel graphics as a module; the generic Wi-Fi, Bluetooth, audio and platform driver set as modules), and set the command line.
- Patches. The CPU-instruction emulator, the ashmem shim, and the i915 colour changes (dummy colour pipeline, eDP full-range RGB, ignoring userspace gamma).
- Build. Compile the kernel and modules, install the modules into a staging tree, pack the stage0 initramfs (busybox, the init script and the early modules), and build again so it is embedded. The result is
BOOTX64.EFI. - Test. The emulator self-test in QEMU must print 16/16 passing; a hardware-detection test boots a virtual machine with network and audio devices and checks that the right modules load.
- Payload. Build the patched libraries, the software Gatekeeper, the installer tools; fetch and trim firmware from linux-firmware and sof-bin.
- Image. One script assembles a GPT image (EFI partition plus the FAT32 gbos volume) of about 6.7 GB, with a checksum.
Questions about building go in the Downloads & Builds forum or via contact.