Guide on how I build my own CM10 test builts

Search This thread

hnl_dk

Senior Member
Nov 1, 2010
1,362
480
This is a follow up on my "old" "Guide on how I build my own CM9 test builts" thread.

Guide how I build CM10 for my Mango.

For the first time you try to build CM10.
Create ~/bin and download repo to that directory. Afterwards set executable bit to make it possible to ”execute”.
Code:
mkdir -p ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo 
chmod a+x ~/bin/repo
Now reboot the computer.

Create ~/android/system and initialize the repository.
Code:
mkdir -p ~/android/system
cd ~/android/system/ 
repo init -u git://github.com/CyanogenMod/android.git -b jellybean

Unpack the attached local_manifest.xml.bz2 and place local_manifest.xml into ~/android/system/.repo

Synchronise towards the current git repositories.
Code:
repo sync
Setup the environmental settings and initialize the Mango build.
Code:
. build/envsetup.sh
breakfast mango
Initialize the Mango build.
Code:
cd ~/android/system/device/semc/mango/
./setup-makefiles.sh
Download the prebuilts
Code:
~/android/system/vendor/cm/get-prebuilts
Check for new changes
Code:
cd ~/android/system/ 
repo sync
Setup the environment again and build the ROM (takes long time)
Code:
. build/envsetup.sh
brunch mango
You will now find the build here (change DATE into the date).
~/android/system/out/target/product/mango/cm-10-DATE-UNOFFICIAL-mango.zip

The next times you try to build it, you only need to do the following.
Delete build.prop, if not will build.prop not get generated.
Code:
rm -f ~/android/system/out/target/product/mango/system/build.prop
Syncronise the git repositories.
Code:
cd ~/android/system/
repo sync
Setup the environmental settings.
Code:
. build/envsetup.sh
Configure/build.
Code:
brunch mango
You will now find the build here (change DATE into the date).
~/android/system/out/target/product/mango/cm-10-DATE-UNOFFICIAL-mango.zip

EDIT (August 14. 2012): If the boot.img is not booting, is it most likely due to the bootloader bug.
To make it "work", do the following (replace mango with your own device)
Code:
cd out/target/product/mango/
rm -f ./boot.img ./combinedroot.cpio ./combinedroot.fs ./ramdisk.img
cp ./root/logo.rle ./root/waste_of_space1
cp ./root/logo.rle ./root/waste_of_space2
cp ./combinedroot/logo.rle ./combinedroot/waste_of_space1
cp ./combinedroot/logo.rle ./combinedroot/waste_of_space2
cd ../../../..
brunch mango
 

Attachments

  • local_manifest.xml.bz2
    324 bytes · Views: 426
Last edited:

bokrug

Senior Member
Jan 28, 2012
82
18
just a technical: is it really necessary to reboot the computer after downloading the repo binary? and if so, why is that??
 

hnl_dk

Senior Member
Nov 1, 2010
1,362
480
just a technical: is it really necessary to reboot the computer after downloading the repo binary? and if so, why is that??

It is only necessary on some Linux distributions, where you will not be able to execute anything from that directory, before a reboot. You can try to see if you can do it without. If it is working, do you not need it.
 

pikpok

Senior Member
Jul 28, 2009
187
229
Zamosc
It is only necessary on some Linux distributions, where you will not be able to execute anything from that directory, before a reboot. You can try to see if you can do it without. If it is working, do you not need it.

There's no really need to reboot - edit .bashrc in your home directory and add
Code:
export PATH=~/bin/:$PATH
Save, then run:
Code:
source ~/.bashrc
It have to work on all distros :p
 

hnl_dk

Senior Member
Nov 1, 2010
1,362
480
There's no really need to reboot - edit .bashrc in your home directory and add
Code:
export PATH=~/bin/:$PATH
Save, then run:
Code:
source ~/.bashrc
It have to work on all distros :p
I just want to show the "universal" way.
Not everyone is using bash ;)
 

hnl_dk

Senior Member
Nov 1, 2010
1,362
480
If someone use another shell, e.g. zsh, then he'll know what files he have to edit :) IMO rebooting is wasting time.
no it is not, as you do not need to edit any files. It will work automatically.
It is as much a waste of time to edit the resource-definition scripts.
 

pikpok

Senior Member
Jul 28, 2009
187
229
Zamosc
no it is not, as you do not need to edit any files. It will work automatically.
It is as much a waste of time to edit the resource-definition scripts.

Reboot - about 1 min
Edit one file and paste single command in terminal - for me it's 10secs :D
But it comes to offtop discussion, so it would be better to end it now :)

@edit - now when I think about it... bin in home folder won't be added to PATH automatically, at least in Arch Linux. Maybe Ubuntu is more "intelligent" :laugh:
 
Last edited:

hnl_dk

Senior Member
Nov 1, 2010
1,362
480
Reboot - about 1 min
Edit one file and paste single command in terminal - for me it's 10secs :D
But it comes to offtop discussion, so it would be better to end it now :)

@edit - now when I think about it... bin in home folder won't be added to PATH automatically, at least in Arch Linux. Maybe Ubuntu is more "intelligent" :laugh:
It does not take that long for me to make a reboot ;)
No matter what, is it always good to have more methods to make something work.
It did the last time I tried Arch Linux... and no I am not using Ubuntu (too flashy for me ;))
 

DeVelox

Member
Feb 9, 2012
24
15
Assuming that there is an entry in your ~/.profile that adds ~/bin to PATH, a reboot won't do anything that logout/login wouldn't. Furthermore, logout/login (in this case) won't do anything that sourcing ~/.profile wouldn't. So, simply issuing "source ~/.profile" is sufficient on most distributions. If you are using a distribution or a shell that doesn't do this by default, then you probably already know what you need to do.

I do, however, commend hnl_dk's efforts to make things simpler for newcomers to Android and Linux, even if it's not the the "fastest" or the "best" way. Whenever you start getting into one of those "what if?" arguments, things tend to spiral out of control. Sometimes it's better to just make a few assumptions and go with what is most likely to work.

A reboot might be a bit of an overkill, though. :laugh:
 
  • Like
Reactions: pikpok

ak-a

Member
Sep 30, 2010
18
0
Nairn, Highlands
Can't run 64-bit prebuilts on my 32-bit Linux

I have a 32-bit Linux box so get the errors:

/bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: cannot execute binary file

Had a quick look around, but are there gcc etc. prebuilts for 32-bit Linux boxes?

TIA,
AK-A
 

hnl_dk

Senior Member
Nov 1, 2010
1,362
480
I have a 32-bit Linux box so get the errors:

/bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: cannot execute binary file

Had a quick look around, but are there gcc etc. prebuilts for 32-bit Linux boxes?

TIA,
AK-A
Did you try to build it as described?
It is working fine on my 32bit debian machine.

If not, please describe hos you try it build it.
 

CosmoDroid

Senior Member
Jan 14, 2012
353
283
Hey !!! Do you think I should post my AOSP errors in this thread...so that its easier for us to keep track..?? :highfive:
 

Snoopo

Senior Member
Oct 19, 2010
793
240
As this is a Tutorial Thread for "how to build cm10 on your own" I don't think it makes sense posting errormessages of errm. "android open source project"? As I am writing this I recognize that I do not really understand what you mean.
 

hnl_dk

Senior Member
Nov 1, 2010
1,362
480
Hey !!! Do you think I should post my AOSP errors in this thread...so that its easier for us to keep track..?? :highfive:
Like Snoopo is saying, should that be in this thread. Compiling AOSP is not as "user friendly" as CM, as our devices are officially supported by CM and not AOSP.
If you want, can you make a new thread about compiling "AOSP - Jelly bean".
 
  • Like
Reactions: CosmoDroid

shufuking

Senior Member
Dec 4, 2011
405
2,686
i always stop at "repo sync"

i always stop at "repo sync"
and it always tell me
"Fetching projects: 21% (66/313) fatal: unable to connect to github.com:
github.com[0: 207.97.227.239]: errno=??????"
can you help me :(
thanks
 

hnl_dk

Senior Member
Nov 1, 2010
1,362
480
i always stop at "repo sync"
and it always tell me
"Fetching projects: 21% (66/313) fatal: unable to connect to github.com:
github.com[0: 207.97.227.239]: errno=??????"
can you help me :(
thanks
Same also happens for me, then I try again and again and again and then it is working.
Lots of people are accessing github, and there is only a limited "whole" for the data to get through.
 
  • Like
Reactions: shufuking

shufuking

Senior Member
Dec 4, 2011
405
2,686
Same also happens for me, then I try again and again and again and then it is working.
Lots of people are accessing github, and there is only a limited "whole" for the data to get through.
thanks for your suggestion :)
finally i make it.
another question.
when i perform " brunch smultron"
i got lots of "cannot execute binary file"
and final "make: *** [out/target/product/smultron/obj/lib/crtbegin_static.o] Error 126"

do you know what it means?
 
Last edited:

hnl_dk

Senior Member
Nov 1, 2010
1,362
480
thanks for your suggestion :)
finally i make it.
another question.
when i perform " brunch smultron"
i got lots of "cannot execute binary file"
and final "make: *** [out/target/product/smultron/obj/lib/crtbegin_static.o] Error 126"

do you know what it means?
without more details, my best guess is that you may be building it on a FAT32 or NTFS partition?
then there is a good chance that linux is not able to read the executable bits.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 30
    This is a follow up on my "old" "Guide on how I build my own CM9 test builts" thread.

    Guide how I build CM10 for my Mango.

    For the first time you try to build CM10.
    Create ~/bin and download repo to that directory. Afterwards set executable bit to make it possible to ”execute”.
    Code:
    mkdir -p ~/bin
    curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo 
    chmod a+x ~/bin/repo
    Now reboot the computer.

    Create ~/android/system and initialize the repository.
    Code:
    mkdir -p ~/android/system
    cd ~/android/system/ 
    repo init -u git://github.com/CyanogenMod/android.git -b jellybean

    Unpack the attached local_manifest.xml.bz2 and place local_manifest.xml into ~/android/system/.repo

    Synchronise towards the current git repositories.
    Code:
    repo sync
    Setup the environmental settings and initialize the Mango build.
    Code:
    . build/envsetup.sh
    breakfast mango
    Initialize the Mango build.
    Code:
    cd ~/android/system/device/semc/mango/
    ./setup-makefiles.sh
    Download the prebuilts
    Code:
    ~/android/system/vendor/cm/get-prebuilts
    Check for new changes
    Code:
    cd ~/android/system/ 
    repo sync
    Setup the environment again and build the ROM (takes long time)
    Code:
    . build/envsetup.sh
    brunch mango
    You will now find the build here (change DATE into the date).
    ~/android/system/out/target/product/mango/cm-10-DATE-UNOFFICIAL-mango.zip

    The next times you try to build it, you only need to do the following.
    Delete build.prop, if not will build.prop not get generated.
    Code:
    rm -f ~/android/system/out/target/product/mango/system/build.prop
    Syncronise the git repositories.
    Code:
    cd ~/android/system/
    repo sync
    Setup the environmental settings.
    Code:
    . build/envsetup.sh
    Configure/build.
    Code:
    brunch mango
    You will now find the build here (change DATE into the date).
    ~/android/system/out/target/product/mango/cm-10-DATE-UNOFFICIAL-mango.zip

    EDIT (August 14. 2012): If the boot.img is not booting, is it most likely due to the bootloader bug.
    To make it "work", do the following (replace mango with your own device)
    Code:
    cd out/target/product/mango/
    rm -f ./boot.img ./combinedroot.cpio ./combinedroot.fs ./ramdisk.img
    cp ./root/logo.rle ./root/waste_of_space1
    cp ./root/logo.rle ./root/waste_of_space2
    cp ./combinedroot/logo.rle ./combinedroot/waste_of_space1
    cp ./combinedroot/logo.rle ./combinedroot/waste_of_space2
    cd ../../../..
    brunch mango
    5
    have added hos to make the boot.img boot, if it is failing due to the bootloader bug.
    3
    A simple way to build with a 32 bit host system is to put this in your .repo/local_manifest.xml:
    Code:
      <remove-project name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6" />
      <project name="yath/android_prebuilts_gcc_linux-x86-32_arm_arm-linux-androideabi-4.6" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6" remote="github" revision="jellybean" />
    and then:
    Code:
    rm -R ~/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6
    repo sync
    3
    Hi.
    Is anyone can explain how to compile only kernel (boot.img) and not mess up all the ROM source?
    I've tried, but always get errors.
    Thanks.

    I was wrong in my previous post, you can build the boot.img by executing

    Code:
    make -j4 bootimage
    3
    Before that you'll have to do:
    Code:
    . build/envsetup.sh
    lunch
    Select cm-<device>-userdebug in the lunch menu and have a nice lunch ;)