[Galaxy S III General] DROCSID:
LINKS

This guide is a Device-specific update of one of the following guides:

http://wiki.cyanogenmod.com/wiki/Samsung_Galaxy_S:_Compile_CyanogenMod_(Linux)

http://xdaforums.com/showthread.php?t=1505006

http://xdaforums.com/showthread.php?t=1533711

http://xdaforums.com/showthread.php?t=1779426

DISCLAIMER

Although it's very good described I'm not responsible for any damage to you- or you phone

THANKS

PMOS69

stbenz

rycus86

kasper_h

gmhafiz

REQUIREMENTS:

Linux - Ubuntu/Linux Mint system - 64bit

i9300 with cm10 already installed (grab it from get.cm)

30 GB storage on HD/SSD (SSD is preferable in building speed)

__________________

1 - Install Debian Packages

1.1 - In terminal:

sudo apt-get install git-core gnupg flex bison python rar original-awk gawk p7zip-full gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev pngcrush schedtool
sudo apt-get install libc6-dev x11proto-core-dev libx11-dev libgl1-mesa-dev mingw32 tofrodos python-markdown libxml2-utils
sudo apt-get install g++-multilib lib32z1-dev ia32-libs lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib g++-multilib xsltproc

2 - Install JAVA

2.1 - Install Java JDK for Linux 64-bit (1.6)

sudo apt-get install openjdk-6-jdk

3 - Install Android SDK

3.1 - Setup directories:

cd ~
mkdir android
cd android
mkdir sdk

3.2 - Download Android SDK http://developer.android.com/sdk/index.html

3.3 - Extract SDK contents to ~/android/sdk

3.4 - Add Android SDK Path:

sudo gedit ~/.bashrc

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

3.5 - Add Extra Path For Device:

sudo gedit /etc/udev/rules.d/99-android.rules

#Samsung
SUBSYSTEM==usb, SYSFS{idVendor}==04e8, MODE=0666

SUBSYSTEM=="usb", ATTRS{idVendor}=="####:####", SYMLINK+="android_adb", MODE="0666" GROUP="plugdev"
TEST=="/var/run/ConsoleKit/database", \
RUN+="udev-acl --action=$env{action} --device=$env{DEVNAME}"

sudo chmod +x /etc/udev/rules.d/99-android.rules

3.6 - Close and open new terminal.

3.7 - Install Android SDK Tools

android

4 - Install Repository

4.1 - Download Repo:

mkdir -p ~/bin
mkdir -p ~/android/system
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo

4.2 - Add Repo Path:

sudo gedit ~/.bashrc

export PATH=$PATH:~/bin

4.3 - Close and open new terminal.

4.4 - Initialize Repository & Sync:

cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
repo sync -j16

4.5 - Get Device Specific Repos:

. build/envsetup.sh && breakfast i9300

4.6 - Extract files from phone:

adb root
cd ~/android/system/device/samsung/i9300
./proprietary-files.sh

4.7 - Download Extra Files:

~/android/system/vendor/cm/get-prebuilts

4.8 - Add Toolchain PATH:

sudo gedit ~/.bashrc

#Android Toolchain PATH
export ARCH=arm
export CCOMPILE=$CROSS_COMPILE
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:/home/YOUR-USERNAME/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin

4.9 - Close and open new terminal

5 - Building Android

cd ~/android/system
. build/envsetup.sh && brunch i9300

6 - Install on Phone

6.1 - Copy your .zip file from ~/android/system/out/target/product/i9300/cm-10-XXXXXXXXX-UNOFFICIAL-i9300.zip to the root of the SD card.

6.2 - Optional: Download Google Apps for Jelly Bean from http://goo.im/gapps

6.3 - Flash both of these .zip files from recovery.

7 - Update

cd ~/android/system
repo sync -j16
make installclean

find ./out/ -name 'build.prop' | xargs rm
find ./out/ -name 'cm_i9300-target_files-eng.*.zip' | xargs rm
. build/envsetup.sh && brunch i9300

8 - CyanogenMod 10.1

8.1 - Backup and delete following folders:

~/android/system/vendor/samsung/i9300
~/android/system/vendor/samsung/smdk4412-common
~/android/system/device/samsung/i9300

8.2 - Initialize Repository & Sync:

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

8.3 - Edit local.manifest.xml

gedit ~/android/system/.repo/local_manifest.xml

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="CyanogenMod/android_device_samsung_i9300" path="device/samsung/i9300" remote="github" revision="cm-10.1" />
<project name="CyanogenMod/android_kernel_samsung_smdk4412" path="kernel/samsung/smdk4412" remote="github" revision="cm-10.1" />
<project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" revision="cm-10.1" />
<project name="CyanogenMod/android_hardware_samsung" path="hardware/samsung" remote="github" revision="cm-10.1" />
<project name="CyanogenMod/android_device_samsung_smdk4412-common" path="device/samsung/smdk4412-common" remote="github" />
</manifest>

8.4 - Get Device Specific Repos:

. build/envsetup.sh && breakfast i9300

8.5 - Extract files from phone:

adb root
cd ~/android/system/device/samsung/i9300
./proprietary-files.sh

8.5 - Download the following folders/files (and put in vendor/samsung):

https://github.com/TheMuppets/proprietary_vendor_samsung/tree/cm-10.1/i9300

https://github.com/TheMuppets/proprietary_vendor_samsung/tree/cm-10.1/smdk4412-common

8.6 - Building Android:

cd ~/android/system
. build/envsetup.sh && brunch i9300

9 - Armageddon

make clobber