Initializing Android Build Environment

First you need to have a 64 bit linux-based pc with atleast about 30+ GB space to build.

Note : The source download is 8-9 gb in size.

Installing the Java

sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner”
sudo apt-get update
sudo apt-get install sun-java6-jdk

Installing required libs-packages

sudo apt-get install git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386

Configuring USB Access

gksudo gedit /etc/udev/rules.d/51-android.rules

Insert this in that blank document :

#Acer
SUBSYSTEM==”usb”, ATTR{idVendor}==”0502″, MODE=”0666″

#ASUS
SUBSYSTEM==”usb”, ATTR{idVendor}==”0b05″, MODE=”0666″

#Dell
SUBSYSTEM==”usb”, ATTR{idVendor}==”413c”, MODE=”0666″

#Foxconn
SUBSYSTEM==”usb”, ATTR{idVendor}==”0489″, MODE=”0666″

#Garmin-Asus
SUBSYSTEM==”usb”, ATTR{idVendor}==”091E”, MODE=”0666″

#Google
SUBSYSTEM==”usb”, ATTR{idVendor}==”18d1″, MODE=”0666″

#HTC
SUBSYSTEM==”usb”, ATTR{idVendor}==”0bb4″, MODE=”0666″

#Huawei
SUBSYSTEM==”usb”, ATTR{idVendor}==”12d1″, MODE=”0666″

#K-Touch
SUBSYSTEM==”usb”, ATTR{idVendor}==”24e3″, MODE=”0666″

#KT Tech
SUBSYSTEM==”usb”, ATTR{idVendor}==”2116″, MODE=”0666″

#Kyocera
SUBSYSTEM==”usb”, ATTR{idVendor}==”0482″, MODE=”0666″

#Lenevo
SUBSYSTEM==”usb”, ATTR{idVendor}==”17EF”, MODE=”0666″

#LG
SUBSYSTEM==”usb”, ATTR{idVendor}==”1004″, MODE=”0666″

#Motorola
SUBSYSTEM==”usb”, ATTR{idVendor}==”22b8″, MODE=”0666″

#NEC
SUBSYSTEM==”usb”, ATTR{idVendor}==”0409″, MODE=”0666″

#Nook
SUBSYSTEM==”usb”, ATTR{idVendor}==”2080″, MODE=”0666″

#Nvidia
SUBSYSTEM==”usb”, ATTR{idVendor}==”0955″, MODE=”0666″

#OTGV
SUBSYSTEM==”usb”, ATTR{idVendor}==”2257″, MODE=”0666″

#Pantech
SUBSYSTEM==”usb”, ATTR{idVendor}==”10A9″, MODE=”0666″

#Philips
SUBSYSTEM==”usb”, ATTR{idVendor}==”0471″, MODE=”0666″

#PMC-Sierra
SUBSYSTEM==”usb”, ATTR{idVendor}==”04da”, MODE=”0666″

#Qualcomm
SUBSYSTEM==”usb”, ATTR{idVendor}==”05c6″, MODE=”0666″

#SK Telesys
SUBSYSTEM==”usb”, ATTR{idVendor}==”1f53″, MODE=”0666″

#Samsung
SUBSYSTEM==”usb”, ATTR{idVendor}==”04e8″, MODE=”0666″

#Sharp
SUBSYSTEM==”usb”, ATTR{idVendor}==”04dd”, MODE=”0666″

#Sony Ericsson
SUBSYSTEM==”usb”, ATTR{idVendor}==”0fce”, MODE=”0666″

#Toshiba
SUBSYSTEM==”usb”, ATTR{idVendor}==”0930″, MODE=”0666″

#ZTE
SUBSYSTEM==”usb”, ATTR{idVendor}==”19D2″, MODE=”0666″

Save the file and give it permission by :

sudo chmod a+r /etc/udev/rules.d/51-android.rules

Install repo

mkdir ~/bin

Now open your .bashrc file (in home directory – enable hidden files) with gedit or other editor and add this line :

export PATH=~/bin:$PATH

Save it. reboot recommended. Now curl the repo in bin directory.

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

Initialize repo and sync

For CyanogenMod, (cm-7.2 | cm-9 | cm-10 | cm-10.1 | cm-10.2 | cm-11.0 )

mkdir cm-10.1
cd cm-10.1
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1

For AOSP

mkdir android-4.2
cd android-4.2
repo init -u https://android.googlesource.com/platform/manifest -b android-4.2.2_r1.2

Now to sync source (cd to initialized source first):

repo sync

Now what ?

Now you have to collect the device configuration or you can get the existing from the git if have.
Or you need to prepare the device config yourself or make them from scratch.

After that, everything ready ? Now brunch :

. build/envsetup.sh && brunch device

Or

. build/envsetup.sh && lunch
make -j3

 

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s