| name | lineageos |
| description | Use when working with LineageOS custom ROM development, including syncing sources, building, device trees, repopick, Gerrit contributions, or LineageOS-specific features. Triggers on "LineageOS", "lineage-sdk", "breakfast", "brunch", "repopick", "vendor/lineage", "lineage.dependencies", "mka bacon". |
LineageOS Development
This skill covers LineageOS custom ROM development - from syncing sources to building and contributing.
Getting Started
Initialize Source
mkdir ~/lineage && cd ~/lineage
mkdir -p ~/.bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
chmod a+x ~/.bin/repo
export PATH="$HOME/.bin:$PATH"
repo init -u https://github.com/LineageOS/android.git -b lineage-21.0 --git-lfs
repo sync -c -j$(nproc) --force-sync --no-tags --no-clone-bundle
Build Commands
source build/envsetup.sh
breakfast <device>
brunch <device>
breakfast <device>
mka bacon
Essential Commands
| Command | Purpose |
|---|
breakfast <device> | Setup device + sync dependencies |
brunch <device> | breakfast + full build |
mka bacon | Build flashable ZIP |
mka bootimage | Build kernel only |
mka systemimage | Build system only |
repopick <change> | Cherry-pick from Gerrit |
Device Trees
Required Files
device/<vendor>/<device>/
āāā lineage_<device>.mk # Product makefile
āāā lineage.dependencies # Repo dependencies
āāā vendorsetup.sh # Add to lunch
āāā BoardConfig.mk # Hardware config
āāā device.mk # Packages and configs
āāā extract-files.sh # Vendor blob extraction
lineage_.mk
$(call inherit-product, device/vendor/device/device.mk)
$(call inherit-product, vendor/lineage/config/common_full_phone.mk)
PRODUCT_NAME := lineage_device
PRODUCT_DEVICE := device
PRODUCT_BRAND := Vendor
PRODUCT_MODEL := Device Name
PRODUCT_MANUFACTURER := Vendor
lineage.dependencies
[
{
"repository": "android_kernel_vendor_device",
"target_path": "kernel/vendor/device"
},
{
"repository": "android_device_vendor_device-common",
"target_path": "device/vendor/device-common"
},
{
"repository": "proprietary_vendor_device",
"target_path": "vendor/device"
}
]
repopick - Cherry-picking from Gerrit
repopick 12345
repopick 12345 12346 12347
repopick -t feature-topic
repopick -Q 12345
repopick -f 12345
repopick -n 12345
Find Change Numbers
- Go to
https://review.lineageos.org
- Search for changes
- Change number is in the URL or displayed
Vendor Blobs
Extract from Device
cd device/vendor/device
./extract-files.sh
Extract from OTA/Factory Image
./extract-files.sh ~/Downloads/ota.zip
proprietary-files.txt Format
# Audio HAL
vendor/lib64/hw/audio.primary.platform.so
vendor/etc/audio_policy_configuration.xml
# With destination path
vendor/lib64/lib.so:vendor/lib64/libfoo.so
# From another device
vendor/lib64/lib.so|other_device
LineageOS Features
Trust Interface
Security dashboard showing device integrity:
PRODUCT_PACKAGES += \
LineageTrust
LiveDisplay
Hardware-accelerated display tuning:
PRODUCT_PACKAGES += \
lineage.livedisplay@2.0-service-sdm
Styles / Themes
System theming support:
PRODUCT_PACKAGES += \
ThemePicker
Key Directories
| Path | Purpose |
|---|
vendor/lineage/ | LineageOS additions |
lineage-sdk/ | LineageOS SDK |
device/<vendor>/<device>/ | Device tree |
kernel/<vendor>/<device>/ | Kernel source |
vendor/<vendor>/ | Proprietary blobs |
Contributing
Setup Gerrit Access
git config --global review.review.lineageos.org.username <username>
Submit Change
repo start my-feature .
git add -A
git commit -m "subsystem: Short description
Detailed explanation.
Change-Id: <auto-generated>"
git push ssh://<username>@review.lineageos.org:29418/<project> HEAD:refs/for/<branch>
Commit Message Format
subsystem: Short description
Longer explanation wrapped at 72 characters.
Explain why, not what.
Change-Id: I1234567890abcdef...
Common Issues
Breakfast Fails - Missing Repos
repo sync device/vendor/device kernel/vendor/device vendor/device
Build Fails - SELinux
adb shell dmesg | grep "avc: denied"
adb shell dmesg | audit2allow -p out/target/product/<device>/root/sepolicy
Missing Blobs
Check logcat for:
E linker: cannot find symbol...
E ServiceManager: Could not find service...
Add missing files to proprietary-files.txt and re-extract.
Quick Reference
source build/envsetup.sh
breakfast cheeseburger
brunch cheeseburger
mka bootimage
repopick 12345
repo sync -c -j$(nproc)
repo sync packages/apps/Settings
m clean && brunch <device>