How lineageos/android works
Project type and purpose
• This repository is not an application per se but the “manifest” repository for LineageOS.
• It defines which Git repositories (AOSP, device trees, vendor blobs, community projects) are pulled by the Android “repo” tool to assemble a full LineageOS build.
• Snippet XML files (e.g. snippets/lineage.xml, snippets/pixel.xml) provide device- or feature-specific overlays that can be merged into the main manifest.
File structure
• Top-level files:
• README.mkdn – high-level instructions on initializing and syncing the repo
• default.xml – the primary manifest listing all upstream Git projects
• snippets/ – supplemental manifest fragments:
• lineage.xml – common customizations for all LineageOS builds
• pixel.xml – device-specific manifest entries for Google Pixel phones
• No src/ or code directories here: this is purely a configuration and orchestration repo.
Insights from the README
• Shows that developers use the Android “repo” tool to:
repo init -u https://github.com/LineageOS/android.git -b lineage-22.2 --git-lfs
repo sync
• Mentions Gerrit for patch management and Buildkite/Buildbot for automated builds.
Main components
a. Manifest Repository
• default.xml and snippet files define what code is pulled, and how it is organized.
b. Repo Tool
• Client-side orchestration that reads the manifest and clones/syncs all referenced Git repos.
c. Git Servers / Upstream Repos
• AOSP core, LineageOS platform forks, device trees, vendor blobs, community contributions.
d. Local Workspace
• A directory structure populated by repo sync, containing dozens of project submodules.
e. Build System
• Buildbot/Buildkite pipelines that monitor the manifest branch, trigger builds on commit.
f. Artifact Storage / Download Server
• Where finished LineageOS builds (OTA zips, recovery images) are uploaded.
g. Gerrit Code Review
• External service for patch submission and review before merging into the manifest or individual sub-repos.
Relationships and interactions
• Developer runs repo init & repo sync → Repo Tool pulls from Git Servers based on Manifest
• Developer submits patches → patches go to Gerrit → after approval they land in individual repos or the manifest
• Buildbot watches manifest branch → on change it triggers a full sync + build pipeline
• Build pipeline produces artifacts → uploads to download server
• Users download artifacts from the server
Architectural patterns and principles
• “Single source of truth”: the manifest defines all components and their exact revisions.
• Separation of concerns: manifests for common vs. device-specific configurations (snippets).
• Extensibility: new devices or features can be added by dropping new XML snippet files and including them via the default.xml or by conditional includes.
• Decoupling of code hosting and build orchestration: the repo tool is a thin client, the build servers operate independently.
Detail level
• Every manifest-related step: default.xml includes snippet files, conditional includes if any.
• That snippets folder is referenced by the primary manifest.
• That repo sync may involve Git LFS if enabled.