mardi 3 mars 2015

[GUIDE] Build CM12 from Source! [CAT&NOOB-FRIENDLY] topic






Im sick of seeing guides around that tell you all about how to build a rom but never ever go into detail about the hardest part in my opinion which is obtaining device specific code, its ridiculous!? So im here to help.
Just a prior note, im no dev, ive never built from source before (hopefully this will change in 1-2 days :D) and the real devs are people like Luk & Luca who built a lovely repos for us with lots of good documentation. So please go and give Luca & Luk a thanks on any one of there posts!
Also i would like to personally thank Luca for helping me when i asked for info regarding building.


Lets get started shall we! :D

1 - Requirements



4+ GB RAM (I have 4GB)
Preferably a Quad-Core CPU (I have an i5)
HDD/SSD (SSD Recommended, i have a 750 HDD)
GPU - (not needed but may aswell put it here) GTX-740M

A Github account, please go make one (its free!) :)



2 - Linux 64-Bit



We need a Linux based 64 bit OS, i use Linux Mint 17.1 "Rebecca" - Cinnamon (64-bit)
Download and install it, this part is easy in my opinion but if you want more instructions you can use google :)



3 - Initializing the Build Enviroment




PART-1:

Code:


$ sudo apt-get update && sudo apt-get install openjdk-7-jdk
$ sudo apt-get install git-core gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python


Copy and paste both those cmds into a terminal and run, it will be about a 200mb dl for Java & about 600mb for the rest of the required stuff.
After everything is downloaded we need to fix something, so run this command:

Code:


sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

PART-2:




Code:


mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo

The above command initializes the repo stuff.

The following commands add the repo to bashrc for ease of use.

Code:


sudo nano ~/.bashrc

#dont be afraid of nano
add this at the bottom:

Code:


export PATH=~/bin:$PATH

To save Press Ctrl+O and Enter and Ctrl+X to exit

Now to update bashrc, run the following cmd:

Code:


source ~/.bashrc





4 - Downloading CM
Lets make a folder to hold all our stuff:

Code:


mkdir ~/titan/ && cd ~/titan/ && mkdir cm12 && cd ~/titan/cm12/

Now your inside the cm12 folder!

Now initiate the cm repo:

Code:


repo init -u git://github.com/CyanogenMod/android.git -b cm-12.0

Now it might give a small error at the end stating for some id stuff.
So now is the time to add your github infos (run this in terminal):

Code:


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


EG:

Code:


git config --global user.email "diamond.nigel75@Gmail.com"
git config --global user.name "Pizza-Dox"


We havnt yet downloaded the CM12 stuff, but we will in the next part...




5 - Downloading Device Specific Code! (and CM code)



Thanks to Luca and Luk this process has been made so easy your cat can do it to, no searching around and editing manifests and stuff, just a simple one liner in a terminal:

Code:


curl --create-dirs -L -o .repo/local_manifests/titan.xml -O -L https://raw.github.com/motog2014devteam/roomservice/cm-12.0/manifest.xml

This shouldnt take more than 1-2 hours, depending on your internet connection, its only about 1GB i think...

Time to download the device specific code!
run this to download it all together nicely:

Code:


repo sync

#worst part, just sit and wait xD, if you want you can do other stuff, but you have to run:

Code:


repo sync -j2

or -j4 (depends on the bandwidth of your network) and this will allow you to use the internet during download time, but dl time will take a bit longer.



6 - Downloading Device Specific Code! (and CM code)



Now once youve downloaded all the source code you should be able to run your first build! :D
Thanks to some nice build scripts by Luca and Luk, running builds is super duper easy! :)

run

Code:


./build.sh -c1 titan

to build, ive read around and on my system it should only take 1.5 to 3 hours tops, and my system is mediocre. :)

If you want to build a new build and remove all previous builds run:

Code:


./build.sh -c2 titan

And if you want to also sync the latest changes made by cm (get the new features bruh! :D)
run:

Code:


./build -c1 -s titan

Again you can change the -c1 to a -c2 for a brand new build, :)

Thanks again to Luk & Luca for making this so easy to do!



7 - Party Time!



If you want help please leave a comment in this thread and i will try to help.
Also if you do get a successful build done please share it with us, we would love to be a part of your victory party! :D

Thanks to this guide: http://forum.xda-developers.com/chef...pment-t2814763
&
Luca & Luk again!







Aucun commentaire:

Enregistrer un commentaire