[Galaxy S II I9100G Android Development] Black_Prince:
1) You need the following:

-JDK 6 if you wish to build Jellybean.

Code:

$ sudo apt-get install openjdk-6-jdk

-Python, which you can download from python.org. Or:

Code:

$ sudo apt-get install python

-Git, which you can find it at git-scm.com. Or:

Code:

$ sudo apt-get install git-core

-Android SDK:

Download the SDK here: http://developer.android.com/sdk/index.html

Extract the SDK and place it in your home directory.

I renamed my SDK to android-sdk to make it easier to navigate to.

Go to your home folder, press Ctrl+H to show hidden files, and open up your .bashrc file.

Add these lines at the bottom of the file:

Code:

# Android tools
export PATH=${PATH}:~/android-sdk/tools
export PATH=${PATH}:~/android-sdk/platform-tools
export PATH=${PATH}:~/bin

Find your .profile file and add this at the bottom of the file:

Code:

PATH="$HOME/android-sdk/tools:$HOME/android-sdk/platform-tools:$PATH"

You have now successfully installed the Android SDK.

To check for updates issue this into your terminal:

Code:

$ android

2) Install required packages.

Code:

$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils xsltproc

On Ubuntu 10.10:

Code:

$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so

On Ubuntu 11.10:

Code:

$ sudo apt-get install libx11-dev:i386

Building on Ubuntu 12.04 is currently only experimentally supported and is not guaranteed to work on branches other than master.

Code:

$ sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev x11proto-core-dev \
libx11-dev libreadline6-dev libgl1-mesa-glx \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

3) Configure your USB.

Code:

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

Inside of this blank text file insert:

Code:

#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"

4) Save the file and close it and then issue this command:

Code:

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

5) Install the repo:

Code:

$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

6) Initialize the repo:

Code:

$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY

6a) For AOSP:

Code:

$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.3.1_r1

For CM:

Code:

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

6.1) For people who have already done a repo init:

Code:

$ cd WORKING_DIRECTORY

AOSP:

Code:

$ repo init -b android-4.3_r2
$ repo sync

CM:

Code:

$ repo init -b cm-10.2
$ repo sync

7) When prompted, enter your real name and email address.

8) Gather the files:

Code:

$ repo sync

9) Continue onto adding a device

~How To Add A Device To The List~

1) Find the github for your device you wish to add. (For me it is the Samsung Epic 4G Touch [codename d710])

2) Now navigate to the location you are going clone the device tree to:

Code:

$ cd WORKING_DIRECTORY/device
$ mkdir samsung

3) Clone the github device tree from remote to local: (The name after the branch would be whatever you want that folder to be named so make sure it is whatever standard name would be for your device, example: Nexus One [passion], Nexus S [crespo] [inc], etc.)

Code:

$ git clone git://github.com/CyanogenMod/android_device_samsung_i9100g.git -b cm-10.2

4) Now navigate into the folder:

Code:

$ cd i9100g

5) Connect phone to computer and make sure USB debugging is enabled and you have adb set up.

6) Extract Device Proprietary Files:

Code:

$ ./extract-files.sh

Or:

Code:

./proprietary-files.sh

Or: See if other repos have your device's proprietary blobs already (like i9100g):

Code:

$ ~/WORKING_DIRECTORY
$ mkdir vendor
$ git clone https://github.com/TheMuppets/proprietary_vendor_samsung -b cm-10.2 samsung

6.1) Some devices have other dependencies like a common device repo. The i9100g utilizes a omap4-common repo for the galaxys2 family of devices. Clone that repo. From inside the samsung folder:

Code:

$ cd ..

$ git clone git://github.com/CyanogenMod/android_device_samsung_omap4-common.git -b cm-10.2 omap4-common

OR simply u can create local_manifest.xml file in ur .repo folder

<?xml version="1.0" encoding="UTF-8"?>
<manifest>

<remote name="github"
fetch="git://github.com/" />
<remote name="cm"
fetch="git://github.com/CyanogenMod/" />
<project path="device/samsung/i9100g" name="android_device_samsung_i9100g" remote="cm" revision="cm-10.2" />
<project path="device/samsung/omap4-common" name="android_device_samsung_omap4-common" remote="cm" revision="cm-10.2" />
<project path="kernel/samsung/t1" name="android_kernel_samsung_t1" remote="cm" revision="cm-10.2" />
<project path="vendor/samsung" name="TheMuppets/proprietary_vendor_samsung" remote="github" revision="cm-10.2" />
<project path="packages/apps/SamsungServiceMode" name="android_packages_apps_SamsungServiceMode" remote="cm" revision="cm-10.2" />
<project path="hardware/samsung" name="android_hardware_samsung" remote="cm" revision="cm-10.2" />
<project path="hardware/ti/omap4xxx" name="android_hardware_ti_omap4xxx" remote="cm" revision="cm-10.2" />
</manifest>

7) Navigate back to your home directory for building:

Code:

$ cd ~/WORKING_DIRECTORY

8) Prepare To Compile:

Code:

$ source build/envsetup.sh

Or:

Code:

$ . build/envsetup.sh

9) Get your list of devices:

Code:

$ lunch

10) Pick your poison.

11) Now compile ('#' being the number of cores in your processor +1):

Code:

$ make -j#

12) Speed up builds using ccache (optional, but highly recommended):

Edit your .bashrc and add this line at the bottom:

Code:

export USE_CCACHE=1

Then issue these commands:

Code:

$ export USE_CCACHE=1
$ export CCACHE_DIR=~/.ccache
$ prebuilts/misc/linux-x86/ccache/ccache -M 50G

The suggested cache size is 50-100G. (This is size in GB)

Or for a flashable zip:

Code:

$ make -j# otapackage

Or u can try :

$ . build/envsetup.sh && brunch i9100g (or ur device name here)