[Droid Ultra Android Development] pbarrette:
[IMG="LineageOS"]https://cve.lineageos.org/static/img/logo-teal.png[/IMG]

How to Compile LineageOS 13

This tutorial is designed to guide you through the process of creating your own LineageOS 13 ROM for the Motorola Droid Ultra, Mini and Maxx.
​

There are four distinct phases of the build process:

1 - Installing the required software.

2 - Preparing the build environment.

3 - Build the ROM.

4 - Keeping current with updates and re-building the ROM.

This tutorial assumes that you will be starting with a fresh installation of Ubuntu 14.04.

Later versions of Ubuntu require a slightly different set of packages to be installed and getting the correct Java version set up is much more difficult.

Other versions of Linux may work, but this guide is written specifically with Ubuntu 14.04 in mind.

I, personally, create a virtual machine with Windows Hyper-V to do this, but you can do it however you like.

There are a multitude of tutorials for the installation of Ubuntu and that is outside the scope of this tutorial.

You should have at least 100GB of disk space and at least 4GB of RAM allocated for your Ubuntu build system.

The more CPU power and RAM you have available, the faster the build process will be.

1 - Installing the required software:

Open a terminal and enter the following commands to install the software required to build LineageOS.

sudo apt-get install bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev maven openjdk-7-jdk

mkdir -p ~/bin
mkdir -p ~/android/lineage

curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

chmod a+x ~/bin/repo

source ~/.profile

cd ~/android/lineage

2 - Preparing the build environment:

Modify this with your own email address and username:

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

repo init -u https://github.com/LineageOS/android.git -b cm-13.0

cd .repo

git clone https://github.com/pbarrette/local_manifests

cd local_manifests

git checkout

cd ../..

This next command downloads all of the LineageOS specific code for the first time.

Expect it to take at least an hour or more.

repo sync

If the above command shows a failure at the end, run it again until it completes successfully.

OPTIONAL - These commands will help speed up recompiles.

You don't need to do this, and it won't help for your first compile, but it will make later ROM compilations faster.

This sets aside a compiler cache of 30GB, so be sure you have the disk space.

You can increase or decrease the number as required, but 30GB is a reasonable value.

ccache -M 30G

echo USE_CCACHE=1 >>~/.profile

source ~/.profile

3 - Build the ROM.

source build/envsetup.sh

OPTIONAL - This command will cause the ROM to be compiled with root functionality built-in.

export WITH_SU=true

This next command actually builds the ROM and will take at least a couple of hours.

brunch obake

You'll see a number of warnings as it compiles, which is expected and normal.

Once the ROM has finished building, you will find the flashable zip file in:

~/android/lineage/out/target/product/obake/

You're done!

Take your lineage-13.0-YYYYMMDD-UNOFFICIAL-obake.zip file and flash it to your phone.