[EVO Shift 4G General] sparksco:
Ok so I was searching and searching for a guide on how to compile CM7 source, and finally found a way to do it on the latest Ubuntu 11.10 oneiric

Updated info for non-debian based systems thanks to Vicodan:

If you want to use this on fedora or non-debian based systems you will need to replace every command that says apt-get to yum. Thanks to Vicodan for pointing this out as I do not use fedora myself.

Hardware Requirements:

- A minimum dual core pc, the more ram the better

- A working wifi connection

- Linux Operating System. Either 32-bit or 64-bit will work

NOTE: 64-bit will run faster

Optional Recommended Software:

Many of these can be found in the software center using the search box

If you find multiple versions it's ok to install them all, unless it says

otherwise

- Python

Alternatively open the terminal application and type

$ sudo app-get install python

Note: Enter your login password to install

- awk and gawk

- 7zip

- RAR

$ sudo apt-get install rar

Step 1 java:

Setting up java is one of the most important step to getting your pc prepared for a build environment. First check the java version that is installed on your pc

NOTE: On Ubuntu 11.10, and variants, you need to enable the

parter repository to install sun-java6-jdk:

$ sudo add-apt-repository "deb http://archive.canonical.com/ maverick partner"

$ java -version

The correct version is:

java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

You must have a 1.6.x to compile on the gingerbread branch of cyanogenmod. If you have the correct version skip down to Step 2.

1a - First install the correct version:

$ sudo apt-get install sun-java6-jdk sun-java6-jre

1b - Now you will need to manually remove the other java version

$ sudo nautilus

This will open up a root file explorer. Once it opens click on the "file

system" tab on the left and navigate to the /usr/lib/jvm

Once there you should see two types of java. If you see java open jdk

you need to delete it, along with it's associated bin folder. Close the

root file explorer window

1c - Edit .bashrc

Next navigate to your home folder and open up the .bashrc file. This is

a hidden file so you will have to press Ctrl + H to see it. Add the

following lines to the top section, and change accordingly to your path

Example:

#JavaDev PATH
export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.24
export PATH=$PATH:$JAVA_HOME/bin

Save the file and exit, then changes will not take effect until reboot

Verify java version again

$ java -version

Step 2 - Install git

http://help.github.com/linux-set-up-git/

or

$ sudo apt-get install git

Step 3 - Prepare the Build Environment

NOTE: You only need to do these steps the first time you build.

If you previously prepared your build environment, skip to Copy

proprietary files.

3a - Install the ADB

Install the Android SDK. http://wiki.cyanogenmod.com/index.php?
title=Howto:_Install_the_Android_SDK

3b - Install the Build Packages

Install using the package manager of your choice:

For 32-bit & 64-bit systems:

$ [COLOR="red"]sudo apt-get install[/COLOR] 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 64-bit only systems:

$ [COLOR="red"]sudo apt-get install[/COLOR] g++-multilib lib32z1-dev lib32ncurses5-dev [COLOR="Red"]lib32readline-gplv2-dev[/COLOR] [COLOR="Red"]gcc-multilib g++-multilib[/COLOR]

3c - Create the Directories

You will need to set up some directories in your build environment.

To create them:

$ mkdir -p ~/bin
$ mkdir -p ~/android/system

3d - Install the Repository

Enter the following to download make executable the "repo" binary:

$ [COLOR="red"]curl https://raw.github.com/android/tools_repo/master/repo > ~/bin/repo[/COLOR]
$ chmod a+x ~/bin/repo

NOTE: You may need to reboot for these changes to take effect.

Now enter the following to initialize the repository:

$ cd ~/android/system/
$ [COLOR="red"]repo init -u git://github.com/CyanogenMod/android.git -b gingerbread --repo-url=git://github.com/android/tools_repo.git[/COLOR]
$ repo sync

3e - Copy proprietary files

NOTE: This only needs done the first time you build. If you have

already done these steps, you may skip to Download RomManager.

You will need to have a speedy with a working copy of CyanogenMod

install and ADB working on the computer. This script will copy the

proprietary files from the device.

Connect the device to the computer and ensure that ADB is working

properly.

$ cd ~/android/system/device/htc/speedy/
./extract-files.sh

3f - Download RomManager

NOTE: This only needs to be done when an update to

RomManager is released. If you are-up-to date, you may skip to Building

CyanogenMod. Download RomManager which is needed by the build:

$ ~/android/system/vendor/cyanogen/get-rommanager

3g - Building CyanogenMod

Check for updates

First, check for updates in the source:

$ cd ~/android/system/
$ repo sync
$ cp build/core/root.mk -f Makefile

3h - Set up your Compiler

This is optional but helpful for kernel compiling

There are a lot of things that need to be added to the .bashrc to let your

pc know about which type of compiler you want to use. The best way is

to use the one provided in the CM7 work tree.

[COLOR="red"]#Android[/COLOR]
export ARCH=arm
export CCOMPILE=$CROSS_COMPILE
export PATH=$PATH:~/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin

3i - Configure Build & Compile

Now, the environment must be configured to build and the ROM

compiled, from code, for the Speedy.

$ . build/envsetup.sh && brunch speedy

3j - Install

Copy your .zip file from

~/android/system/out/target/product/speedy/update.cm-XXXXX-

signed.zip to the root of the SD card.

Optional: Download Google Apps for CyanogenMod 7 and place it on the

root of the SD card.

Flash both of these .zip files from recovery.