building lineage os

You need atleast 32G of RAM or don't even bother trying to build LineageOS.

Note

  • Enable multilib repo in /etc/pacman.conf.
  • run...
    git config --global user.email "you@example.com"
    git config --global user.name "Your Name"
    git lfs install
    git config --global trailer.changeid.key "Change-Id"
    # below should be also be in .zshrc
    export USE_CCACHE=1
    export CCACHE_EXEC=/usr/bin/ccache
    ccache -M 50G
    ccache -o compression=true
    

source: https://wiki.lineageos.org/devices/devon/build/

paru -S lineageos-devel
mkdir -p ~/android/lineage
cd ~/android/lineage
repo init -u https://github.com/LineageOS/android.git -b lineage-22.2 --git-lfs --no-clone-bundle
repo sync

repo sync will take a while..

source build/envsetup.sh
breakfast devon

Note

Note the output of breakfast devon. It ends in an error. The highlights I've added are indicating files being fetched and created:

03:14:39 Build sandboxing disabled due to nsjail error.
In file included from build/make/core/config.mk:406:
In file included from build/make/core/envsetup.mk:351:
build/make/core/product_config.mk:226: error: Cannot locate config makefile for product "lineage_devon".
03:14:39 dumpvars failed with: exit status 1
Device devon not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS).
Found repository: android_device_motorola_devon
Default revision: lineage-22.2
Checking branch info
Checking if device/motorola/devon is fetched from android_device_motorola_devon
Adding dependency: LineageOS/android_device_motorola_devon -> device/motorola/devon
Syncing repository to retrieve project.
Fetching: 100% (1/1), done in 1.363s
Checking out: 100% (1/1), done in 0.019s
repo sync has finished successfully.
Repository synced!
Looking for dependencies in device/motorola/devon
Default revision: lineage-22.2
Checking branch info
Adding dependencies to manifest
Checking if device/motorola/sm6225-common is fetched from android_device_motorola_sm6225-common
Adding dependency: LineageOS/android_device_motorola_sm6225-common -> device/motorola/sm6225-common
Syncing dependencies
Fetching: 100% (2/2), done in 2.218s
Checking out:  50% (1/2), done in 0.036s
Checking out:  50% (1/2), done in 0.000s
repo sync has finished successfully.
Looking for dependencies in device/motorola/sm6225-common
Default revision: lineage-22.2
Checking branch info
Default revision: lineage-22.2
Checking branch info
Adding dependencies to manifest
Checking if hardware/motorola is fetched from android_hardware_motorola
Adding dependency: LineageOS/android_hardware_motorola -> hardware/motorola
Checking if kernel/motorola/sm6225 is fetched from android_kernel_motorola_sm6225
Adding dependency: LineageOS/android_kernel_motorola_sm6225 -> kernel/motorola/sm6225
Syncing dependencies
Fetching: 100% (4/4), done in 3m4.599s
Updating files: 100% (74707/74707), done.
Checking out:  50% (2/4), done in 7.851s
Checking out:  50% (2/4), done in 0.017s
repo sync has finished successfully.
Looking for dependencies in hardware/motorola
hardware/motorola has no additional dependencies.
Looking for dependencies in kernel/motorola/sm6225
kernel/motorola/sm6225 has no additional dependencies.
Done
03:18:04 Build sandboxing disabled due to nsjail error.
In file included from build/make/core/config.mk:406:
In file included from build/make/core/envsetup.mk:351:
In file included from build/make/target/product/telephony_vendor.mk:21:
device/motorola/devon/device.mk:72: error:  vendor/motorola/devon/devon-vendor.mk does not exist..
03:18:05 dumpvars failed with: exit status 1
03:18:06 Build sandboxing disabled due to nsjail error.
In file included from build/make/core/config.mk:406:
In file included from build/make/core/envsetup.mk:351:
In file included from build/make/target/product/telephony_vendor.mk:21:
device/motorola/devon/device.mk:72: error:  vendor/motorola/devon/devon-vendor.mk does not exist..
03:18:06 dumpvars failed with: exit status 1

** Don't have a product spec for: 'lineage_devon'
** Do you have the right repo manifest?

Note

I use adb binary from android-tools arch package. I also booted devon (moto g32) with a fresh lineageos os install without gapps, and enabled adb-run-as-root in Settings after the usual stuff (developer mode after tapping build number 7 times). I think this information is crucial because in a previous attempt, I used adb that came with flutter but I'm not certain I had enabled rooted debugging. The same error is reported here: https://gitlab.com/LineageOS/issues/android/-/issues/8240.

sudo pacman -S python-google-api-python-client
cd ~/android/lineage/device/motorola/devon

With adb connection to devon...

./extract-files.py

Note

Now you have ~/android/lineage/vendor/motorala

$ breakfast devon
06:18:35 Build sandboxing disabled due to nsjail error.
Looking for dependencies in device/motorola/devon
Looking for dependencies in device/motorola/sm6225-common
Looking for dependencies in hardware/motorola
hardware/motorola has no additional dependencies.
Looking for dependencies in kernel/motorola/sm6225
kernel/motorola/sm6225 has no additional dependencies.
06:18:38 Build sandboxing disabled due to nsjail error.

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=15
LINEAGE_VERSION=22.2-20250529-UNOFFICIAL-devon
TARGET_PRODUCT=lineage_devon
TARGET_BUILD_VARIANT=userdebug
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a9
HOST_OS=linux
HOST_OS_EXTRA=Linux-6.14.7-zen2-1-zen-x86_64-Arch-Linux
HOST_CROSS_OS=windows
BUILD_ID=BP1A.250505.005
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/motorola/sm6225-common hardware/motorola hardware/samsung vendor/qcom/opensource/usb/etc vendor/motorola/sm6225-common device/motorola/devon vendor/motorola/devon hardware/qcom-caf/sm8250 hardware/qcom-caf/bootctrl vendor/qcom/opensource/commonsys/display vendor/qcom/opensource/commonsys-intf/display vendor/qcom/opensource/display vendor/qcom/opensource/data-ipa-cfg-mgr-legacy-um vendor/qcom/opensource/dataservices hardware/qcom-caf/wlan
============================================
croot
brunch devon

Note

  • brunch devon = breakfast devon + mka bacon
  • mka bacon -j8

Comments