Use devenv to manage all the requirements of the Android build.
# set ccache size
ccache -M 100G
# enable cache compression
ccache -o compression= trueInitizlize the LineageOS source repo
test -d android/lineage || mkdir -p android/lineage
repo init -u https://github.com/LineageOS/android.git -b lineage-22.2 --git-lfs --no-clone-bundle
repo syncPrepare the device-specific code
cd android/lineage
source build/envsetup.sh
breakfast "<device-code>"Extract proprietary blobs
test -d android/system_dump || mkdir -p android/system_dump
cd android/system_dumpWe need to extract from prebuild LineageOS zip file
Download from device page, they are payload-base OTAs
Then get dump tools
# Download from `https://github.com/ssut/payload-dumper-go`
# or
git clone https://github.com/LineageOS/android_prebuilts_extract-tools android/prebuilts/extract-tools
git clone https://github.com/LineageOS/android_tools_extract-utils android/tools/extract-utils
git clone https://github.com/LineageOS/android_system_update_engine android/system/update_engineExtract zip file
unzip lineage-*.zipExtract payload.bin
./android/prebuilts/extract-tools/linux-x86/bin/ota_extractor --payload path/to/payload.binMount
mkdir system/
sudo mount -o ro system.img system/
sudo mount -o ro vendor.img system/vendor/
sudo mount -o ro odm.img system/odm/
sudo mount -o ro product.img system/product/
sudo mount -o ro system_ext.img system/system_ext/Move to the root directory of the sources of your device and run extract-files.sh or extract-files.py as follows:
./extract-files.sh ~/android/system_dump/
# Or, for the Python script:
./extract-files.py ~/android/system_dump/This will tell extract-files script to extract the proprietary blobs from the mounted system dump rather than a connected device.
Once it is done, unmount the system dump and remove the now unnecessary files:
sudo umount -R android/system_dump/system/
rm -rf android/system_dump/Start build
croot
brunch felixInstall the build
Assuming the build completed without errors (it will be obvious when it finishes), type the following in the terminal window the build ran in:
cd $OUTThere you’ll find all the files that were created. The two files of more interest are:
vendor_boot.img, which is the LineageOS recovery image.lineage-22.2-20250604-UNOFFICIAL-felix.zip, which is the LineageOS installer package.