Wanted to make this guide earlier but you know, life stuff gets in the way
What this guide does is show you how you can use cyanogenmod sources to build your own roms, now a few things to clear before you do anything.
A) Things to know
- Cyangenomod sources are big, as in 11GB download by my last count, and after that several files are created by repo to keep the sources in sync with git and those files accounts for 15GB of additional space, so in total, cyanogenmod source folder is 26GB in my hard drive right now.
- ZTE Racer Gen1 or Gen2 isn't officially supported by Cyanogenmod team, not even unofficially, there's no Cyangenomod Kang for ZTE Racer, so don't expect support from cyanogenmod team
- Compilation time depends on the hardware you have, mine isn't fancy (Core 2 Duo 3GHz, 4GB Ram) and it takes 40 minutes to make a rom (afaik, the estimated times for builds are between 30 to 90 minutes)
- With this guide you'll get a barebone cyanogenmod rom, want ICS looks? MUI mod, blablabla ... that have to be added after building the rom (you have to cook it)
- All you're about to see is how "I" do it, while I don't think others differ much from what I do, a few things can be done differently.
- You'll need Linux and while you don't have to be a guru, some knowledge of linux usage will help, I've tested this on ubuntu and fedora (latest versions).
- You'll need a file with udev rules so adb can recognize your device (this will be needed later), create a file named 51-android.rules with this content: SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", MODE="0666", GROUP="plugdev" and put it in /etc/udev/rules.d and restart the system (restarting udev only doesn't work most of the time :-\). Sample file here.
- You'll need a working zte racer already
- Have your prefered kernel (deadlink or vamshi) and your prefered rom in the root of your sdcard in case something goes wrong
- HAVE A NANDROID BACKUP in case something goes really really wrong!
- Use this guide at your own risk!!!
B ) Build the rom
Let's start!
1) First you'll need Cyanogenmod Sources, for that read Cyanogenmod Build ZTE Blade wiki untill you get to the part "Copy Propietary Files". (meaning, after repo sync -j16 you'll have the sources needed)
2) Using the console go to ~/android/system (or whatever you named the dir with the cm sources) and execute sh vendor/cyanogen/get-rommanage otherwise cyanogenmod won't build
3) Now, go to elgomes github and download a zip from that and extract it. What's important from those files are the ones in the "vendor" folder, and you have two options, number one is to copy "vendor" folder from elgomes files you just downloaded and paste it in ~/android/system and answer yes when it ask to merge/replace files. The other option is to modify cyanogenmod's files to match what you get from elgomes repo.
4) Now go to this github repo and download a zip from that and extract it. You'll end up with several files. From a console, go to ~/android/system, execute mkdir -p device/zte/mooncake and copy all the files you extracted to the folder ~/android/system/device/zte/mooncake you just created.
5) Connect your phone to the PC with the usb cable and make sure you can access it with android's adb. Execute adb devices and if it shows something like this you're good to go:
List of devices attached mooncake device
(if it says something different from "mooncake" like Racer or a number, that's ok as well)
5-1) If adb isn't detecting your device make sure you have put the .rules file for udev
6) In the console, go to ~/android/system/device/zte/mooncake and execute sh extract-files.sh this will copy several files needed from your device that can't be compiled from sources (either because the sources doesn't work or because there are no sources!
➜ mooncake sh extract-files.sh 274 KB/s (24032 bytes in 0.085s) 1005 KB/s (107992 bytes in 0.104s) 960 KB/s (108924 bytes in 0.110s) 40 KB/s (3327 bytes in 0.080s) 1176 KB/s (79780 bytes in 0.066s) 4438 KB/s (1812980 bytes in 0.398s) 1872 KB/s (162912 bytes in 0.084s) 1609 KB/s (210640 bytes in 0.127s) 688 KB/s (38412 bytes in 0.054s) 13 KB/s (1156 bytes in 0.080s) 110 KB/s (9220 bytes in 0.081s) 3425 KB/s (900432 bytes in 0.256s) 122 KB/s (10268 bytes in 0.081s) 379 KB/s (17904 bytes in 0.046s) 909 KB/s (93004 bytes in 0.099s) 814 KB/s (86708 bytes in 0.103s) 290 KB/s (25752 bytes in 0.086s) 60 KB/s (5008 bytes in 0.080s) 157 KB/s (13336 bytes in 0.082s) 2003 KB/s (185892 bytes in 0.090s) 647 KB/s (66844 bytes in 0.100s) 553 KB/s (54364 bytes in 0.095s) 512 KB/s (50364 bytes in 0.095s) 1157 KB/s (78940 bytes in 0.066s) 606 KB/s (62660 bytes in 0.100s) 679 KB/s (37856 bytes in 0.054s) 286 KB/s (25784 bytes in 0.087s) 884 KB/s (94036 bytes in 0.103s) 110 KB/s (9260 bytes in 0.081s) 3580 KB/s (486712 bytes in 0.132s) 1381 KB/s (164428 bytes in 0.116s) 2457 KB/s (576104 bytes in 0.228s) 289 KB/s (26052 bytes in 0.087s) 695 KB/s (71704 bytes in 0.100s) 2947 KB/s (590316 bytes in 0.195s) 725 KB/s (38376 bytes in 0.051s) 246 KB/s (22160 bytes in 0.087s) 707 KB/s (38372 bytes in 0.052s) 700 KB/s (38376 bytes in 0.053s) 1307 KB/s (168032 bytes in 0.125s) 482 KB/s (46856 bytes in 0.094s) 627 KB/s (38396 bytes in 0.059s) 442 KB/s (42496 bytes in 0.093s) 332 KB/s (30148 bytes in 0.088s) 443 KB/s (42548 bytes in 0.093s) 1398 KB/s (186916 bytes in 0.130s) 1504 KB/s (190608 bytes in 0.123s) 368 KB/s (17636 bytes in 0.046s) 243 KB/s (21900 bytes in 0.087s) 113 KB/s (9412 bytes in 0.081s) 1477 KB/s (197192 bytes in 0.130s) 1128 KB/s (134812 bytes in 0.116s) 904 KB/s (97548 bytes in 0.105s) 817 KB/s (88164 bytes in 0.105s) 1136 KB/s (134204 bytes in 0.115s) 661 KB/s (68028 bytes in 0.100s) 831 KB/s (89668 bytes in 0.105s) 709 KB/s (39592 bytes in 0.054s) 288 KB/s (25916 bytes in 0.087s) 61 KB/s (5136 bytes in 0.081s) ➜ mooncake
7) In the console, go to ~/android/system and execute . build/envsetup.sh (Notice there's a dot and a space before "build", but you can use sh build/envsetup.sh or bash build/envsetup.sh or source build/envsetup.sh, whatever works for you guys)
8) In the console, go to ~/android/system (you should be already there) and execute brunch mooncake
9) Go for coffe or something, as I said, it'll take a while.
After the build is done, if there are no errors, you'll have a .zip in the folder out/target/product/mooncake with the rom (named Cyangenomod-something-KANG.zip or similar, that name is defined in ~/android/system/vendor/cyanogen/products/cyanogen_mooncake.mk)
Now, the rom you have build can be flashed with cwm, however it won't boot unless you also flash a kernel for zte racer (either deadlink's or vamshi's, that's why I told you earlier to have it in the root of your sdcard). Thing is, "kernel" in device/zte/mooncake folder is for blade phones, you could change it with another racer compatible kernel image however a kernel image is somewhat tied to ramdisk contents so if you only change the kernel image with a default ramdisk it might not boot, thus is prefered to just flash one of the available working kernels which already include a compatible ramdisk.
You're Done!
At least at this point you should a rom that boots without issues and have a working phone (I use a rom build using cyanogen sources with those steps so I know that if you've done everything correctly it should work.)
C) Tips, semi knowledge base and other stuff
- If you take the time to read mooncake files you'll notice a few things like BUILD_VOLD := false and BUILD_VOLD2 := false or BUILD_NETD := false. The reason for this is that you can actually build vold (either version 1 or 2) from sources successfully however it won't work, it won't allow you to mount the sdcard as removable storage when you connect the phone to the PC. If you don't know what vold is, read here. Netd is a similar thing, you can build it successfully from sources but it'll hang the boot because incompatible definitions of dsnproxy subsystem. The exact reasons for why this two things doesn't work correctly are unknown to me, I mean, reading lines and lines of C code, debugging and such takes time and a lot of testing, I started to do it at one point but you won't believe how difficult is to find documentation sometimes when something is going wrong. Relevant xkcd comic.
- RacerParts is a utility package made by deadlink, kinda to keep in sync with blade files (BladeParts, CMParts...), as of right now the most notable thing this offers is hard keys lights. You know, call/end call lights. Many have asked if this can be turned on, why are they turned off and such, and well, is turned off in the kernel the reason is to conserve battery life so not a bug but a feature!
- Not a lot of documentation and support when things doesn't work as expected so if you get at some point stuck trying to integrate your super uber modification during cyanogenmod builds all I can say is that I know your pain and wish you the best of lucks!
- For those thinking "hmmm maybe if I build my rom I can do something about the damn calibration!
- Cooking will help you improve your recently build rom, many things can be modified directly without uncompressing the zip file (using winrar or 7zip), others will require you to extract the rom (I use dsixda's kitchen for the rom, and racer kitchen2 for kernel images), related to porting however I don't know much about that stuff, only that it requires modifying framework-res.apk and systemUI. Others might give you tips on that, just ask.
Acknowledgements
I'm not that smart so many had to help me directly or indirectly to get this thing working, so thanks to:
Google (not only for android but for his search engine as well xD), CyanogenMod team, deadlink, equiliym, racerboy, vamshi, tigex, rickywatt, sebastian404 and many others here at modaco (while many don't even own a racer anymore their posts help me a lot while researching), xda-developers forum, elgomes github owner, 4pda forums and modaco forums for still keeping a section dedicated to my zte
Peace out!
Edit:// Corrected typos, grammar, wording and the like
Edited by GuyOverThere, 20 October 2012 - 04:31 PM.







Sign In
Create Account

Back to top











