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)
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".
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.
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
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!
Sir help me compile AEX fot lenovo a6000.
ReplyDeleteI am still confused.
Please guide step by step picture..
Thanks sir
Thanks, nice guide
ReplyDeletethe dark theme looks cool, but the font is not too bright, which is straining our eyes.
ReplyDeleteThe 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