Jump to content

[GUIDE] Compiling CyanogenMod 9 for the ZTE Crescent


Guest Dazzozo

Recommended Posts

Guest Dazzozo

If you're pro and want something a little less wordy, there's a shorter guide over on the Blade forum: http://www.modaco.co...cm10-for-blade/

I've had a few people ask me this over the past few days via Twitter and other means, it was initially sent as a PM to a couple of people but I may as well just make it a thread at this point. I would've written this for CM10 but that's a bit more involved at the moment. Hacks.

This is pretty much how I always did my builds for CyanogenMod 9. I'll be assuming you have general Linux knowledge as teaching that too would take quite a lot longer.

Initial Setup

You need a Linux distribution that is Debian based, Ubuntu is always preferred when it comes to building Android, though personally I've always used Debian 6 and had no trouble. I also hope you have lots of RAM.

For 32-bit and 64-bit systems, install as much of:

git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool

That is available. If you're 64-bit you will also need:

lib32z1-dev lib32ncurses5-dev lib32readline6-dev gcc-multilib g++-multilib

You will also need to install the Sun Java 6 JDK which is a bit of a pain as due to Oracle issues it has been removed from Ubuntu repositories. You'll probably have to do a bit of a Google around as the best method to do this changes pretty often for some reason. The package was sun-java6-jdk. Some have had luck with this: http://www.gaggl.com...n-ubuntu-12-04/

It's time to meet "repo". repo is Google's git management wrapper that ties many git repositories together. It is used to initially sync and update the CM code base.

I would advise you put the "repo" tool at ~/bin so that you can call it anywhere as that user, e.g:

mkdir -p ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo[/CODE]

(Had to code tag this one as MoDaCo shortened it as a link...)

[b]Syncing[/b]

After this you'll want to start initialising and cloning the source.

[font=courier new,courier,monospace]mkdir -p ~/android/source/cm9[/font]

[font=courier new,courier,monospace]cd ~/android/source/cm9[/font]

[font=courier new,courier,monospace]repo init -u git://github.com/CyanogenMod/android.git -b ics[/font]

[font=courier new,courier,monospace]repo sync -j4[/font]

This'll take a while as you're downloading the whole Android source and history. Once done, I'd run [font=courier new,courier,monospace]repo sync[/font] again just to make sure everything synced properly. Syncs don't take long after the initial sync, it just pulls what has changed.

You'll now want to set up a local manifest for my repos (unless you want to go it alone and reinvent the wheel with supporting the device). This allows you to pull the updates in my repos at the same time as you run [font=courier new,courier,monospace]repo sync[/font] as if it were part of CM9. It generally makes things easier instead of you having to worry about git pulling all my stuff when there's an update. Navigate to your CM9 folder, and the ".repo" folder within that, e.g; [font=courier new,courier,monospace]cd ~/android/source/cm9/.repo/[/font]

This is my manifest, and I doubt you'll have anything to change. You just save this to [font=courier new,courier,monospace]local_manifest.xml[/font] within the .repo directory.

[font=courier new,courier,monospace]<?xml version="1.0" encoding="UTF-8"?>

<manifest>

<project name="Dazzozo/android_device_zte_blade2" path="device/zte/blade2" remote="github" revision="ics" />

<project name="Dazzozo/proprietary_vendor_zte" path="vendor/zte" remote="github" revision="ics" />

</manifest>[/font]

Run [font=courier new,courier,monospace]repo sync[/font] again and you'll also notice it pulling these repos. Pretty much done by this point, you'll want to go to [font=courier new,courier,monospace]~/android/source/cm9/vendor/cm[/font] and run [font=courier new,courier,monospace]./get-prebuilts[/font] in there. This just gets the ROM Manager apk, Terminal Emulator apk and its associated lib (yuck, I know, but they are required in the build process and it will complain if they're missing.)

[b]Building[/b]

You're ready to build - though it doesn't hurt to throw in another [font=courier new,courier,monospace]repo sync[/font].

From the CM9 folder, in my example, [font=courier new,courier,monospace]~/android/source/cm9/[/font], you want to run [font=courier new,courier,monospace]. build/envsetup.sh[/font] which initialises the environment for building. Once you've done this, run [font=courier new,courier,monospace]brunch cm_blade2-userdebug[/font] and it'll take it from there.

Android is pretty big and it depends on your hardware how quick the build process is, my builds typically take about 20-30 minutes with an Intel i5-2300 2.8GHz Quad-Core. A word of warning: if you're making changes there's a chance they might not get picked up by the build process, I've no idea why this happens - it's apparently a widespread issue. If you want to completely clean your output files, run [font=courier new,courier,monospace]rm -rf out/target[/font] which will scrub anything related to the device.

Once the build has finished it will tell you where the final zip is at. Have fun!

Link to comment
Share on other sites

Guest MadEye Moody

CM10 compilation seems to want some more libraries

Got a bit longer and updated dependency list from this thread:

http://forum.xda-dev...d.php?t=1566224

git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev:i386 g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386[/CODE]

Edit 1:Using openjdk instead of Oracle JDK throws a warning at the start of compilation that the java version doesn't match.

Edit 2:The above list is for 64bit OS. I think for 32bit just omitting the :i386 should be enough

Edited by MadEye Moody
Link to comment
Share on other sites

Guest PsYcHoKiLLa

I had a problem getting the java downloader/installer from your link working, it gave a 404 error, found this one instead and it seems to work ok...

https://www.dropbox.com/s/lm54oxrg4nln05e/oab-java6.sh

Just use it instead of the link, see here...

android@android-builder:~/Downloads$ chmod +x oab-java6.sh

android@android-builder:~/Downloads$ sudo ./oab-java6.sh

oab-java6.sh v0.2.3 - Create a local &#39;apt&#39; repository for Sun Java 6 and/or Oracle Java 7 packages.

Copyright © Martin Wimpress, http://flexion.org. MIT License

By running this script to download Java you acknowledge that you have

read and accepted the terms of the Oracle end user license agreement.

* http://www.oracle.co....co.../license/

If you want to see what this is script is doing while it is running then execute

the following from another shell:

tail -f /home/android/Downloads/oab-java6.sh.log

[x] Installing Java build requirementssuccess

[x] Making build directoriessuccess

[x] Removing clones of http://github.com/rr...a6success

[x] Cloning http://github.com/rr...a6success

[x] Checking out v6.33-2success

[x] Getting Java SE download pagesuccess

[x] Getting current release download pagesuccess

[x] Downloading jdk-6u33-linux-i586.bin : 68.42 MBsuccess

[x] Symlinking jdk-6u33-linux-i586.binsuccess

[x] Downloading jdk-6u33-linux-x64.bin : 68.69 MBsuccess

[x] Symlinking jdk-6u33-linux-x64.binsuccess

[x] Getting Java Cryptography Extension download pagesuccess

[x] Downloading jce_policy-6.zip : 8.89 KBsuccess

[x] Symlinking jce_policy-6.zipsuccess

[x] Updating the changelogsuccess

[x] Building the packagessuccess

[x] Moving the packagessuccess

[x] Creating Packages.gz file success

[x] Creating Release file success

[x] Create GnuPG configuration success

[x] Start generating entropysuccess

[x] Creating signing keysuccess

[x] Stop generating entropysuccess

[x] Signing the &#39;Release&#39; filesuccess

[x] Exporting public key success

[x] Adding public keysuccess

[x] Update package listsuccess

All done!

Edited by PsYcHoKiLLa
Link to comment
Share on other sites

Guest PsYcHoKiLLa

Also I got a message when I tried the repo line, I got a message saying

No command 'repo' found, did you mean :

blah blah

Looked it up and the fix is to use :

PATH=$PATH:~/bin

then run the command again and it should work fine.

Link to comment
Share on other sites

Guest PsYcHoKiLLa

Quick question, I tried following your guide but substituting CM10 for CM9 and Jellybean for ICS cos I think that most people just want to progress to CM10, not least CyanogenMod themselves, it all goes fine until the last download section where it says...

error: revision jellybean in Dazzozo/proprietary_vendor_zte not found

Are there no files for the Crescent in CM10 yet? Or are you using the "testing" branch for CM10?

Edited by PsYcHoKiLLa
Link to comment
Share on other sites

Guest Dazzozo

There's no differences required for the props (yet), so leave proprietary_vendor_zte on the ics branch.

I wrote the guide for CM9 as it builds cleanly and people will probably be happier with the results. :P

Link to comment
Share on other sites

Guest PsYcHoKiLLa

Where do we run brunch from?

I get the following when I try to run it, everything else seems ok and updated...

android@android-builder:~/android/source/cm10/device/zte$ ls

blade2

android@android-builder:~/android/source/cm10/device/zte$ brunch cm_blade2-userdebug

build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/blade2/cm.mk]]: "frameworks/base/build/phone-hdpi-512-dalvik-heap.mk" does not exist. Stop.

Device blade2 not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).

^CTraceback (most recent call last):

File "build/tools/roomservice.py", line 28, in <module>

result = json.loads(urllib2.urlopen("https://api.github.com/users/CyanogenMod/repos?page=%d" % page).read())

File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen

return _opener.open(url, data, timeout)

File "/usr/lib/python2.7/urllib2.py", line 400, in open

response = self._open(req, data)

File "/usr/lib/python2.7/urllib2.py", line 418, in _open

'_open', req)

File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain

result = func(*args)

File "/usr/lib/python2.7/urllib2.py", line 1215, in https_open

return self.do_open(httplib.HTTPSConnection, req)

File "/usr/lib/python2.7/urllib2.py", line 1174, in do_open

h.request(req.get_method(), req.get_selector(), req.data, headers)

File "/usr/lib/python2.7/httplib.py", line 958, in request

self._send_request(method, url, body, headers)

File "/usr/lib/python2.7/httplib.py", line 992, in _send_request

self.endheaders(body)

File "/usr/lib/python2.7/httplib.py", line 954, in endheaders

self._send_output(message_body)

File "/usr/lib/python2.7/httplib.py", line 814, in _send_output

self.send(msg)

File "/usr/lib/python2.7/httplib.py", line 776, in send

self.connect()

File "/usr/lib/python2.7/httplib.py", line 1157, in connect

self.timeout, self.source_address)

File "/usr/lib/python2.7/socket.py", line 553, in create_connection

for res in getaddrinfo(host, port, 0, SOCK_STREAM):

KeyboardInterrupt

build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/blade2/cm.mk]]: "frameworks/base/build/phone-hdpi-512-dalvik-heap.mk" does not exist. Stop.

** Don't have a product spec for: 'cm_blade2'

** Do you have the right repo manifest?

No such item in brunch menu. Try 'breakfast'

android@android-builder:~/android/source/cm10/device/zte$

I get the same if I try running brunch from other folders

Edited by PsYcHoKiLLa
Link to comment
Share on other sites

Guest PsYcHoKiLLa
android@android-builder:~/android/source/cm10$ . build/envsetup.sh

including device/generic/armv7-a-neon/vendorsetup.sh

including device/generic/armv7-a/vendorsetup.sh

including device/ti/panda/vendorsetup.sh

including device/zte/blade2/vendorsetup.sh

including vendor/cm/vendorsetup.sh

including sdk/bash_completion/adb.bash

android@android-builder:~/android/source/cm10$ croot

android@android-builder:~/android/source/cm10$ brunch cm_blade2-userdebug

including vendor/cm/vendorsetup.sh

build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/blade2/cm.mk]]: "frameworks/base/build/phone-hdpi-512-dalvik-heap.mk" does not exist. Stop.

Device blade2 not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).

Nope, still get the same, never mind, it's maybe cos I'm trying to do CM10. I'll just wait for your next build.

Edited by PsYcHoKiLLa
Link to comment
Share on other sites

Guest tilal6991

You cloned the ics branch. Do:

cd device/zte/blade2

git branch jellybean --track origin/jellybean

croot

And then brunch again

Link to comment
Share on other sites

Guest PsYcHoKiLLa

lol not having much luck at all...

android@android-builder:~/android/source/cm10/device/zte/blade2$ git branch jellybean --track origin/jellybean

fatal: Not a valid object name: 'origin/jellybean'.

android@android-builder:~/android/source/cm10/device/zte/blade2$

Link to comment
Share on other sites

  • 2 months later...
  • 3 weeks later...

I could build Cm9 from source, without any problem, but I can't compile for the vivacity configuration, even if I do "export P736E=1" before . build/envsetup.sh or brunch, why is this ?

Link to comment
Share on other sites

When I want to init the Coldfusion x repos, like the readme on your github says, it just tells me "repository not found" and I can't sync, do you know.

I am runnin Ubuntu 12.10 64 bit, I also tried it on 12.04 and it doesn't work there either, do you have any clue why ? This is the only thing that happens after "repo init -u git://github.com/ColdFusionX/android.git -b jellybean"

"fatal: remote error:

Repository not found.

fatal: remote error:

Repository not found.

fatal: cannot obtain manifest git://github.com/ColdFusionX/android.git"

Link to comment
Share on other sites

  • 4 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.