Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[TUTORIAL] Compiling N7000 CM10 for us Dummies

OP chasmodo

28th November 2012, 01:58 PM   |  #1  
chasmodo's Avatar
OP Senior Member
Flag Novi Sad
Thanks Meter: 40,791
 
12,143 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Compiling CM from source is hard, right? Wrong!

All you need is
  • a semi decent PC
  • a decent Interweb connection
  • a bit of patience

a) semi decent PC - compiling a Rom from source entails some data crunching, so the better the box you have, the quicker it gets done

b) doing a repo sync means that you have to download CM10 repository to your machine. It contains some 6-7 Gbs of data, so attempting to do it on a 0.5 megabit connection might take forever and a day. For instance, I'm on a 20 megabit connection and the sync takes about 90 minutes.

c) some patience to read the following tutorial

And that's all.

First things first: you need to download and install 64-bit version of Ubuntu 12.04. A 32-bit one won't cut it. You'll want to have about 80-100 Gb partition for Ubuntu and compiling, and it wouldn't hurt to use another smaller partition (cca 30-40Gb) for swap. For instance, Anti uses a 120 Gb SSD for his compiling, I use 100+40 swap prehistoric SATA 2.

Installed it? Good, let's move on.

Now do a system update; click that little switch icon in the top right hand corner and you'll get a menu. Launch Update Manager and install everything it finds.

Now that your Ubuntu is up to speed you need to download and install some more stuff. Launch the terminal (Ctrl + Alt + T).

Copy the below code and paste it (right-click and paste, Ctrl + V doesn't work) in the terminal, hit enter.

Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl pngcrush schedtool g++-multilib lib32z1-dev lib32ncurses5-dev libxml2-utils
If 'lib32ncurses5-dev' fails, delete it from the list, install everything else.

Now you need to add the following repos, again copy/paste each line into the terminal, hit enter. Repeat for each line of the code below.

Code:
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy main multiverse"
Code:
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy-updates main multiverse"
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
Code:
sudo apt-get update
Now you are going to install Synaptic.

Code:
sudo apt-get install synaptic
Done? Good.

Click the 'Dash Home' button (top left hand corner of your desktop), find and launch Synaptic Package Manager. Search for 'Sun Java6 JDK' and install it will all the dependencies except sun-java6-demo and sun-java6-doc.

Now go to http://developer.android.com/sdk/index.html and download the linux version of the Android SDK. It provides the API libraries and developer tools necessary to build. When your download is done, open it with Archive Manager, extract it somewhere, and move the extracted folder to your Home folder. Rename it to 'SDK' for simplicity.

Now you need to download and install Android SDK Platform Tools. Use file manager to navigate to your SDK sub-folder Tools. Find 'android' and double-click to run it. You'll be asked what you want to download. Choose the 'Platform Tools' and the Android 4.1.2 SDK Level 16 and the Android 4.2 SDK level 17 Dev tools and hit install. Let it download; it might take some time, depending on your download speed.

Now the time is ripe for you to setup your Android repos. Copy/paste the following commands into the terminal, hit enter after each one.

Code:
mkdir -p ~/bin
Code:
mkdir -p ~/android/system
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
Code:
chmod a+x ~/bin/repo
Code:
export PATH=~/bin:$PATH
You have to reboot after this for changes to take effect. Once back at your desktop, relaunch the terminal and copy/paste the following commands (with Enter).

Code:
cd ~/android/system
Code:
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
Code:
repo sync
Basically, what you're doing here is downloading the CM repo to your machine. This will take quite some time, so go grab a cup of coffee and watch some telly.

After the sync has gone through with no problems (knock on wood), you need to create a local manifest to pull TeamHacksung’s fork for N7000.
Launch File Manager, navigate to /android/system and click Ctrl + H for your hidden folders and files to appear. Enter the /.repo folder, right-click and choose 'Create New Document'. Name the empty document 'local_manifest.xml'. Open the document and paste the below code into it. Save and exit Gedit.

Quote:

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

<manifest>

<project name="teamhacksung/buildscripts" path="buildscripts" remote="github" revision="jellybean">

<copyfile dest="build.sh" src="build.sh" />

</project>

<project name="TheMuppets/proprietary_vendor_samsung" path="vendor/samsung" remote="github" revision="jellybean" />

<project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" revision="jellybean" />

<project name="CyanogenMod/android_device_samsung_n7000" path="device/samsung/n7000" remote="github" revision="jellybean" />

<project name="CyanogenMod/android_device_samsung_galaxys2-common" path="device/samsung/galaxys2-common" remote="github" revision="jellybean" />

<project name="CyanogenMod/android_kernel_samsung_smdk4210" path="kernel/samsung/smdk4210" remote="github" revision="jellybean" />

<project name="CyanogenMod/android_hardware_samsung" path="hardware/samsung" remote="github" revision="jellybean" />

</manifest>

Now another repo sync needs to be done to pull in the changes in the local manifest. This sync will be considerably shorter than the first one.
Launch the terminal and copy/paste

Code:
repo sync
Everything went well? Fine, it's time for you to start your first build. It will also take some time; it lasts about 80-90 minutes on my Intel i3-3220 CPU @ 3.30GHz 4 with SATA 2 drives.

Take a stiff drink, say a brief prayer, and enter the following commands into the terminal.

Code:
cd ~/android/system
Code:
./build.sh n7000
If all goes well (no errors), once it is done you will have a flashable CM10 zip in /android/system/out/target/product/n7000 folder.

Not so hard, and it's great fun.



I'd like to say a great big THANK YOU to utacka and anti for helping me navigate the murky waters of my first compile.
Last edited by chasmodo; 20th December 2012 at 10:29 PM.
The Following 14 Users Say Thank You to chasmodo For This Useful Post: [ View ]
28th November 2012, 02:04 PM   |  #2  
chasmodo's Avatar
OP Senior Member
Flag Novi Sad
Thanks Meter: 40,791
 
12,143 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Alternative way to install Java:

$ sudo apt-get install openjdk-6-jdk

$ apt-get update
Last edited by chasmodo; 3rd December 2012 at 08:43 PM.
The Following 2 Users Say Thank You to chasmodo For This Useful Post: [ View ]
28th November 2012, 02:04 PM   |  #3  
nokiamodeln91's Avatar
Senior Member
Thanks Meter: 2,706
 
7,160 posts
Join Date:Joined: Jun 2012
More
Interesting... Thank you
28th November 2012, 02:05 PM   |  #4  
chasmodo's Avatar
OP Senior Member
Flag Novi Sad
Thanks Meter: 40,791
 
12,143 posts
Join Date:Joined: Dec 2011
Donate to Me
More
del
28th November 2012, 02:11 PM   |  #5  
ahalford's Avatar
Senior Member
Flag עץ החיים
Thanks Meter: 2,110
 
2,238 posts
Join Date:Joined: Sep 2011
Donate to Me
More
Brief & clear. Barmen to this, and don't forget to change a local manifest soon for a new device
The Following User Says Thank You to ahalford For This Useful Post: [ View ]
28th November 2012, 02:17 PM   |  #6  
chasmodo's Avatar
OP Senior Member
Flag Novi Sad
Thanks Meter: 40,791
 
12,143 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Quote:
Originally Posted by ahalford

Brief & clear. Barmen to this, and don't forget to change a local manifest soon for a new device

When/if I get it, I promise to do it.
28th November 2012, 02:21 PM   |  #7  
ahalford's Avatar
Senior Member
Flag עץ החיים
Thanks Meter: 2,110
 
2,238 posts
Join Date:Joined: Sep 2011
Donate to Me
More
Don't talk C# to me, there is no "if", there is only "When"
28th November 2012, 02:40 PM   |  #8  
trahzebuck's Avatar
Senior Member
Flag Valkenvania
Thanks Meter: 3,332
 
2,484 posts
Join Date:Joined: Jan 2011
More
Do not lead me into this temptation!

Thank you very much chas!
28th November 2012, 02:48 PM   |  #9  
chasmodo's Avatar
OP Senior Member
Flag Novi Sad
Thanks Meter: 40,791
 
12,143 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Quote:
Originally Posted by trahzebuck

Do not lead me into this temptation!

Thank you very much chas!

Try it, it's a piece of cake, especially for an old Linux dog like you.
The Following User Says Thank You to chasmodo For This Useful Post: [ View ]
28th November 2012, 08:35 PM   |  #10  
vet-note's Avatar
Senior Member
Flag Nebelstadt
Thanks Meter: 1,506
 
934 posts
Join Date:Joined: Jun 2012
Quote:
Originally Posted by chasmodo

When/if I get it, I promise to do it.

I'll do my best to get it.
And thanks for the tutorial.

The Following 2 Users Say Thank You to vet-note For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
cm10 compiling tutorial for n7000, compile cm10 from source, compiling cm10 for n7000, how to compile cm10 for samsung galaxy note
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes