Jump to content


Photo

[GUIDE] Compiling CyanogenMod 9 for the ZTE Crescent

- - - - -

  • Please log in to reply
20 replies to this topic

#1
Dazzozo

Dazzozo

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 3,319 posts
  • Gender:Male
  • Location:York, UK
  • Devices:Crescent, G300, Y300, Nexus 5
  • Twitter:@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
(Had to code tag this one as MoDaCo shortened it as a link...)

Syncing

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

mkdir -p ~/android/source/cm9
cd ~/android/source/cm9
repo init -u git://github.com/CyanogenMod/android.git -b ics
repo sync -j4

This'll take a while as you're downloading the whole Android source and history. Once done, I'd run repo sync 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 repo sync 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; cd ~/android/source/cm9/.repo/

This is my manifest, and I doubt you'll have anything to change. You just save this to local_manifest.xml within the .repo directory.

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


Run repo sync again and you'll also notice it pulling these repos. Pretty much done by this point, you'll want to go to ~/android/source/cm9/vendor/cm and run ./get-prebuilts 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.)

Building

You're ready to build - though it doesn't hurt to throw in another repo sync.

From the CM9 folder, in my example, ~/android/source/cm9/, you want to run . build/envsetup.sh which initialises the environment for building. Once you've done this, run brunch cm_blade2-userdebug 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 rm -rf out/target 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!

  • 4
Like my work? Give me rep!

Like my work a lot? Donate! Remember to leave your forum name if you want to be credited!

#2
MadEye Moody

MadEye Moody

    Enthusiast

  • Members
  • PipPipPip
  • 268 posts
  • Gender:Male
  • Location:India
  • Devices:ZTECrescent, Nexus 4
  • Twitter:@renjithis
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

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, 26 July 2012 - 03:15 PM.

  • 0
Shell script to trim down ROMs (tested on CM9 and CM10) : https://www.dropbox..../zip_trimmer.sh

Shell script (cron ready) to automate syncing, compiling and trimming(requires zip_trimmer.sh) CyanogenMod (currently for CM10, with just a few modifications, will work with CM9 source) : https://www.dropbox....htly_release.sh

#3
PsYcHoKiLLa

PsYcHoKiLLa

    Addict

  • Members
  • PipPipPipPipPip
  • 803 posts
  • Gender:Male
  • Devices:LG Nexus 4, Tesco Hudl
  • Twitter:@djsubterrain
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....5e/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, 23 July 2012 - 09:08 PM.

  • 0

#4
Dazzozo

Dazzozo

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 3,319 posts
  • Gender:Male
  • Location:York, UK
  • Devices:Crescent, G300, Y300, Nexus 5
  • Twitter:@Dazzozo
Most of the guide is copy pasted from a PM sent a few weeks ago, so yeah the method has probably changed.

  • 0
Like my work? Give me rep!

Like my work a lot? Donate! Remember to leave your forum name if you want to be credited!

#5
PsYcHoKiLLa

PsYcHoKiLLa

    Addict

  • Members
  • PipPipPipPipPip
  • 803 posts
  • Gender:Male
  • Devices:LG Nexus 4, Tesco Hudl
  • Twitter:@djsubterrain
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.

  • 0

#6
Dazzozo

Dazzozo

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 3,319 posts
  • Gender:Male
  • Location:York, UK
  • Devices:Crescent, G300, Y300, Nexus 5
  • Twitter:@Dazzozo
That's default on a lot of systems, strange.

  • 0
Like my work? Give me rep!

Like my work a lot? Donate! Remember to leave your forum name if you want to be credited!

#7
PsYcHoKiLLa

PsYcHoKiLLa

    Addict

  • Members
  • PipPipPipPipPip
  • 803 posts
  • Gender:Male
  • Devices:LG Nexus 4, Tesco Hudl
  • Twitter:@djsubterrain
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, 24 July 2012 - 03:17 PM.

  • 0

#8
Dazzozo

Dazzozo

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 3,319 posts
  • Gender:Male
  • Location:York, UK
  • Devices:Crescent, G300, Y300, Nexus 5
  • Twitter:@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

  • 0
Like my work? Give me rep!

Like my work a lot? Donate! Remember to leave your forum name if you want to be credited!

#9
PsYcHoKiLLa

PsYcHoKiLLa

    Addict

  • Members
  • PipPipPipPipPip
  • 803 posts
  • Gender:Male
  • Devices:LG Nexus 4, Tesco Hudl
  • Twitter:@djsubterrain
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.c.../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, 25 July 2012 - 04:04 PM.

  • 0

#10
Dazzozo

Dazzozo

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 3,319 posts
  • Gender:Male
  • Location:York, UK
  • Devices:Crescent, G300, Y300, Nexus 5
  • Twitter:@Dazzozo
You don't run brunch from the device or manufacturer, you run it from croot.

  • 0
Like my work? Give me rep!

Like my work a lot? Donate! Remember to leave your forum name if you want to be credited!

#11
PsYcHoKiLLa

PsYcHoKiLLa

    Addict

  • Members
  • PipPipPipPipPip
  • 803 posts
  • Gender:Male
  • Devices:LG Nexus 4, Tesco Hudl
  • Twitter:@djsubterrain

You don't run brunch from the device or manufacturer, you run it from croot.


Huh? Where is that?

  • 0

#12
Dazzozo

Dazzozo

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 3,319 posts
  • Gender:Male
  • Location:York, UK
  • Devices:Crescent, G300, Y300, Nexus 5
  • Twitter:@Dazzozo
Just type croot. It's a command added to your environment when you run . build/envsetup.sh.

  • 0
Like my work? Give me rep!

Like my work a lot? Donate! Remember to leave your forum name if you want to be credited!

#13
PsYcHoKiLLa

PsYcHoKiLLa

    Addict

  • Members
  • PipPipPipPipPip
  • 803 posts
  • Gender:Male
  • Devices:LG Nexus 4, Tesco Hudl
  • Twitter:@djsubterrain

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, 25 July 2012 - 05:02 PM.

  • 0

#14
tilal6991

tilal6991

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 3,781 posts
  • Gender:Male
  • Devices:ZTE Skate, Huawei U8150
You cloned the ics branch. Do:
cd device/zte/blade2
git branch jellybean --track origin/jellybean
croot

And then brunch again

  • 0
If you like my work or if I helped, click the Plus button.

#15
PsYcHoKiLLa

PsYcHoKiLLa

    Addict

  • Members
  • PipPipPipPipPip
  • 803 posts
  • Gender:Male
  • Devices:LG Nexus 4, Tesco Hudl
  • Twitter:@djsubterrain
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$


  • 0

#16
Dazzozo

Dazzozo

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 3,319 posts
  • Gender:Male
  • Location:York, UK
  • Devices:Crescent, G300, Y300, Nexus 5
  • Twitter:@Dazzozo
You'll have to adjust it in the local_manifest and sync.

Only the props need to be on ics, the device is now on jellybean.

  • 0
Like my work? Give me rep!

Like my work a lot? Donate! Remember to leave your forum name if you want to be credited!

#17
gbosh

gbosh

    Diehard

  • Members
  • PipPipPipPip
  • 432 posts
  • Gender:Male
  • Location:Germany
  • Devices:ZTE Atlas W (Vivacity)
How can I compile it with the TMV configuration ?

  • 0

#18
gbosh

gbosh

    Diehard

  • Members
  • PipPipPipPip
  • 432 posts
  • Gender:Male
  • Location:Germany
  • Devices:ZTE Atlas W (Vivacity)
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 ?

  • 0

#19
gbosh

gbosh

    Diehard

  • Members
  • PipPipPipPip
  • 432 posts
  • Gender:Male
  • Location:Germany
  • Devices:ZTE Atlas W (Vivacity)
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"

  • 0

#20
NovaPunch

NovaPunch

    Newbie

  • Members
  • Pip
  • 3 posts
  • Devices:ZTE Crescent
Are there still devs working on ICS and JB builds for the TV? Or has it gone dead?

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users