Skip to main content

Compile Custom Rom From Source


Compiling custom rom from source code.

Compiling custom rom takes a hell lot of time!!!! so be aware of That!
First things first you have to setup system to start compiling.
you have to be on Ubuntu Os. You can use virtual box or dual boot with windows(the best option)
System requirements for fastest compilation are as below:

Important minimum 8GB of RAM ( you're compiling rom based on Marshmallow or Nougat)
100GB of free Space on HDD (it is good to have a SSD).
Quad Core processor.
A good internet connection with unlimited data
yeah that's it!
my suggestion is that you have to install Ubuntu alongside you system means dual boot! (why ? ask yourself!).
now, I am assuming that you have installed and boot up in Ubuntu.
So let's Get Started!


Step 1 :- install JAVA (open jdk 8) in Ubuntu.

open up the terminal and type the following command and hit enter.
$ sudo apt-get install openjdk-8-jdk

Step 2 :- Install other packages required for compiling custom rom

type (or copy) following commands in terminal.

$ sudo apt-get update && sudo apt-get install git-core gnupg
flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev
squashfs-tools build-essential zip curl libncurses5-dev
zlib1g-dev openjdk-8-jre openjdk-8-jdk pngcrush schedtool
libxml2 libxml2-utils xsltproc lzop libc6-dev schedtool
g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev
gcc-multilib maven tmux screen w3m ncftp

Now you have to setup Repo binary.

so, now copy and paste following commands one by one in terminal.

$ mkdir ~/bin

$ PATH=~/BIN:$PATH
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo3

That's it you have just setup repo binary.
now its time to download the source code. first you have to decide which rom you want to build. Like nuclear Rom, Resurrection remix, lineage OS, color Os,AOSP,AOKP etc.
You can choose whatever you want. I will be choosing Resurrection
Remix. (why? It can have the coolest modification than other!!!)
setup build environment.
Step 3:- Make the working Directory.and went to that directory.open up the terminal and type following command.
$ mkdir ~/RR
$ cd ~/RR
Step 4:- initialize repo for resurrection remix in that folder. Type following command.
$ repo init -u https://github.com/ResurrectionRemix/platform_manifest.git -b nougat

in the last of the above code -b determines which branch you want to initialize in our case.we are making nougat so -b nougat if you want marshmallow then -b marshmallow.

if you want build another rom then use following commands
Ex. Lineage Os:-
repo init -u git://github.com/LineageOS/android.git -b cm-14.1

Step 5 :- now its time to download the source code.Type following command.
$ repo sync -f --force-sync --no-clone-bundle

You really need high speed INTERNET in order to download
if you are on a slow Internet you will end up with this error "server hang up unexpectedly" .
this is huge data between 20GB to 30GB!!
while downloading you will see empty directory. don't worry you will see folders once repo sync completes( download completes).after sync completes it will look like this.

Once you have completed the syncing process, you're ready to build (compile) rom.
Step 6 :- go to you working directory.
$ cd ~/RR
Step 7 :- Setup build environment.
$ . build/envsetup.sh

(note:- there is one word space between the dot (.) and build/envsetup.sh)
you will be asked some questions, give their answer and proceed for next step.


Step 8:- now you have to download the device tree and kernel of your device.if your device has snapdragon processor then no worry. you can find device tree for your device very easily. but if you are on Mediatek Processor then your bad, you will hardly find device tree for your device.
I am assuming that you have a device with snapdragon processor. first you have to find your devices code name( you can google) in my case i have Lenovo Zuk Z1 which code name is "ham".
all you have to do is got to the lineage os github and search for ham (means search your device).


now click the link which stars like "android_device _" in my case it is "android_device_zuk_ham"
and select branch in my case this is nougat so am selecting cm 14.1, and then click on cone or download then click on download zip.

You need to make folder named "zuk" in “/RR/device/” directory and have to make folder named "ham" in “RR/device/zuk/” and extract that zip in “RR/device/zuk/ham/” location.
which looks like as below.



Step 9:-now open the file named "lineage.dependencies" and look which dependencies require.


As you can see in the above image I have to download common file and the kernel file for msm8974.

to find that go to lineage os github and search for common and kernel


and download the zip and place the files in location as shown in lineage.dependencies file.
Common Folder:


Msm8974 file

Which looks like above.
Step 10:-now you have to get the vendor blob for your device.to get that go to "The muppets Github" and search you devices vendor name in my case it is zuk. if you have a Motorola device then search for motorola.


now extract files in RR/vendor/zuk
which will look like this'

If you build for different device then the vendor folder looks like following.

if you are building for Motorola then you will have to make a folder named motorola in vendor folder.I think you got my point.
if you want to edit build.prop then simply go to your device tree and edit in system.prop
after getting the vendor files you're all set to start building

Step 11:- now type in terminal (you have to be in working directory)
$ brunch ham

(brunch <your Devices code name>)
if you see following the you're going good.



as you can see in above image the compilation process is started it will took about 5-6 hours to complete depends on your system after completing you will get flashable zip in RR/out/ folder. flash that zip using twrp recovery. thats it!! you have compiled rom for your device.you will face lots of errors while compiling like "out of memory" ,"file is missing" and tons of errors but no worry just search for that error on Google you will get the answers!






Comments

  1. Sir help me compile AEX fot lenovo a6000.
    I am still confused.
    Please guide step by step picture..
    Thanks sir

    ReplyDelete
  2. the dark theme looks cool, but the font is not too bright, which is straining our eyes.

    ReplyDelete
  3. The posttranslational modification of eukaryotic proteins by the addition of isoprenyl lipids at their C-termimi was first observed in the 1970s and 1980s. Since then, Peptide C-Terminal Modification

    ReplyDelete

Post a Comment

Popular posts from this blog

Fix for installing GRUB on EFI System of KALI or Parrot os.

This fix will work on any linux Distro like KALI(debian) , Parrot OS(debian) ,Ubuntu etc. Having Problem while installing grub?  if your answer is yes then you are on right place. In this post i will guide through steps for fixing the GRUB error on EFI system with Windows on Dual boot. In this post i have not written about Installation steps. If you Don't Know about how to "dual boot with windows 10/8.1/8" then i request you to google about "How to dual boot?" why i am not doing so is because you will find very easy guide on Internet for Dual booting With Windows. The only Problem you will face when the installation is just going to finish, Boom!!! Error comes "Fail to create  Dummy GRUB" or ""Error While installing GRUB" or something Like that. I haven't faced any problem while installing "Kali rolling" on my system. When i start installing Kali on my friend's laptop at first the installation completes with suc

IMEI fix For MT6755/6753 Lenovo K5 note

IMEI FIX FOR MT6755/6753 Lenovo k5 note   you can watch above video or continue following description  If you do not want to read this story then skip this i have written the Fix for Lenovo K5 note or MT6755 and MT 6753 in this post after the story.   My friend bought Lenovo k5 note a month ago and he tried to change the LTE band to band 4 0 using android MTK engineering mode. After he restarted phone IMEI got lost and NVRAM WARNING: Err = 0x10 comes up. After so he contacted the Lenovo Care. At Lenovo care they told my fried to change the Chip which is cost around 8000/-(INR) my friend refused to do same. And then he asked me to repair his Lenovo K5 note. The same thing is happened with me with my Lenovo K4 note , but in my case i have accidentally  selected Format All+ Download in SP flash tool . I tried to fix for 2 days after that i gave up and took my phone to nearest mobile repair Shop. They fixed IMEI but not able to fix NVRAM WARNING : Err= 0x1