HTC Dream & Magic: Compile CyanogenMod (Linux)

From CyanogenMod Wiki
Jump to: navigation, search

How to compile CyanogenMod for Dream (G1) / Sapphire (Magic).

This how-to was written for Ubuntu 10.04 & Ubuntu 10.10 , Dream / Sapphire, CyanogenMod 6.1.x (Froyo), on 13 February 2010.

Contents

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.

Install the ADB

Install the Android SDK.

Install the Build Packages

Install using the package manager of your choice:

For 32-bit & 64-bit 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 64-bit only systems:

g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib
NOTE: On Ubuntu 10.10, and variants, you need to enable the parter repository to install sun-java6-jdk:
add-apt-repository "deb http://archive.canonical.com/ maverick partner"

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

Install the Repository

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

curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
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/
repo init -u git://github.com/CyanogenMod/android.git -b froyo-stable
repo sync -j16

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 ROM Manager.

You will need to have a Dream or Sapphire with a working CyanogenMod install and working ADB. This script will copy the proprietary files from your phone. Connect your phone to you computer and insure that ADB is working properly.

cd ~/android/system/device/htc/dream_sapphire/
./extract-files.sh
NOTE: If some hardware isn't working, like camcorder or FM radio, you will need to find the updated prop blobs.

Download ROM Manager

NOTE: This only needs to be done when an update to ROM Manager is released. If you are-up-to date, you may skip to Building CyanogenMod.

Download ROM Manager which is needed by the build:

mkdir ~/android/system/vendor/cyanogen/proprietary
curl -o ~/android/system/vendor/cyanogen/proprietary/ROM Manager.apk -O http://mirror.kanged.net/recoveries/ROM Manager.apk

Building CyanogenMod

Check for updates

First, check for updates in the source:

cd ~/android/system/
repo sync

Configure Build

Now, your environment must be configured to build specifically for the Magic or Sapphire. To set up your build environment:

. build/envsetup.sh
lunch cyanogen_dream_sapphire-eng

Compile

Next, we will build the actual ROM.

mka bacon

Install

  1. Copy your .zip file from ~/android/system/out/target/product/dream_sapphire/update.cm-XXXXX-signed.zip to the root of the SD card.
    Optional: Download MDPI-Tiny Google Apps for CyanogenMod 6 and place it on the root of the SD card.
  2. Flash both of these .zip files from recovery.
Personal tools