[HTC ChaCha] lucasarran:
Welcome to the tutorial for build CyanogenMod 10 for the HTC ChaCha. This tutorial was a community based project from HTC ChaCha’s Google+. We created this tutorial to try and boost the development of the HTC ChaCha board and bring some life back to the board.

​

Requirements:

Linux System x64 (Ubuntu 12.04 and newer can be used)

Mac OS X can also be used, however this tutorial is designed for Linux users.

Python 2.6 -- 2.7, which you can download from python.org or with sudo apt-get install python on Ubuntu or Debian.

GNU Make 3.81 -- 3.82, which you can download from gnu.org or with sudo apt-get install make on Ubuntu or Debian.

JDK 6 (Can be found at Ubuntu Software Centre or read details in Build Environment for detailed instructions)

Git 1.7 or newer. You can find it at git-scm.com or with sudo apt-get install git-core on Ubuntu or Debian.

Good amount of RAM, less you have longer it will take to build. I recommend a 2GB and higher.

A decent ISP which provides a fast, reliable connection(so you don't timeout during a large pull of source)

Setting up a Build Environment

Follow this guide: http://source.android.com/source/initializing.html

​

Installing Repo

Repo is a tool that makes it easier to work with Git and Gerrit in the context of Android. To learn more about Repo and Gerrit, see Version Control.

To install, initialize, and configure Repo, follow these steps:

Make sure you have a bin/ directory in your home directory, and that it is included in your path:

$ mkdir ~/bin
$ export PATH=${PATH}:~/bin

Alternatively, experienced Linux users may wish to add PATH=${PATH}:~/bin to ~/.bashrc to avoid re-typing the export command.

Download the Repo script and ensure it is executable:

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

Initializing a Repo client

After installing Repo, set up your client to access the android source repository

Create an empty directory to hold your working files, please note that Linux’s files system is case-sensitive so uppercase letters matter. Give it any name you like, we’ve used WORKING_DIRECTORY for a quick example:

$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY

Run repo init to bring down the latest version of Repo with all of its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory and where to download them from. The manifest will update automatically when minor versions of Android are released (4.1.x) but not when major versions are (4.X). A major version can only be changed by selecting the new branch codename with the -b flag bellow.

$ repo init -u git://github.com/CyanogenMod/android.git -b jellybean

When prompted, please configure Repo with your real name and email address. To download AOSP material, you will need an email address that is connected with a registered Google account. Make sure this is a live address at which you can receive messages as the name that you provide here will show up in attributions for your code submissions. You won’t get any messages if you don’t submit any code.

A successful initialization will end with a message stating that Repo is initialized in your working directory. Your client directory should now contain a .repo directory where files such as the manifest will be kept.

Getting the files

To pull down files to your working directory from the repositories as specified in the default manifest, run

$ repo sync -j8 WORKING_DIRECTORY

Note: The “-j8” is dependent on your internet connection. If you have a slower and fragile then use a lower number like “j2” for example.

The Android source files will be located in your working directory under their project names. The initial sync operation will take an hour or more to complete. For more about repo sync and other Repo commands, see Version Control.

The repo sync operation will take a lot of time (JB source are about 14 GB!). Make sure no other people will be using your system and then pull the source, recommend pulling during the night. However if your source does get interrupted then you can continue the source pulling by running the command again, however this is not recommended.

Using authentication

By default, access to the Android source code is anonymous. To protect the servers against excessive usage, each IP address is associated with a quota.

When sharing an IP address with other users (e.g. when accessing the source repositories from beyond a NAT firewall), the quotas can trigger even for regular usage patterns (e.g. if many users sync new clients from the same IP address within a short period).

In that case, it is possible to use authenticated access, which then uses a separate quota for each user, regardless of the IP address.

The first step is to create a password from the password generator and to save it in ~/.netrc according to the instructions on that page.

The second step is to force authenticated access, by using the following manifest URI:

[url]https://android.googlesource.com/a/platform/manifest[/url]

Notice how the /a/ directory prefix triggers mandatory authentication.

You can convert an existing client to use mandatory authentication with the following command:

$ repo init -u [url]https://android.googlesource.com/a/platform/manifest[/url]

​

To build for the HTC ChaCha you will need to include the specific repository’s for the device. This includes the device files, vendor files and other important repos which are needed:

Note: The maintainer of the source is adlx, feel free to fork the projects (if you need to modify them), but if you fix bugs, please submit a pull request (via Github). To clone the project locally on your hard-drive and modify locally you don’t need to either register at Github nor fork the repos.

Open a terminal (Ctrl+Alt+T) and run the following lines:

$ cd WORKING_DIRECTORY
$ wget -O .repo/local_manifest.xml
[url]https://github.com/adumont/android_device_htc_chacha/blob/jellybean/extra/local_manifest.xml[/url]
$ repo sync -j8 -c

This will download the needed additional repositories to build Jellybean (CM10) for the HTC ChaCha.

​

Once you're all set up we can start building. If you're not already in the Terminal, open it up again and navigate to your working directory. Run these following commands to start compiling!

$ . build/envsetup.sh
$ lunch cm_chacha-eng
$ mka bacon

Note: Where “x” is, number how many jobs you want the compile to complete in a second. Remember that this is dependent on your machine. If you have a low spec computer use “-j1” for example.

This last sentence will initiate the build process, which can take several hours depending of your hardware configuration. Once complete the build system will display where the flashable item is stored. Commonly the file can be found below.

$ cd out/target/product/chacha/
$ ls *.zip

​

Troubleshooting network issues

When downloading from behind a proxy (which is common in some corporate environments), it might be necessary to explicitly specify the proxy that is then used by repo:

$ export HTTP_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>
$ export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>

NOTE: Rarely, Linux clients experience connectivity issues, getting stuck in the middle of downloads (typically during "Receiving objects"). It has been reported that tweaking the settings of the TCP/IP stack and using non-parallel commands can improve the situation. You need root access to modify the TCP setting:

$ sudo sysctl -w net.ipv4.tcp_window_scaling=0
$ repo sync -j1

E: Your download during the source pulling stopped or it got interrupted. What’s should I do?

A: Use the same command “repo sync” and your download will be resumed. However the will be a small chance of corruption depending on your situation.

E: make: *** No rule to make target `#######', needed by `out/target/product/chacha/obj/SHARED_LIBRARIES/######'. Stop.

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

A: Usually this occurs when you have an incorrect file or a corrupted file (which can’t be found) which ChaCha device folder is requesting. Use CyanogenMod’s Github to find the correct file or find it using Google.

Question and Answers

What if I don’t want to build CyanogenMod?

You don’t have to. It is possible to build AOKP, Paranoid Android and so on for the HTC ChaCha. Apart from you need to work through the issues and errors. How to build AOKP will be added to this tutorial soon.

My build has some issues!

Report your issue on this thread and someone may help you. If your not receiving support then use Google or the fancy search bar in XDA.

I’ve got a successful build, what shall I do now?

Congratulations. Post your build on this thread or post to the ChaCha Google+ Community and we can test your ROM out. If you feel like you want some more advance work then continue forward to build AOKP, Paranoid Android and so on. The ChaCha community is needing ROMs you can help!

This project was set-up by the HTC ChaCha community on Google+. This was an open document which members of the community contributed to. All known people who have added to the document is listed below.

Google’s Android Open Source Project (Based of documentation)

Adlx (Created main instructions)

LucasArran (Editor)

Benjamin Gwynn (Proff-read and helped)

And all other members from the ChaCha Community!​