All guides

Compiling PixelOS GSI

Prerequisites

Before building PixelOS GSI, make sure you are familiar with Git and Repo, How to build a GSI, and standard AOSP compilation workflows.

1. Create Build Directory

First, create a working directory for PixelOS and enter it:

mkdir PixelOS
cd PixelOS

2. Initialize Local Repository

Initialize the manifest for Android 14:

repo init -u https://github.com/PixelOS-AOSP/manifest.git -b fourteen --git-lfs

3. Clone Treble Local Manifest

Clone the GSI local manifest to fetch necessary Treble dependencies:

git clone https://github.com/MisterZtr/treble_manifest.git .repo/local_manifests -b 14

4. Sync Source Code

Synchronize the source tree:

repo sync --force-sync --optimized-fetch --no-tags --no-clone-bundle --prune -j$(nproc --all)

5. Apply Treble Patches

Copy the patches directory into your ROM root, then run the patch script:

bash patches/apply-patches.sh .

6. Generate Build Makefile

Clone the Treble build repo and copy pixel.mk into device/phh/treble inside your source tree. Then run:

cd device/phh/treble
bash generate.sh pixel

7. Configure ccache (Optional)

To speed up subsequent builds, add the following exports to your ~/.bashrc or ~/.zshrc:

export USE_CCACHE=1
export CCACHE_COMPRESS=1
export CCACHE_MAXSIZE=50G

8. Compilation

Return to the ROM source root and execute the build commands:

. build/envsetup.sh
ccache -M 50G -F 0
lunch treble_arm64_bN-ap1a-userdebug
make systemimage -j$(nproc --all)

9. Compression

After compilation finishes, you can compress the output system.img using 7-zip:

cd out/target/product/tdgsi_arm64_ab
7zz a system.img.xz "system.img"

10. Create VNDK Lite Variant

Copy the output system.img into the treble_adapter folder located at the source root, then run:

sudo bash lite-adapter.sh 64 system.img

Troubleshooting

If you encounter issues during automated patch application, apply the individual patch files manually.

Credits & Acknowledgments