Jump to content

Building CyanogenMod7


Guest fonix232

Recommended Posts

Guest fonix232

So, you think you can help! Or, you don't want to wait for Tom G to upload his latest build (I understand although I like his builds better).

As the source tree is public now, you can easily build CM7 on your PC!

I. Requirements

- Decent machine (dual-core CPU and at least 2GB of RAM)

- at least 10GB of free space

- Ubuntu 10.10

- Applications:

-- For 32&64bit systems:

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
-- For 64bit only:
g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib
WARNING! On Ubuntu 10.10, you need to add the partner repo:
sudo add-apt-repository "deb http://archive.canonical.com/ maverick partner"

sudo apt-get update
- Repo The main multi-git checkout system of Google. Manages huge lists of repositories as one. To install it:
  1. Open a superuser terminal (either from menu, or by typing "sudo bash" into a terminal
  2. Type "curl http://android.git.kernel.org/repo > /bin/repo" to acquire the latest repo launcher
  3. Type "chmod a+x /bin/repo" to give the launcher run capabilities
You're done! II. Acquiring the source code To download the source code, you already got repo. So now, we will open a new sudo terminal (see a bit back) and checkout the source to the root partition (somewhy when I've tried to check out to manually mounted partitions, it always failed). To do so, enter these lines to the terminal (these will create a directory "cm7" in your home directory, e.g. /home/[username]/cm7):
mkdir cm7


cd cm7


repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
Now, we initialized the repo to this folder. And now, prepare some sandwiches and coffee to your PC, the download will take a loooooong time :P
repo sync -j16
(The j16 addon is needed to pre-initialize 16 projects, it is a bit faster and you know what will come) There are at this time 216 packages, some of them small (mostly the applications) or huge (prebuilt binaries, device trees). When the sync is done, you need to add the ZTE Blade device tree to the source. The device tree is maintained by Tom G (actually, he made it work, if you didn't know, all credits for the main releases goes to him and to anyone who contributed to the tree), if you accidentally talk with him, at least don't spare a simple "thanks" :D So, to get the device tree...
git clone git://github.com/TomGiordano/android_device_zte_blade.git device/zte/blade
As soon as it's done, set it up :huh: III. Setting up the device tree For given copyright stuff, we can't include some libraries, binaries in the device tree directly, but they are needed for building. So, you will need them from a device. Best choice is installing the latest CM7 build of Tom, and using that as a source. Now, to set up the device tree, you need your phone connected to your PC in debug mode (if you don't know what debug mode is, why are you here?? If you don't know how to enable debug mode over USB under Ubuntu, read here). Let's get back to that sudo terminal! Type
cd device/zte/blade

./extract-files.sh
to the terminal, assuming that you're still in the CM7 root directory (/home/[username]/cm7/). This will grab all needed files from your phone. With this, you finished setting up the tree. III.a Getting RomManager If you're building for the first time, you may need to grab the latest RomManager. To do so, run this command from terminal:
~/cm7/system/vendor/cyanogen/get-rommanager
IV. Building the source Building is the final and easiest part. In the sudo terminal, go back to CM7 root
cd ~/cm7
And now let's collect all devices in the source!
source build/envsetup.sh
This command will list all discovered devices. Next step is, to select the build you want to make. For this, type
lunch
in the terminal! This will bring up a list with a lot of devices. We specifically need the ones beginning with zte_blade-*! Usually I like to build the eng version (meaning engineer version), but you can of course try the userdebug one too! To select the device, look at the name, and get the number of it (in my case, zte_blade-eng's number is 34). Then type that and press enter. It will set up the environment to build CM7 for the Blade. After that, you only need to execute the following command:
make -j[n] bacon

Replace [n] with the number of your CPU's cores!

This will take some time, but after the first build, it will be a lot faster!

After the build, you can find the output at ~/cm7/out/target/product/blade/, called update.cm-XXXX-signed.zip. Put it on your SD card, and flash from Recovery.

If you want Google Apps, download the CM7 version from here.

Edited by fonix232
Link to comment
Share on other sites

Guest fonix232

Appendix A

Keeping your source up-to-date

To keep your source up-to-date, every time before you build it, do a repo sync from the root of CM7, and a git pull in the device tree:

cd ~/cm7

repo sync

cd device/zte/blade

git pull
After that, do Step IV. again! Appendix B Keeping your files up-to-date This step comes just after Appendix A. When you update the device tree you can't know if anyone added a required file or not. So, you have to run the extract-files script again:
cd ~/cm7/device/zte/blade

./extract-files.sh

This way you can ensure you're totally fresh :P

Edited by fonix232
Link to comment
Share on other sites

Guest fonix232
Will this Work in any Debian Based enviroment e.g. Debian Squeeze?

This tutorial is directly for Ubuntu Linux 10.10 (mostly x64). I have not tested it on any other environment, so I can't guarantee it will work.

Link to comment
Share on other sites

Guest Pierg75

Thanks!!

This is exactly what I really needed to start to compile myself the android system

About Debian, I'm just downloading all the sources and let's see if it will work :P

Link to comment
Share on other sites

Guest Pierg75

Just ended now my first attempt.

I have the get-rommanager in this path:

cm7/vendor/cyanogen/get-rommanager

and not

cm7/system/vendor/cyanogen/get-rommanager

Apart this, I'm trying to compile the image...it shouldn't take too long

Link to comment
Share on other sites

Guest whatcolour
Yes. and yes it is slow, but that's because 1X projects are all being synced...

great! is the white screen bug sorted? and any general speed-up in ui performance? would be great if you can share your own build :-)

Link to comment
Share on other sites

Guest Pierg75

First problem:

make: *** No rule to make target `vendor/zte/blade/proprietary/reg_code', needed by `out/target/product/blade/system/wifi/regcode'. Stop.

make: *** Waiting for unfinished jobs....

Searched for that file, but without clue.

Link to comment
Share on other sites

Guest punkmilitia
great! is the white screen bug sorted? and any general speed-up in ui performance? would be great if you can share your own build :-)

TBH. it is better than r2 by a small bit, but all in all it is best for TOM G to release his official updates instead of me simply compiling the source and handing it out, would be quite silly really.. sorry

Link to comment
Share on other sites

Guest whatcolour
TBH. it is better than r2 by a small bit, but all in all it is best for TOM G to release his official updates instead of me simply compiling the source and handing it out, would be quite silly really.. sorry

Thanks for the info. re: sharing the rom, I totally understand where you're coming from :-)

EDIT: alright, just finished building mine as well, used unzip-files.sh instead to extract from a de-crossed rom with saunalahti ril

Edited by whatcolour
Link to comment
Share on other sites

Guest dannejo
First problem:

make: *** No rule to make target `vendor/zte/blade/proprietary/reg_code', needed by `out/target/product/blade/system/wifi/regcode'. Stop.

make: *** Waiting for unfinished jobs....

Searched for that file, but without clue.

Mine also stops with same error.. :P

Link to comment
Share on other sites

First problem:

make: *** No rule to make target `vendor/zte/blade/proprietary/reg_code', needed by `out/target/product/blade/system/wifi/regcode'. Stop.

make: *** Waiting for unfinished jobs....

Searched for that file, but without clue.

Is that a typo or are there really 2 forms reg_code and regcode?

It's easy enough to fix, either fix the type if that's causing the issue or check that extract_files.sh/unzip_files grab it from your phone/rom or remove it from the copy steps - I'd try the first option since it may well be needed, I think it tells the wifi driver which region you are in and there fore what wifi frequencies can legally be used.

Edited by rjm2k
Link to comment
Share on other sites

Is anybody controlling a single project with allocated work to team members?

or is this a free for all to see who can build it the quickest? ;o)

At the moment i think it's pretty much a free for all still, hopefully once/if this becomes an official cyanogen build it will come under more control with access and code reviews for others to add to.

Link to comment
Share on other sites

Guest Pierg75
Is that a typo or are there really 2 forms reg_code and regcode?

It's easy enough to fix, either fix the type if that's causing the issue or check that extract_files.sh/unzip_files grab it from your phone/rom or remove it from the copy steps - I'd try the first option since it may well be needed, I think it tells the wifi driver which region you are in and there fore what wifi frequencies can legally be used.

Actually yesterday night I got it working changing the name in reg_code (or regcode I don't remember now).

Anyway I got a update.zip but, after flash it, the phone went into a reboot loop.

Later I'll probably give it another try.

Link to comment
Share on other sites

Guest paulgdp

Hi,

I post here my experience while building this rom. I hope that some informations will help people to build the rom, but in the end my final rom doesn't work (the phone keeps rebooting in clockmodwork)

First I describe you my building environment :

I'm using Debian Sid 32 bits for my day to day work, but for my first try compiling cyanogenmod, I wanted to follow as close as possible the tuto so I created a ubuntu 10.10 64bits chroot.

You can do this with theses commands under any linux distributions (You just need to have deboostrap installed) with a 64bits linux kernel (so you can do this on a 32bits user space system with a 64bit kernel).

All the commands are done in root

# mkdir ubuntu

# debootstrap --arch=amd64 --variant=buildd --verbose maverick ubuntu

# mount procfs -t proc ubuntu/proc/

# mount sysfs -t sysfs ubuntu/sys/

# mount -o bind /dev ubuntu/dev/

# mount -o bind /dev/pts/ ubuntu/dev/pts/

# chroot ubuntu

Then, I followed the instructions of the tutorial, but I just want to add that you must add the partner repository BEFORE installing the packages to have sun-java6 installed.

Everything worked except for the extract-file part.

I had the same problem as Pierg75 and dannejo (I use JJ9 which must miss some files), so I used unzip-file.sh to extract the file from some zipped rom. (BTW the script has some typo problem, I give you a corrected one on my ftp).

I tried to extract the file from differents roms (cyanogen_blade-ota-cm7-beta2.zip, r0.2_update_de-crossed_blade_signed.zip, flb-froyo-blade-r8a.zip and Japanese_Jellyfish_RLS9.zip) but none of them had all the required files...

So I've done a mix of all of them using this priority: cyanogen_blade-ota-cm7-beta2.zip > r0.2_update_de-crossed_blade_signed.zip > flb-froyo-blade-r8a.zip > Japanese_Jellyfish_RLS9.zip.

I also give you the resulted directory containing all the proprietary files on my ftp.

And then I successfully compiled the rom (which is also on the ftp), then flashed it on my phone (I formated /boot /system /data and /cache), but it doesn't work.

The phone stay 1 minute on the ZTE blade splash screen and then reboot on clockworkmod recovery..

Here are all the files I was speaking about: http://paulgrandperrin.free.fr/android/

Do you have any ideas why the rom is not booting?

And btw thanks to everyone involved in custom rom development for the zte!

Link to comment
Share on other sites

Guest Pierg75
And then I successfully compiled the rom (which is also on the ftp), then flashed it on my phone (I formated /boot /system /data and /cache), but it doesn't work.

The phone stay 1 minute on the ZTE blade splash screen and then reboot on clockworkmod recovery..

Do you have any ideas why the rom is not booting?

I have the same problem.

Installed the new rom, stays for some secs on the green android screen and them reboot into recovery mode.

I used a clean (not really :P ) debian 64bit machine to build the image without setting up a temp ubuntu installation.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

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