[myTouch 4G General] matada:
Compiling CM7 on the HTC Glacier (T-Mobile MyTouch 4g)

​

I was trying to learn how to compile CM7 from source on my Glacier as practice for when my new Nexus 4 arrives next month. I originally followed a guide by Sykopompos but it's severely out of date (and didn't work off the bat for me). I figured I'd turn this into a how-to to help anyone out with this. I'm assuming that with the proper blobs you can also use this to compile CM9 and CM10 (I will be testing this in the next few days).

Disclaimer: if you FUBUR your PC, I am not responsible, you do this at your own risk. ​

You SHOULDN'T be able to mess up your PC if you go the VirtualBox route, however there is always a risk of bricking your device. (Although I'd assume if things went tits up you could just reflash a PD15IMG.zip and you'd just need to re-root your device.)

I used Ubuntu 10.04 LTS for this, feel try to with another version (I'd be weary past 11.10 as 12.04 and beyond aren't officially supported by AOSP.) I'll highlight any problem areas you need to be careful of.

This is based off of my experience compiling from source. I may be taking the long way around things, but it works. I am gearing this to the people new to android development (I've just recently gotten into it myself). I will be giving you things you need to copy and paste (for the most part) to make it easier.

This will cover setting up and compiling the source for a working rom, and the basics of custom kernel creation.

You MUST use 64-bit Ubuntu for gingerbread and later!

You can either install Ubuntu on a dedicated partition (Wubi doesn't give you enough space though, just FYI) or use VirtualBox(). If you go the VirtualBox route, you need to install the extension pack (Located on the same page as the download) for later steps to work.

Here are my recommendations (I used the VirtualBox route):

Disk space: 100gb is a good amount. Between downloading the source and my first build, I'm using 24.6gb (according to windows).

Ram: I gave the VM 4gb of my 8gb ram. You can use more or less, but I'd think that if you have less than 4gb of ram allocated, use a 8-12gb swap file just in case (you may not need it, I built with no problems with 4gb of ram and no swap)

Processor: I have a new Ivy Bridge processor that supports virtualization (If you have a K designation Core series (IE Core i5-2500K you don't support virtualization and your build will be... much slower). I gave VirtualBox 3 of my 4 cores, feel free to adjust as necessary (just leave at least one for your main system)

At this point, I'm trusting that you've successfully installed Ubuntu 10.04 64-bit LTS along with the VirtualBox additions (if you went the VirtualBox route). Make sure to run sudo apt-get update . (don't upgrade to 12.04 if it asks)

Thanks to Dragonswithin for updating me about OpenJDK working.

Installing Necessary packages

​

There are two packages that need to be handled differently from just a simple apt-get install. The first is git-core (the version in the repositories are extremely old and refuse to work correctly with this). The second is Sun-jdk6

First, do the following to add the source for the correct version of git-core.

sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update

Enter your password when prompted.

Install the following

sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev gitg qt3-dev-tools libqt3-mt-dev eclipse valgrind zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 gedit lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev gitg pngcrush wput openjdk-6-jre

Hit enter when it asks if you want to proceed

Provided everything went smoothly above, you now have all the correct packages installed!