5,604,367 Members 48,951 Now Online
XDA Developers Android and Mobile Development Forum

[Guide] How to compile and install CM10 for Samsung i9000

Tip us?
 
pmos69
Old
(Last edited by pmos69; 3rd September 2012 at 09:47 PM.)
#1  
pmos69's Avatar
Senior Member - OP
Thanks Meter 577
Posts: 1,245
Join Date: Feb 2009
Location: Lisbon
Tutorial [Guide] How to compile and install CM10 for Samsung i9000

This guide is an adaptation/update of the following guides to CM10:
DISCLAMER
Although the procedures in this guide were tested on 2012-08-03 and produced a working build on the i9000, I take no responsibility for any consequences derived from their use.


Thanks:
Requirements:
  • Linux - Ubuntu 12.04 - 64bit (AFAIK, a 64 bit host is needed to compile JB)
  • An i9000 with cm10 already installed - Get the latest nightly here: http://get.cm/?device=galaxysmtd
  • About 14GB of storage for the repository plus about 15GB for building
If you're using Windows or another OS, grab Virtual Box and install Ubuntu on a VM. It makes a nice development environment.
(Give the VM enough resources - A few cores and 2-4GB of RAM)


Building in other Linux distributions?
Here are some contibutions from fellow members:

__________________________________________________ __________________________________________________ ____



1 - Install Ubuntu Packages

1.1 - In terminal:
Code:
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

NOTE: Must be JDK 1.6 - Don't use other versions.


2.1 - Download Java JDK for Linux 64-bit from Java site: (http://www.oracle.com/technetwork/ja...ads/index.html)
Correct file will be something like: jdk-6u##-linux-x64.bin , where ## is the version number and will change with updates.

2.2 - Move jdk-6u##-linux-x64.bin to your home directory


2.3 - Remove any other java packages from system:

Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*

2.4 - Install Java JDK:

Code:
sudo mkdir -p /opt/java/64/
sudo cp jdk-6u##-linux-x64.bin /opt/java/64
sudo su -
cd /opt/java/64
chmod +x jdk-6u##-linux-x64.bin
./jdk-6u##-linux-x64.bin
exit

2.5 - Add JDK PATH to .bashrc:

Code:
vi ~/.bashrc
Add these lines to .bashrc:
Code:
# Java PATHs
export JAVA_HOME=/opt/java/64/jdk1.6.0_##
export PATH=$PATH:$JAVA_HOME/bin

3 - Install Android SDK


3.1 - Setup directories:
Code:
cd ~
mkdir android
cd android
mkdir sdk
3.2 - Download Android SDK from http://developer.android.com/sdk/index.html

3.3 - Extract SDK contents to ~/android/sdk

3.4
- Add Android SDK Path:

Code:
vi ~/.bashrc
Enter the Following:
Code:
#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:

Code:
sudo vi /etc/udev/rules.d/99-android.rules
Enter this:
Code:
#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}"
Save/close file and run:
Code:
sudo chmod +x /etc/udev/rules.d/99-android.rules
3.6 - Close and open new terminal.

3.7 - Install Android SDK Tools

Code:
android
Check Android SDK Tools and Android SDK platform-tools and Install them

4 - Install Repository

4.1 - Download Repo:
Code:
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:

Code:
vi ~/.bashrc
Enter the following:
Code:
export PATH=$PATH:~/bin

4.3 - Close and open new terminal.


4.4 - Initialize Repository & Sync:

Code:
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
repo sync -j16
NOTE: If you have trouble syncing due to connection issues, try repo sync -j1. It's slower but some ISPs have issues with -j16
Want to make sure you didn't get any connection errors and have the complete repository? Just run the repo sync command again. It can't give you ANY errors.
Go get a beer. And another. And another...

4.5 - Get Device Specific Repos:
Code:
. build/envsetup.sh && breakfast galaxysmtd
Get more beer...

4.6 - Extract files from phone:
NOTE: You need to have cm10 installed on the phone.
Connect phone to pc and in terminal type:
Code:
adb root
cd ~/android/system/device/samsung/galaxysmtd/
./extract-files.sh

4.7 - Download Extra Files:

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

4.8 - Add Toolchain PATH:

Code:
vi ~/.bashrc
Enter the following:
Code:
#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
Code:
cd ~/android/system
. build/envsetup.sh && brunch galaxysmtd
Go get a beer. And another. And another...

6 - Install on Phone

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

6.2 - Optional: Download Google Apps for Jelly Bean from http://goo.im/gapps and place it on the root of the SD card.

6.3 - Flash both of these .zip files from recovery.
Call your mother. She misses you.

...and that's it.


__________________________________________________ __________________________________________________ ____



How to update?
Code:
cd ~/android/system
repo sync -j16
make installclean

find ./out/ -name 'build.prop' | xargs rm
find ./out/ -name 'cm_galaxysmtd-target_files-eng.*.zip' | xargs rm
NOTE: If you have trouble syncing due to connection issues, try repo sync -j1. It's slower but some ISPs have issues with -j16
...get beer, build and install.

Want to go "Steve Jobs" on the Android build? (Warning: Will take a gazillion years to re-build everything again)
Run:
Code:
make clobber

__________________________________________________ __________________________________________________ ____



Want to customize the kernel?

Look here: [Guide] How to customize the CM10 i9000 kernel

.
The Following 81 Users Say Thank You to pmos69 For This Useful Post: [ Click to Expand ]
 
rajeshbabushrestha
Old
#2  
rajeshbabushrestha's Avatar
Senior Member
Thanks Meter 73
Posts: 167
Join Date: Jan 2011

 
DONATE TO ME
will try this soon... thankx
 
a0a0
Old
#3  
Member
Thanks Meter 9
Posts: 70
Join Date: Dec 2009
Can you also write a small paragraph where you explain how compile a single application like Mms, Phone...

Thank you
 
pmos69
Old
#4  
pmos69's Avatar
Senior Member - OP
Thanks Meter 577
Posts: 1,245
Join Date: Feb 2009
Location: Lisbon
Quote:
Originally Posted by a0a0 View Post
Can you also write a small paragraph where you explain how compile a single application like Mms, Phone...

Thank you
You get all the application apks in the produced build.
From there you can extract any single one you want...

Sent from my GT-I9000 using Tapatalk 2
The Following User Says Thank You to pmos69 For This Useful Post: [ Click to Expand ]
 
a0a0
Old
#5  
Member
Thanks Meter 9
Posts: 70
Join Date: Dec 2009
Yes but if i will try a small change in a code i must compile every time all the rom
 
pmos69
Old
#6  
pmos69's Avatar
Senior Member - OP
Thanks Meter 577
Posts: 1,245
Join Date: Feb 2009
Location: Lisbon
Quote:
Originally Posted by a0a0 View Post
Yes but if i will try a small change in a code i must compile every time all the rom
Not really.
Only changed files are compiled (and affected dependencies)

Sent from my GT-I9000 using Tapatalk 2
 
kasper_h
Old
#7  
kasper_h's Avatar
Recognized Developer
Thanks Meter 14796
Posts: 4,966
Join Date: Oct 2010

 
DONATE TO ME
With mmm you can build single apk files, see the cm9 compile thread for details...

Verstuurd van mijn GT-I9000
Galaxy S:
Mackay ROM 4: http://bit.ly/17lGtyw, with Mackay kernel: http://bit.ly/1bNIipy
GalaxyTab: Infamous PAC http://bit.ly/1a04qih
Nexus 5: Mackay ROM 4 http://bit.ly/I1NL0R
The Following 2 Users Say Thank You to kasper_h For This Useful Post: [ Click to Expand ]
 
abalam
Old
#8  
abalam's Avatar
Senior Member
Thanks Meter 1019
Posts: 1,146
Join Date: Oct 2011
Thanks man

Verstuurd van mijn GT-I9000


***Press thanks if my help was useful***
 
elitevet
Old
(Last edited by elitevet; 4th August 2012 at 03:42 PM.)
#9  
elitevet's Avatar
Senior Member
Thanks Meter 363
Posts: 530
Join Date: Mar 2011
Location: Tel Aviv
Quote:
Requirements:
Linux - Ubuntu 12.04...
Does it have to be Ubuntu, provided I can find all listed packages for CentOS, for example?

Also, do you recommend the desktop or the server version?
I don't like CM, oh no... I love it!
______________________
.
...................happy with
CyanogenMod 11.Nightlies

Samsung GT-I9000 MIA

Samsung GT-I9100 CM11 Unofficial
Kernel.......: Stock
Modem......: JILS4


Google Nexus 4.......CM11 Nightly
Kernel.......: Stock
Modem......: M9615A-CEFWMAZM-2.0.1700.98
The Following User Says Thank You to elitevet For This Useful Post: [ Click to Expand ]
 
pmos69
Old
#10  
pmos69's Avatar
Senior Member - OP
Thanks Meter 577
Posts: 1,245
Join Date: Feb 2009
Location: Lisbon
Quote:
Originally Posted by elitevet View Post
Does it have to be Ubuntu, provided I can find all listed packages for CentOS, for example?

Also, do you recommend the desktop or the server version?
Doesn't have to be Ubuntu, as long as you can find the equivalent packages.

It can be the desktop or server version, as long as you have X in it.
The android SDK setup uses a GUI. (but perhaps there's a way to run it from the CLI)

Sent from my GT-I9000 using Tapatalk 2

The Following 3 Users Say Thank You to pmos69 For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes