Friday, April 29, 2011

Source Code Repo for ezGingerbread development

Google AndroidImage by Scarygami via Flickr
As some of you may know I've been working on a open source build for a near AOSP version of Gingerbread for the Dream/Sapphire.

Unless a better name is conceived I'll call it ezGingerbread!

The idea is to do this mostly in the open; and I'm sure this will be forked into various builds in the future. Here however we can discuss this repository; and make recommendations for maintaining a base stable, and fast install for out phones.

I'll make a new thread for initial release candidates and releases when we are ready. This thread will remain even after said releases for the ongoing development.

To Build,

The following is based off CyanogenMod wiki and explains how to build on:
Ubuntu 10.04 (Lucid) & Ubuntu 10.10a3 (Meerkat) and ideally a AMD64 compatible computer

I personally (mostly following the same instructions) use Debian squeeze and others have succeeded with 32bit systems.

Computer Setup (only if you have not made an android build environment before):

1) It is not 100% needed but highly recommended to install the Android SDK
2) Install the build packages
Originally Posted by cmwiki
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

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 maverick partner"
 Last if you wish to build the kernel you will need the package lzma to compress the zImage used in the newer kernels.

3) make a directory for you android work say 'mkdir ~/android'
4) download repo: 'curl > ~/android/repo'
4.b) Mark repo executable 'chmod 0755 ~/android/repo'
5) symlink repo to somewhere on your path (Optional but will make things easier) example 'sudo ln -s ~/android/repo /usr/local/bin/repo'

if you do not add repo to the path remember to replace any calls to repo with a calling path.. in all cases below it will be '../repo'

Getting the code

6) cd into your android directory you created above: 'cd ~/android'
7) create a directory for ezGingerbread: 'mkdir ezGingerbread'
8) cd ezGingerbread
9) init the repo: 
repo init -u git:// -b gingerbread
it will ask for your name+gmail, answer real or fake
10) sync to download the code: 
repo sync
(go out and enjoy the day.. this will take a while)

Proprietary files

Extract the proprietary files, historically the extract_files script is used, but requires your phone to already have the rom installed, so we will use unzip_files instead.

11) download the most recent version of the nighties (usually the proprietary files don't change but sometimes we swap them):
curl >
12) 'cd device/htc/sapphire/'
13) run './'
14) return to the root directory: 'cd ~/android/ezGingerbread'

Note: if you have been asked to re-build the proprietary files, either because an autogenerated make script was updated, or a change in the files: run 'rm -rf vendor;repo sync;' before re-running the above.

Building the kernel (Optional)

Note this is an addition to the process as a pre-built kernel (same ones I use) are included in the general build thus if its your first time building I recommend skipping ahead to building, however here are the steps for building the ezgb kernel for those interested in kernel development 

15) fetch the kernel code: 'device/htc/dream-sapphire/kernel/ fetch'
16) build the kernel 'device/htc/dream-sapphire/kernel/ build'

(fetch will always remove the entire kernel build directory and re-clone from github.. if you just wish to sync, run 'device/htc/dream-sapphire/kernel/ sync' followed by 'device/htc/dream-sapphire/kernel/ clean' to remove the build work directories and bring the git repo up todate w/o re-downloading the entire kernel source tree)


17) run '. build/'
18) run 'lunch' and select full_sapphire-userdebug (shortcuts you will find are 'lunch full_sapphire-userdebug' or just 'lunch 3' but these may change if the target name is changed in future, the menu will always list all the options)
19) run 'make -j<Number of CPU cores in your computer +1> otapackage'
for example if you have a quad code CPU: 'make -j5 otapackage'
a dual core is 'make -j3 otapackage'

The -jN indicates the number of parallel threads make will run, but using -j5 I assure all 4 cores are at 100% utilization .. important as it can take 3-4h to build on a single core.

20) after you realize the build is done (ie fan on computer stopped working overtime) the flashable image will be:
ls out/target/product/sapphire/full_sapphire-ota-eng.<your username>.zip

so 'ls -l out/target/product/sapphire/full_sapphire-ota-eng*zip'

The resulting image will be an EBI0/EBI1/2708+ anykernel installer

Updating and Rebuilding:

Usually you only need to run the following for a updated clean build:
21) run 'repo sync'
22) make clobber
23) make -j<Number of CPU cores in your computer +1> otapackage

In some cases you may wish to re-generate the proprietary files if something changed:

in that case:
* Run 'rm -rf vendor'
* Run 'repo sync'
* pick up with 'Proprietary files' section above.

Last if you are doing active development in the build tree its easy to be confused about the trees state, to restore to the clean tree:

* cd ~/android/ezGingerbread
* run: (note this will delete everything but the .repo (or other hidden) directories, be careful.
rm -rf `ls -a | grep -v "^\." `
* run 'repo sync' this will not take too long, its just extracting the files, the data has mostly been downloaded from your original sync.
* Continue with the 'Proprietary files' section above.

To Fix,

If you have a patch give me a push on github, a message here, or send me a PM I'll review it and include it if appropriate.

Known issues and status,

I'm currently tracking issues on github:

Enhanced by Zemanta

1 comment:

  1. Postcodes used in many different ways with code files US postal services is dependent on this database zip code.