Search This thread

chasmodo

Senior Member
Dec 28, 2011
12,403
41,133
Novi Sad
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.

<?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:
B

baz77

Guest
Thank you so much for this!

Can you teach us to cherry pick codes from aokp and cm10 repos?

e. g. I love cm10, but prefer the switchboard style toggles, or any random code, how can I incoporate it into my own KANG :) from source

Sent from my GT-N7000 using Tapatalk 2
 
Last edited:

pkasula

New member
Apr 4, 2013
3
0
Problem with arch/arm/mach-exynos/exynos4-smc.o

Hello,

I am building cm10.1 for GT-N7000 on Mac 10.7.5. I extracted the kernel for the device from CyanogenMod/android_kernel_samsung_smdk4210.
When I trying to build, it gives me the following error:
CC arch/arm/mm/proc-syms.o
CC arch/arm/mach-exynos/exynos4-smc.o
/var/folders/tn/g4qp8wtn4qx7q8kwmm72ksjc0000gp/T//ccgA75qU.s: Assembler messages:
/var/folders/tn/g4qp8wtn4qx7q8kwmm72ksjc0000gp/T//ccgA75qU.s:32: Error: selected processor does not support ARM mode `smc 0'
/var/folders/tn/g4qp8wtn4qx7q8kwmm72ksjc0000gp/T//ccgA75qU.s:74: Error: selected processor does not support ARM mode `smc 0'
make[3]: *** [arch/arm/mach-exynos/exynos4-smc.o] Error 1
make[2]: *** [arch/arm/mach-exynos] Error 2

I compared the file arch/arm/mach-exynos/exynos4-smc.o in the repository,its same. What modifications do I need to do in exynos4-smc.o?
At some places when i searched it said the prob is with path of toolchain. But I think the problem is with that particular file which doesnot support ARM mode.
Kindly help me solving this error.
 

chasmodo

Senior Member
Dec 28, 2011
12,403
41,133
Novi Sad
First off, this is a tutorial on compiling CM10, not CM10.1.

Second off, there's no need to extract anything when compiling for n7000. Go here, follow the instructions to the letter and all will be well.
 
  • Like
Reactions: pkasula

pkasula

New member
Apr 4, 2013
3
0
First off, this is a tutorial on compiling CM10, not CM10.1.

Second off, there's no need to extract anything when compiling for n7000. Go here, follow the instructions to the letter and all will be well.


Actually I may have used a wrong word "extract'. Actually I followed the steps for 10.1 and used the local_manifest.xml from the thread you mentioned. Still I encounter the same error. Even I tried to run breakfast n7000 , I encountered the same error and I think its because of that particular file but not sure. The terminal output is :
CC arch/arm/mach-exynos/dma.o
CC arch/arm/mach-exynos/irq-eint.o
CC arch/arm/mach-exynos/ppmu.o
CC arch/arm/mach-exynos/exynos4-smc.o ( Error with only this one).
/var/folders/tn/g4qp8wtn4qx7q8kwmm72ksjc0000gp/T//ccq6LJqf.s: Assembler messages:
/var/folders/tn/g4qp8wtn4qx7q8kwmm72ksjc0000gp/T//ccq6LJqf.s:32: Error: selected processor does not support ARM mode `smc 0'
/var/folders/tn/g4qp8wtn4qx7q8kwmm72ksjc0000gp/T//ccq6LJqf.s:74: Error: selected processor does not support ARM mode `smc 0'
make[3]: *** [arch/arm/mach-exynos/exynos4-smc.o] Error 1

Kindly help me solve this error.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    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.

    <?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.:)
    2
    When/if I get it, I promise to do it.:p

    I'll do my best to get it.
    And thanks for the tutorial. :)
    1
    Alternative way to install Java:

    $ sudo apt-get install openjdk-6-jdk

    $ apt-get update
    1
    Brief & clear. Barmen to this, and don't forget to change a local manifest soon for a new device:angel:
    1
    Do not lead me into this temptation! ;)

    Thank you very much chas! :good:

    Try it, it's a piece of cake, especially for an old Linux dog like you.:)