1
menu search more_vert

How to Build Lineage OS Based ROM

watch_later 2020/01/04


Here you will get easy to learn How to Build Lineage OS Based ROM for your device


What you will need To Start Build :-

1- Computer Running on Linux I Recommended ubuntu version 17.10
2- Minimum 6GB of RAM
3- Minimum 150GB of Disk Space
4- Minimum Core i3 Processor 
5- Minimum Internet Connection speed 8192 kbit/s
6- Stable Reliable Electricity



Initialize the required Tools and Packages...

1- Installing Android SDK platform tools

• Type in terminal this commands to Download and install SDK
$ wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip 
$ unzip platform-tools-latest-linux.zip -d ~
$ sudo gedit ~/.profile

• Add the following lines of code in the text editor at the end of the file and then Save and Exit the file 
# add Android SDK platform tools to path
if [ -d "$HOME/platform-tools" ] ; then
PATH="$HOME/platform-tools:$PATH"
fi
This Will Put the ~/platform-tools directory in your path of execution )


• Now run This command
$ source ~/.profile 
  


2- Installing required Packages


• Type in Terminal this Command to Download and install required Packages
$ sudo apt-get install bc bison build-essential curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline6-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev openjdk-8-jdk



3- Installing the repo Command

• Type in Terminal this Commands to Download and install repo
mkdir -p ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
sudo gedit ~/.profile

• Add the following lines of code in the text editor at the end of the file and then Save and Exit the file 
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
This Will Put the ~/bin directory in your path of execution )





Initialize the LineageOS source repository...

• Type in Terminal this Commands to Initialize LineageOS source
mkdir -p ~/Android/LineageOS
cd ~/Android/LineageOS
 run This commands to add your Github email address and user name.
$ git config --global user.email "user@email.com"
$ git config --global user.name "Your Name"
change "user@email.com" to your Github email address & change "Your Name" to your user name )

• if you need initialize LineageOS 14.1 repository run This commands
$ repo init -u https://github.com/LineageOS/android.git -b cm-14.1

• if you need initialize LineageOS 15.0 repository run This commands
$ repo init -u https://github.com/LineageOS/android.git -b lineage-15.0

• if you need initialize LineageOS 15.1 repository run This commands
$ repo init -u https://github.com/LineageOS/android.git -b lineage-15.1

• Add Vendor Blobs and Device Tree to source code run This commands to add your local_manifests.xml
sudo gedit .repo/local_manifests/local_manifests.xml

• Add the lines of code from (Here) in the text editor at the end of the file and then Save and Exit the file, This will just for Example Add Vendor Blobs and Device Tree for INFINIX HOT2  



 • Download the source code
repo sync
( Download the source code with Minimum required Internet Connection speed will take 12 hours! )


Statring Build LineageOS...

• After the source code downloaded run This command to Prepare the device specific code.
source build/envsetup.sh
breakfast x510
"breakfast x510" where x510 is the code name for the device INFINIX HOT2 and instead of x510 you have to enter the code name of your device. Example for nexus 6 you'll enter 'breakfast shamu' here shamu is the code name for nexus 6. If you don't know the code name for your device then you can check that Here and if you need to create one for your device check that Here )

• Run this command to Speed up Build process.
export USE_CCACHE=1
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
export LC_ALL=C

• Start the build.
croot
brunch x510
( Build process with Minimum required pc will take 3 hours! )

 you will your ROM in This Path
cd && ls ~/Android/LineageOS/out/target/product/x510/





sentiment_satisfied Emoticon

expand_less