FORUMS
Remove All Ads from XDA

Guide on how I build my own CM9 test builts

1,355 posts
Thanks Meter: 483
 
By hnl_dk, Senior Member on 2nd July 2012, 02:53 PM
Post Reply Subscribe to Thread Email Thread
A follow up on this - http://forum.xda-developers.com/show...postcount=1768 - in the CM9 FXP thread, have I promised to make a little guide.

Guide how I build CM9 for my Mango.

For the first time you try to build CM9.
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 amd initialize the repository.
Code:
mkdir -p ~/android/system
cd ~/android/system/ 
repo init -u git://github.com/CyanogenMod/android.git -b ics 
repo sync
Setup the environmental settings and initialize the Mango build.
Code:
. build/envsetup.sh
brunch mango
Setup the environmental settings and initialize the Mango build.
Code:
git clone git://github.com/TheMuppets/proprietary_vendor_semc.git  -b ics ~/android/system/vendor/semc
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-9-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-9-DATE-UNOFFICIAL-mango.zip

If you are trying to build it on a 32bit system, you should change line 374 in ~/android/system/device/semc/msm7x30-common/releasetools/common.py
from:
Code:
  cmd = ["java", "-Xmx2048m", "-jar",
to:
Code:
  cmd = ["java", "-Xmx1024m", "-jar",
If you get into any trouble, please let me know, I may have missed something.

EDIT (July 2. 2012): I have made a patch to msm7x30-common, so you do not need to edit the file (with this patch does it automatically check if you run on a 64bit or a 32bit system):
http://code.google.com/p/freexperia/.../detail?id=527

EDIT (July 6. 2012): If there has been an update on git://github.com/koush/proprietary_vendor_semc.git (like there has been today), shall you do the following (pull the updates):
Code:
cd ~/android/system/vendor/semc
git pull
EDIT (July 8. 2012): Adding the following, just before "</manifest>" in ".repo/local_manifest.xml" and the proprietary files will also get updated, when you make a normal "repo sync". Got this idea after talking to Andreas (so thank you Andreas).
Code:
  <project name="TheMuppets/proprietary_vendor_semc" path="vendor/semc" remote="github" revision="ics" />
EDIT (July 11. 2012): Changed the proprietary repository from git://github.com/koush/proprietary_vendor_semc.git to git://github.com/TheMuppets/proprietary_vendor_semc.git
Last edited by hnl_dk; 1st August 2012 at 04:50 PM.
The Following 11 Users Say Thank You to hnl_dk For This Useful Post: [ View ] Gift hnl_dk Ad-Free
 
 
2nd July 2012, 03:01 PM |#2  
gandhar's Avatar
Senior Member
Flag Goa
Thanks Meter: 682
 
More
allright, i have already synched the cm9 repo. about 5.8 gbs
can you tell me what folders does it include?
edit:took me a few days to download, just don't want to download again
Last edited by gandhar; 2nd July 2012 at 03:07 PM.
2nd July 2012, 03:09 PM |#3  
hnl_dk's Avatar
OP Senior Member
Thanks Meter: 483
 
Donate to Me
More
Quote:
Originally Posted by gandhar

allright, i have already synched the cm9 repo. about 5.8 gbs
can you tell me what folders does it include?

Are you thinking of the "clean" repo?

My ~/android/system/ consists of the following (remember the hidden directories):
abi
android
bionic
bootable
build
dalvik
development
device
external
frameworks
hardware
kernel
libcore
ndk
out
packages
prebuilt
sdk
system
vendor
.repo
.repoconfig
Makefile
2nd July 2012, 03:10 PM |#4  
hnl_dk's Avatar
OP Senior Member
Thanks Meter: 483
 
Donate to Me
More
You should be able to move your current directory and "just" sync it, to get it up to date.
2nd July 2012, 03:14 PM |#5  
gandhar's Avatar
Senior Member
Flag Goa
Thanks Meter: 682
 
More
Quote:
Originally Posted by hnl_dk

Are you thinking of the "clean" repo?

My ~/android/system/ consists of the following (remember the hidden directories):
abi
android
bionic
bootable
build
dalvik
development
device
external
frameworks
hardware
kernel
libcore
ndk
out
packages
prebuilt
sdk
system
vendor
.repo
.repoconfig
Makefile


allright, out of these except for kernel, out and .repoconfig i have all the others synced.
will using
Code:
repo init -u git://github.com/CyanogenMod/android.git -b ics 
repo sync
work?


i am missing kernel, out and .repoconfig
2nd July 2012, 03:19 PM |#6  
hnl_dk's Avatar
OP Senior Member
Thanks Meter: 483
 
Donate to Me
More
Quote:
Originally Posted by gandhar

allright, out of these except for kernel, out and .repoconfig i have all the others synced.
will using

Code:
repo init -u git://github.com/CyanogenMod/android.git -b ics 
repo sync
work?


i am missing kernel, out and .repoconfig

They are possibly first created when running brunch the first time. So it should be fine.
2nd July 2012, 04:54 PM |#7  
gandhar's Avatar
Senior Member
Flag Goa
Thanks Meter: 682
 
More
successfully building, but getting loads of warnings..
is that normal for the first build?
will report if it boots after compile is over.
2nd July 2012, 05:00 PM |#8  
hnl_dk's Avatar
OP Senior Member
Thanks Meter: 483
 
Donate to Me
More
Quote:
Originally Posted by gandhar

successfully building, but getting loads of warnings..
is that normal for the first build?
will report if it boots after compile is over.

There are lots of warnings.
Personally I usually remove all that warnings (using the -Werror option, so warnings get treated as errors) in the projects I am working on. But I understand why it can be a big problem with CM9, that is based on many different projects.

Looking forward to hear if you get a successful built.
2nd July 2012, 05:15 PM |#9  
gandhar's Avatar
Senior Member
Flag Goa
Thanks Meter: 682
 
More
Quote:
Originally Posted by hnl_dk

There are lots of warnings.
Personally I usually remove all that warnings (using the -Werror option, so warnings get treated as errors) in the projects I am working on. But I understand why it can be a big problem with CM9, that is based on many different projects.

Looking forward to hear if you get a successful built.

building will take some time...
well, most warnings are 'some variable has been set but not used', is that much significant?
2nd July 2012, 05:41 PM |#10  
hnl_dk's Avatar
OP Senior Member
Thanks Meter: 483
 
Donate to Me
More
Quote:
Originally Posted by gandhar

building will take some time...
well, most warnings are 'some variable has been set but not used', is that much significant?

Yes, first build takes a lot of time... the next times it will be a lot faster.

No that is not very significant, but things like that should still get fixed, to to make it easier to find the significant things.
The less warnings the more easy it is to spot what is important. This also goes for things that should get changed when upgrading to a new major version of the toolchain.
2nd July 2012, 06:02 PM |#11  
gandhar's Avatar
Senior Member
Flag Goa
Thanks Meter: 682
 
More
succesfull build!
phone:coconut-wt19i
time: 56 mins for the complete build.
cpu: 2.9 ghz - 4 cores
os:ubuntu 12.04 64 bit

backed up the phone.
boots into recovery
errorless install.

Read More
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes