[HOW-TO] Compile AOSP Froyo + [ROM] Latest AOSP Froyo for Sapphire

Search This thread

dferreira

Senior Member
Jan 26, 2007
1,800
426
41
Oulu
www.denzilferreira.com
Tired of using someone else wrapped up Android OS? If you are like me, you probably would like to take control over what you are using on your device. There isn't any Market or any Google Applications on this. This is intended for developing applications and have a working phone using the latest Android OS for HTC Magic/Sapphire's.

The recommended system for downloading and compiling Android OS from source (AOSP - Android Open-Source Project) is Ubuntu. I have a Mac with Snow Leopard, so I use VirtualBox to run a virtual machine that has Ubuntu installed on it. Once you have Ubuntu installed on the virtual machine, you need to prepare it so that you can download and compile successfully AOSP.

First, make sure your OS is up-to-date, by running the Update Manager from the System>Administration menu. Once that is completed, go to Applications>Accessories and open Terminal.

Type this command to install all the needed libraries (this is all one line) - Ubuntu 10.04 64Bits:
Code:
sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind lib32readline5-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev

Type this command to install all the needed libraries (this is all one line) - Ubuntu 32Bits (thanks to Szusz!):
Edit your /etc/apt/sources.list and add these lines on the end:
Code:
deb pl.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb pl.archive.ubuntu.com/ubuntu/ jaunty universe
Code:
sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind libreadline5-dev gcc-multilib g++-multilib libc6-dev libncurses5-dev x11proto-core-dev libx11-dev libreadline5-dev libz-dev

Prepare the OS to run Java 5.0, which is the only compatible Java version for compiling. Recent versions of Ubuntu don't need this step (10.04+).
Code:
sudo update-java-alternatives -s java-1.5.0-sun

Fix a dependency with X11 (64Bits):
Code:
sudo ln -s /usr/lib32/libX11.so.6 /usr/lib32/libX11.so

Fix a dependency with X11 (32Bits):
Code:
sudo ln -s /usr/lib/libX11.so.6 /usr/lib/libX11.so

That's it for the Operative system. Now the tool that Google uses to control the source files is Repo. To install type this:
Code:
cd ~
mkdir bin
curl http://android.git.kernel.org/repo >~/bin/repo
chmod a+x ~/bin/repo
PATH="$HOME/bin:$PATH"

Now to download the source files, compile etc, all you need to do is to copy this text to a file in Ubuntu (to create one, just type "gedit android.sh"):
PHP:
#!/bin/bash
#Created by dferreira (lizned.arierref@gmail.com)
#Checkout and compile master repositories out of source.android.com

SOURCE_FOLDER=~/magicDroid
BRANCH="master";
KERNEL="android-msm-2.6.32";

#Check for Repo
if [ ! -f ~/bin/repo ]
then
    cd ~
    mkdir bin
    curl http://android.git.kernel.org/repo >~/bin/repo
    chmod a+x ~/bin/repo
    PATH="$HOME/bin:$PATH"
fi

#Create project folder
if [ ! -d $SOURCE_FOLDER ]
then
	mkdir $SOURCE_FOLDER
fi

cd $SOURCE_FOLDER

#clean old compiled files, there can be new stuff!
make installclean
make clean

#Get updated source files from AOSP
repo init -u git://android.git.kernel.org/platform/manifest.git -b $BRANCH
git clone git://android.git.kernel.org/kernel/msm.git -b $KERNEL #clone latest kernel project
cd $SOURCE_FOLDER/msm 
git pull #check if anything new
cd $SOURCE_FOLDER
repo sync #update repo's

#Get HTC drivers if they don't exist already on folder
cd ~/magicDroid
if [ ! -f sapphire_update.zip ]
then	
	wget --referer=http://developer.htc.com/google-io-device.html http://member.america.htc.com/download/RomCode/ADP/signed-google_ion-ota-14721.zip?
	mv signed-google_ion-ota-14721.zip sapphire_update.zip
fi

#unzip the proprietary files from HTC for Sapphire
if [ ! -d vendor/htc/sapphire/proprietary ]
then
	cd $SOURCE_FOLDER/device/htc/sapphire/
	./unzip-files.sh
fi

#Compile latest kernel
cd $SOURCE_FOLDER/msm
make ARCH=arm msm_defconfig
make ARCH=arm CROSS_COMPILE=$SOURCE_FOLDER/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- zImage -j4

#copy kernel to source if success!
if [ -f $SOURCE_FOLDER/msm/arch/arm/boot/zImage ]
then
	cp $SOURCE_FOLDER/msm/arch/arm/boot/zImage $SOURCE_FOLDER/device/htc/dream-sapphire/kernel
fi

#Compile wifi module to match the kernel
cd $SOURCE_FOLDER/system/wlan/ti/sta_dk_4_0_4_32
make KERNEL_DIR=$SOURCE_FOLDER/msm/ ARCH=arm CROSS_COMPILE=$SOURCE_FOLDER/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- -j4

#copy updated wlan.ko that matches the kernel
if [ -f $SOURCE_FOLDER/system/wlan/ti/sta_dk_4_0_4_32/wlan.ko ]
then
	cp $SOURCE_FOLDER/system/wlan/ti/sta_dk_4_0_4_32/wlan.ko $SOURCE_FOLDER/device/htc/dream-sapphire/wlan.ko
fi

#setup compiling environment and build images
cd $SOURCE_FOLDER
. build/envsetup.sh

#cd $SOURCE_FOLDER
lunch
make -j4

#get to compiled folder
cd $SOURCE_FOLDER/out/target/product/sapphire/
echo 'Your files ready for flashing are here:'
ls *.img

Save the file and make it executable with:
Code:
chmod 755 android.sh

To run it, just type:
Code:
./android.sh

That's it! Now just follow the instructions. It should ask for your name, email and then later to what device are you compiling. The script that you put on the text file is meant for Sapphire, so you should choose option that has sapphire on it, US version or EU version, with ENG on it, which will make the compiled OS with root access.

In the end, you'll have a set of .img files, ready to be installed on your device.

Using your favourite recovery, wipe everything before flashing the OS and then boot into fastboot. I'm pretty sure that if you really want to compile your own OS, you already know how to use fastboot. But anyway:
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash userdata userdata.img

Reboot your device and enjoy your own OS.

If you run into trouble, let me know.

Some fixes you might be interested:
Enable JIT on DalvikVM
Edit dalvik/vm/Android.mk
Code:
ifeq ($(TARGET_ARCH_VARIANT),armv5te)
    WITH_JIT := true
endif
Edit vendor/htc/sapphire/BoardConfigVendor.mk
Code:
WITH_JIT := true
ENABLE_JSC_JIT := true

Add support for audio+video recording on camera
Code:
We need to add BUILD_WITH_FULL_STAGEFRIGHT := true to your vendor's Buildxxx.mk to be able to record audio+video on the camera.
Another property that needs to be active: Thanks to Jubeh

If you want to run this on 32A's, you need to replace the kernel for a 32A one and you should be good to go.

Fix the prelinks issues. Make sure to make a backup of the file (build/core/prelink-linux-arm.map) because I'm almost sure it will get officially fixed in the future.
PHP:
# 0xC0000000 - 0xFFFFFFFF Kernel
# 0xB0100000 - 0xBFFFFFFF Thread 0 Stack
# 0xB0000000 - 0xB00FFFFF Linker
# 0xA0000000 - 0xBFFFFFFF Prelinked System Libraries
# 0x90000000 - 0x9FFFFFFF Prelinked App Libraries
# 0x80000000 - 0x8FFFFFFF Non-prelinked Libraries
# 0x40000000 - 0x7FFFFFFF mmap'd stuff
# 0x10000000 - 0x3FFFFFFF Thread Stacks
# 0x00000000 - 0x0FFFFFFF .text / .data / heap

# Note: The general rule is that libraries should be aligned on 1MB
# boundaries. For ease of updating this file, you will find a comment
# on each line, indicating the observed size of the library, which is
# one of:
#
#     [<64K] observed to be less than 64K
#     [~1M] rounded up, one megabyte (similarly for other sizes)
#     [???] no size observed, assumed to be one megabyte

# core system libraries
libdl.so                0xAFF00000 # [<64K]
libc.so                 0xAFD00000 # [~2M]
libstdc++.so            0xAFC00000 # [<64K]
libm.so                 0xAFB00000 # [~1M]
liblog.so               0xAFA00000 # [<64K]
libcutils.so            0xAF900000 # [~1M]
libthread_db.so         0xAF800000 # [<64K]
libz.so                 0xAF700000 # [~1M]
libevent.so             0xAF600000 # [???]
libssl.so               0xAF400000 # [~2M]
libcrypto.so            0xAF000000 # [~4M]
libsysutils.so          0xAEF00000 # [~1M]

# bluetooth
liba2dp.so              0xAEE00000 # [~1M]
audio.so                0xAED00000 # [~1M]
input.so                0xAEC00000 # [~1M]
libbluetoothd.so        0xAEA00000 # [~2M]
libbluedroid.so         0xAE900000 # [<64K]
libbluetooth.so         0xAE800000 # [~1M]
libdbus.so              0xAE700000 # [~1M]

# extended system libraries
libril.so               0xAE600000 # [~1M]
libreference-ril.so     0xAE500000 # [~1M]
libwpa_client.so        0xAE400000 # [<64K]
libnetutils.so          0xAE300000 # [~1M]

# core dalvik runtime support
libandroid_servers.so   0xAE200000 # [~1M]
libicuuc.so             0xADE00000 # [~4M]
libicui18n.so           0xAD900000 # [~5M]
libandroid_runtime.so   0xAD300000 # [~6M]
libnativehelper.so      0xAD100000 # [~2M]
libdvm-ARM.so           0xAD000000 # [???]
libdvm.so               0xACA00000 # [~6M]
# Note: libicudata.so intentionally omitted

# graphics
libpixelflinger.so      0xAC900000 # [~1M]
# libcorecg is for backward-compatibility with donut
libcorecg.so            0xAC800000 # [???]
libsurfaceflinger_client.so 0xAC700000 # [~1M]
libsurfaceflinger.so    0xAC500000 # [~2M]
libGLES_android.so      0xAC400000 # [~1M]
libagl.so               0xAC300000 # [???]

libGLESv1_CM.so         0xAC200000 # [~1M]
libGLESv2.so            0xAC100000 # [~1M]
libOpenVG_CM.so         0xAC000000 # [???]
libOpenVGU_CM.so        0xABF00000 # [???]
libEGL.so               0xABE00000 # [~1M]
libETC1.so              0xABD00000 # [<64K]

libacc.so               0xABC00000 # [~1M]

libexif.so              0xABB00000 # [~1M]
libcamera_client.so     0xABA80000 # [~1M]
libui.so                0xAB900000 # [~1M]
# libsgl is for backward-compatibility with donut
libsgl.so               0xAB800000 # [???]
libskia.so              0xAB100000 # [~7M]
librs_jni.so            0xAB000000 # [~1M]
libRS.so                0xA9E00000 # [~2M]
libjnigraphics.so       0xA9D00000 # [<64K]
libskiagl.so            0xA9C00000 # [~1M]

# audio
libFLAC.so              0xA9B00000 # [???]
libaudiopolicy.so       0xA9A00000 # [~1M]
libaudiopolicygeneric.so 0xA9900000 # [???]
libsoundpool.so         0xA9800000 # [~1M]
libgps.so               0xA9700000 # [~1M]
libspeech.so            0xA9600000 # [~1M]
liboemcamera.so         0xA9400000 # [~1M]
libmedia_jni.so         0xA9300000 # [~1M]
libmediaplayerservice.so 0xA9200000 # [~1M]
libmedia.so             0xA9000000 # [~2M]
libFFTEm.so             0xA8F00000 # [~1M]
libSR_AudioIn.so        0xA8E00000 # [~1M] for external/srec
libaudioflinger.so      0xA8D00000 # [~1M]

# assorted system libraries
libsqlite.so            0xA8B00000 # [~2M]
libexpat.so             0xA8A00000 # [~1M]
libwebcore.so           0xA8300000 # [~7M]
libbinder.so            0xA8200000 # [~1M]
libutils.so             0xA8100000 # [~1M]
libcameraservice.so     0xA8000000 # [~1M]
libhardware.so          0xA7F00000 # [<64K]
libhardware_legacy.so   0xA7E00000 # [~1M]
libapp_process.so       0xA7D00000 # [???]
libsystem_server.so     0xA7C00000 # [~1M]
libime.so               0xA7B00000 # [???]
libaudio.so             0xA7A00000 # [~1M]
libcamera.so            0xA7900000 # [~1M]
libsonivox.so           0xA7800000 # [~1M]
libvorbisidec.so        0xA7700000 # [~1M]
libdiskconfig.so        0xA7600000 # [<64K]
libemoji.so             0xA7500000 # [<64K]
libjni_latinime.so      0xA7400000 # [~1M]
libjni_pinyinime.so     0xA7300000 # [~1M]
libttssynthproxy.so     0xA7200000 # [~1M] for frameworks/base
libttspico.so           0xA7000000 # [~2M] for external/svox

# pv libraries
libpvasf.so                    0xA6F00000 # [???]
libpvasfreg.so                 0xA6E00000 # [???]
libomx_sharedlibrary.so        0xA6D00000 # [~1M]
libopencore_download.so        0xA6C00000 # [~1M]
libopencore_downloadreg.so     0xA6B00000 # [~1M]
libopencore_net_support.so     0xA6800000 # [~3M]
libopencore_rtsp.so            0xA6200000 # [~6M]
libopencore_rtspreg.so         0xA6100000 # [~1M]
libopencore_author.so          0xA5D00000 # [~4M]
libomx_aacdec_sharedlibrary.so 0xA5B00000 # [~2M]
libomx_amrdec_sharedlibrary.so 0xA5A00000 # [~1M]
libomx_amrenc_sharedlibrary.so 0xA5900000 # [~1M]
libomx_avcdec_sharedlibrary.so 0xA5800000 # [~1M]
libomx_avcenc_sharedlibrary.so 0xA5700000 # [???]
libomx_m4vdec_sharedlibrary.so 0xA5600000 # [~1M]
libomx_m4venc_sharedlibrary.so 0xA5500000 # [???]
libomx_mp3dec_sharedlibrary.so 0xA5400000 # [~1M]
libopencore_mp4local.so        0xA5200000 # [~2M]
libopencore_mp4localreg.so     0xA5100000 # [~1M]
libopencore_player.so          0xA4800000 # [~9M]

# opencore hardware support
libmm-adspsvc.so              0xA4700000 # [<64K]
libOmxCore.so                 0xA4600000 # [<64K]
libOmxMpeg4Dec.so             0xA4500000 # [~1M]
libOmxH264Dec.so              0xA4400000 # [~1M]
libOmxVidEnc.so               0xA4300000 # [~1M]
libopencorehw.so              0xA4200000 # [~1M]
libOmxVdec.so                 0xA4100000 # [~1M]
libmm-omxcore.so              0xA4000000 # [<64K]

# pv libraries
libopencore_common.so         0xA3900000 # [~7M]
libqcomm_omx.so               0xA3800000 # [<64K]

# stagefright libraries
libstagefright_amrnb_common.so     0xA3700000 # [~1M]
libstagefright_avc_common.so       0xA3600000 # [~1M]
libstagefright_color_conversion.so 0xA3500000 # [<64K]
libstagefright_omx.so              0xA3400000 # [~1M]
libstagefrighthw.so                0xA3300000 # [~1M]
libstagefright.so                  0xA2F00000 # [~4M]

# libraries for specific hardware
libgsl.so               0xA2E00000 # [~1M]
libhtc_acoustic.so      0xA2D00000 # [<64K]
libhtc_ril.so           0xA2C00000 # [~1M]
liblvmxipc.so           0xA2B00000 # [~1M] for vendor/nxp
libreference-cdma-sms.so 0xA2A00000 # [<64K] for hardware/ril

# libraries for specific apps or temporary libraries
libcam_ipl.so           0x9F000000 # [???]
libwbxml.so             0x9EF00000 # [???]
libwbxml_jni.so         0x9EE00000 # [~1M]
libxml2wbxml.so         0x9EB00000 # [~1M]
libdrm1.so              0x9EA00000 # [~1M]
libdrm1_jni.so          0x9E900000 # [<64K]
libwapcore.so           0x9E800000 # [???]
libstreetview.so        0x9E700000 # [???]
libwapbrowsertest.so    0x9E600000 # [???]
libminiglobe.so         0x9E500000 # [???]
libearth.so             0x9E400000 # [???]
libembunit.so           0x9E300000 # [<64K]
libneon.so              0x9E200000 # [???]
libjni_example.so       0x9E100000 # [???]
libjni_load_test.so     0x9E000000 # [???]
libjni_lib_test.so      0x9DF00000 # [???]
librunperf.so           0x9DE00000 # [???]
libctest.so             0x9DD00000 # [<64K]
libUAPI_jni.so          0x9DC00000 # [???]
librpc.so               0x9DB00000 # [~1M]
libtrace_test.so        0x9DA00000 # [???]
libsrec_jni.so          0x9D800000 # [~2M]
libjpeg.so              0x9D700000 # [~1M]
libiprouteutil.so       0x9D600000 # [~1M] for external/iproute2
libnetlink.so           0x9D500000 # [<64K] for external/iproute2
libpagemap.so           0x9D400000 # [<64K] for system/extras/libpagemap
libstlport.so           0x9D100000 # [~3M] for external/stlport
libzxing.so             0x9D000000 # [<64K] for goggles
libinterstitial.so      0x9CF00000 # [<64K] for goggles
liblept.so              0x9CA00000 # [~5M] for external/leptonica

How to fix the camera:
http://xdaforums.com/showpost.php?p=7405081&postcount=502 Drivers part
http://xdaforums.com/showpost.php?p=7136150&postcount=447 Kernel part

---------------------

In case you don't want to do it yourself, you can just download this package, and flash it from recovery.

AOSP FROYO 2.2 v3.1

v3.1 - thanks to Jack for debugging it!
- Bootanimation is working!
- Wifi + Kernel from Cyanogen, as mine went boggus and I can't test it if it works without a device.
- Full APN list
- Known bugs: camera onscreen controls do FC sometimes. Switching from camera to camcorder works, but fc when reverting back.

v3
- Live wallpapers support.
- Sound recorder is now visible to the user to use.
- All available languages are included.
- Fixed missing sound files.
- Cyanogen's camera fixes are included. Really a pleasure to learn from what he has done!

v2.1
- Fixed camera - Use v2 and replace the boot.img with this one

What's on it:
v2
- Fixed GPS (was missing gps.conf + libgps.so was being allocated to wrong prelink).
- Fixed all prelink errors by mapping all the libraries to the correct mmap banks (edited build/core/prelink-linux-arm.map).
- Replaced Gallery3D (not complete at sources) by old enhanced Gallery (multitouch working!)
- Added the Text-To-Speech libraries from source (got those from sdk.mk)
- Fixed missing sounds (Lock.ogg and Unlock.ogg in OriginalSounds.mk)
- Camera still not working, but now we don't have a prelink error, so should be fixable by replacing liboemcamera.so by one that works - maybe Cyanogen's??)
- Bootanimation still not working... (i've looked into it and I can't figure out why it doesn't!)

v1
- AOSP 2.2 Froyo
- WiFi + Kernel 2.6.32 up and running.
- 3D Drivers
- JIT + JIT JSC enabled
- Multi-touch zoom on browser

Doesn't work:
- No boot animation, screen stays blank while booting but you can check it out using "adb logcat"
- Camera
- Gallery has missing mdpi graphics, I'll fix it later
 

Attachments

  • apps.png
    apps.png
    38.5 KB · Views: 2,551
  • device.png
    device.png
    21 KB · Views: 2,298
  • home.jpg
    home.jpg
    26 KB · Views: 2,453
  • keyboards.png
    keyboards.png
    17.5 KB · Views: 2,068
  • messaging.png
    messaging.png
    15.1 KB · Views: 1,894
  • tethering.png
    tethering.png
    9.5 KB · Views: 1,667
  • wifi.png
    wifi.png
    23.1 KB · Views: 1,709
Last edited:

omnikai

Senior Member
Mar 3, 2010
214
27
Awesome, I'd love to start poking around with this.

Is there a way to flash an update with a camera fix on top of this?

Thanks for posting!
 

dferreira

Senior Member
Jan 26, 2007
1,800
426
41
Oulu
www.denzilferreira.com
I never figured out how to add NCommander's hacked camera drivers that work with Eclair. If anyone knows how to do it, please share so that we can add it to the script. Maybe we can turn this script into something that will allow anyone build their own AOSP ROM :)
 

DopyG

Senior Member
Aug 25, 2009
199
0
So actually everythings work except camera?

How is this in terms of speed? : D
 

ododoo

Senior Member
Aug 11, 2008
67
3
Saving to: `signed-google_ion-ota-14721.zip'

100%[======================================>] 53*965*203 91,0K/s in 18m 50s

2010-06-17 23:30:19 (46,7 KB/s) - `signed-google_ion-ota-14721.zip' saved [53965203/53965203]

make: *** No rule to make target `installclean'. Stop.
make: *** No rule to make target `clean'. Stop.
./android.sh: line 27: repo: command not found
./android.sh: line 28: repo: command not found
./android.sh: line 32: build/envsetup.sh: No such file or directory
./android.sh: linje 35: cd: /home/ododoo/magicDroid/vendor/htc/sapphire-open/: No such file or directory
./android.sh: line 36: ./unzip-files.sh: No such file or directory
./android.sh: line 39: lunch: command not found
make: *** No targets specified and no makefile found. Stop.
./android.sh: linje 43: cd: /home/ododoo/magicDroid/out/target/product/sapphire-open/: No such file or directory
Your files ready for flashing are here:
ls: kan ikke åpne *.img: No such file or directory

Did not get any question about anything.. Made a .zip file, but not sure if i dare to flash it...
 

dferreira

Senior Member
Jan 26, 2007
1,800
426
41
Oulu
www.denzilferreira.com
Did not get any question about anything.. Made a .zip file, but not sure if i dare to flash it...

The .zip you have there is later used to extract the proprietary drivers. The output is saying that you don't have "repo", which is the tool Google uses to control the source files. My guess is you skipped this:

Code:
cd ~
mkdir bin
curl http://android.git.kernel.org/repo >~/bin/repo
chmod a+x ~/bin/repo
PATH="$HOME/bin:$PATH"
 

ododoo

Senior Member
Aug 11, 2008
67
3
sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl zlib1g-dev valgrind gcc-multilib g++-multilib x11proto-core-dev libx11-dev

this is the first line that works for me... Had to remove alot.

sudo ln -s /usr/lib32/libX11.so.6 /usr/lib32/libX11.so
Does not work

ododoo@ododoo-laptop:~$ cd ~
ododoo@ododoo-laptop:~$ mkdir bin
mkdir: kan ikke opprette katalog «bin»: File exists
ododoo@ododoo-laptop:~$ curl http://android.git.kernel.org/repo >~/bin/repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 17211 0 17211 0 0 25840 0 --:--:-- --:--:-- --:--:-- 53952
ododoo@ododoo-laptop:~$ chmod a+x ~/bin/repo
ododoo@ododoo-laptop:~$

This is what i get..

Still get the same error when i try to compile.
 

Szusz

Senior Member
May 6, 2010
60
0
Awesome work mate!

Two questions though.

1. Which Radio version is required?
2. Can I install the gapps from Cyanogenmod for instance?

Cheers,
Szusz
 

dferreira

Senior Member
Jan 26, 2007
1,800
426
41
Oulu
www.denzilferreira.com
this is the first line that works for me... Had to remove alot.


Does not work



This is what i get..

Still get the same error when i try to compile.
Don't forget this:

PATH="$HOME/bin:$PATH"

So that Repo can be run by the script. I'll change the script to do this automatically for us.

Edit: Just updated the script, he checks for Repo, downloads it and sets it up for you now.
 
Last edited:

ododoo

Senior Member
Aug 11, 2008
67
3
Seems to be working now! :)

Edit: Too soon.....
Checking out files: 100% (641/641), done.g out files: 21% (136/641)
Syncing work tree: 48% (77/159) error: git checkout-index: unable to write file tessdata/chi_sim5.inttemp
error: git checkout-index: unable to write file tessdata/chi_sim5.ukai.tif
error: git checkout-index: unable to write file tessdata/chi_sim5.uming.tif
error: git checkout-index: unable to write file tessdata/chi_sim5.word-dawg
fatal: cannot create directory at 'tessdata/configs': No space left on device
Traceback (most recent call last):
File "/home/ododoo/magicDroid/.repo/repo/main.py", line 235, in <module>
_Main(sys.argv[1:])
File "/home/ododoo/magicDroid/.repo/repo/main.py", line 217, in _Main
repo._Run(argv)
File "/home/ododoo/magicDroid/.repo/repo/main.py", line 123, in _Run
cmd.Execute(copts, cargs)
File "/home/ododoo/magicDroid/.repo/repo/subcmds/sync.py", line 299, in Execute
project.Sync_LocalHalf(syncbuf)
File "/home/ododoo/magicDroid/.repo/repo/project.py", line 638, in Sync_LocalHalf
self._InitWorkTree()
File "/home/ododoo/magicDroid/.repo/repo/project.py", line 1152, in _InitWorkTree
raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree
./android.sh: linje 35: cd: /home/ododoo/magicDroid/vendor/htc/sapphire-open/: No such file or directory
./android.sh: line 36: ./unzip-files.sh: No such file or directory

You're building on Linux

generic-eng simulator
Lunch menu... pick a combo:
1. generic-eng
2. simulator

Which would you like? [generic-eng] 1
find: `frameworks/base/api': No such file or directory

find: `frameworks/base/api': No such file or directory
find: `frameworks/base/api': No such file or directory
find: `frameworks/base/api': No such file or directory
find: `frameworks/base/api': No such file or directory
find: `frameworks/base/api': No such file or directory
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.1-update1
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
============================================
find: `frameworks/base/api': No such file or directory

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.1-update1
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=OPENMASTER
============================================
find: `frameworks/base/api': No such file or directory
Checking build tools versions...
************************************************************
You are attempting to build with the incorrect version
of java.

Your version is: java version "1.6.0_18".
The correct version is: 1.5.

Please follow the machine setup instructions at
http://source.android.com/download
************************************************************
build/core/main.mk:111: *** stop. Stop.
./android.sh: linje 43: cd: /home/ododoo/magicDroid/out/target/product/sapphire-open/: No such file or directory
Your files ready for flashing are here:
ls: kan ikke åpne *.img: No such file or directory
ododoo@ododoo-laptop:~$

So close...
 
Last edited:

Szusz

Senior Member
May 6, 2010
60
0
OK, compiled it (one note though, Ubuntu 10.4 uses OpenJava JDK instead of SunJava, so it has to be removed before compiling)

Got a lot of warnings and an error
Code:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
make: *** [out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar] Błąd 41
make: *** Oczekiwanie na niezakończone zadania....
elapsed seconds: 306
wrote generated Main_*.java files to out/host/linux-x86/obj/EXECUTABLES/vm-tests_intermediates/main_files
Your files ready for flashing are here:
boot.img  ramdisk.img  userdata.img

As you can see above there's no system.img file.

I belive that dferreira is using a 64bit OS and that's why the packages are like this

Code:
lib32readline5-dev lib32z-dev

so my apt line looks the one below (I'm on a 32bit OS; added a repo from Dapper Drake)

Code:
sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind libreadline5-dev gcc-multilib g++-multilib libc6-dev libncurses5-dev x11proto-core-dev libx11-dev libreadline5-dev libz-dev

I'm on a 2 core proc, so change the android.sh script to have
Code:
 make -j2

Trying to compile for the second time. Didn't work.

Updated SunJava JDK to 1.5.18 and it did work. Created all img files properly. Flashed three mentioned in the first post to the phone and now waiting for about 5 minutes for the phone to boot up. Hopefully it will work.
 
Last edited:

dferreira

Senior Member
Jan 26, 2007
1,800
426
41
Oulu
www.denzilferreira.com
Yes, I'm using 64bit version Ubuntu 10.04 :)

@ododoo: Your download of the source code was interrupted for some reason, re-run the script until it finishes successfully.

@Szusz: I'll add your apt-get line to the initial post, so that others can follow. Can you tell me what you added to /etc/apt/sources.list from DDrake?

Another thing I feel I should mention. The rom has an unoptimized version of the linux kernel + wlan that matches it. This rom is intended to allow us to have up-to-date OS built from source, for development, not to be a speed rocket.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Tired of using someone else wrapped up Android OS? If you are like me, you probably would like to take control over what you are using on your device. There isn't any Market or any Google Applications on this. This is intended for developing applications and have a working phone using the latest Android OS for HTC Magic/Sapphire's.

    The recommended system for downloading and compiling Android OS from source (AOSP - Android Open-Source Project) is Ubuntu. I have a Mac with Snow Leopard, so I use VirtualBox to run a virtual machine that has Ubuntu installed on it. Once you have Ubuntu installed on the virtual machine, you need to prepare it so that you can download and compile successfully AOSP.

    First, make sure your OS is up-to-date, by running the Update Manager from the System>Administration menu. Once that is completed, go to Applications>Accessories and open Terminal.

    Type this command to install all the needed libraries (this is all one line) - Ubuntu 10.04 64Bits:
    Code:
    sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind lib32readline5-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev

    Type this command to install all the needed libraries (this is all one line) - Ubuntu 32Bits (thanks to Szusz!):
    Edit your /etc/apt/sources.list and add these lines on the end:
    Code:
    deb pl.archive.ubuntu.com/ubuntu/ jaunty multiverse
    deb pl.archive.ubuntu.com/ubuntu/ jaunty universe
    Code:
    sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind libreadline5-dev gcc-multilib g++-multilib libc6-dev libncurses5-dev x11proto-core-dev libx11-dev libreadline5-dev libz-dev

    Prepare the OS to run Java 5.0, which is the only compatible Java version for compiling. Recent versions of Ubuntu don't need this step (10.04+).
    Code:
    sudo update-java-alternatives -s java-1.5.0-sun

    Fix a dependency with X11 (64Bits):
    Code:
    sudo ln -s /usr/lib32/libX11.so.6 /usr/lib32/libX11.so

    Fix a dependency with X11 (32Bits):
    Code:
    sudo ln -s /usr/lib/libX11.so.6 /usr/lib/libX11.so

    That's it for the Operative system. Now the tool that Google uses to control the source files is Repo. To install type this:
    Code:
    cd ~
    mkdir bin
    curl http://android.git.kernel.org/repo >~/bin/repo
    chmod a+x ~/bin/repo
    PATH="$HOME/bin:$PATH"

    Now to download the source files, compile etc, all you need to do is to copy this text to a file in Ubuntu (to create one, just type "gedit android.sh"):
    PHP:
    #!/bin/bash
    #Created by dferreira (lizned.arierref@gmail.com)
    #Checkout and compile master repositories out of source.android.com
    
    SOURCE_FOLDER=~/magicDroid
    BRANCH="master";
    KERNEL="android-msm-2.6.32";
    
    #Check for Repo
    if [ ! -f ~/bin/repo ]
    then
        cd ~
        mkdir bin
        curl http://android.git.kernel.org/repo >~/bin/repo
        chmod a+x ~/bin/repo
        PATH="$HOME/bin:$PATH"
    fi
    
    #Create project folder
    if [ ! -d $SOURCE_FOLDER ]
    then
    	mkdir $SOURCE_FOLDER
    fi
    
    cd $SOURCE_FOLDER
    
    #clean old compiled files, there can be new stuff!
    make installclean
    make clean
    
    #Get updated source files from AOSP
    repo init -u git://android.git.kernel.org/platform/manifest.git -b $BRANCH
    git clone git://android.git.kernel.org/kernel/msm.git -b $KERNEL #clone latest kernel project
    cd $SOURCE_FOLDER/msm 
    git pull #check if anything new
    cd $SOURCE_FOLDER
    repo sync #update repo's
    
    #Get HTC drivers if they don't exist already on folder
    cd ~/magicDroid
    if [ ! -f sapphire_update.zip ]
    then	
    	wget --referer=http://developer.htc.com/google-io-device.html http://member.america.htc.com/download/RomCode/ADP/signed-google_ion-ota-14721.zip?
    	mv signed-google_ion-ota-14721.zip sapphire_update.zip
    fi
    
    #unzip the proprietary files from HTC for Sapphire
    if [ ! -d vendor/htc/sapphire/proprietary ]
    then
    	cd $SOURCE_FOLDER/device/htc/sapphire/
    	./unzip-files.sh
    fi
    
    #Compile latest kernel
    cd $SOURCE_FOLDER/msm
    make ARCH=arm msm_defconfig
    make ARCH=arm CROSS_COMPILE=$SOURCE_FOLDER/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- zImage -j4
    
    #copy kernel to source if success!
    if [ -f $SOURCE_FOLDER/msm/arch/arm/boot/zImage ]
    then
    	cp $SOURCE_FOLDER/msm/arch/arm/boot/zImage $SOURCE_FOLDER/device/htc/dream-sapphire/kernel
    fi
    
    #Compile wifi module to match the kernel
    cd $SOURCE_FOLDER/system/wlan/ti/sta_dk_4_0_4_32
    make KERNEL_DIR=$SOURCE_FOLDER/msm/ ARCH=arm CROSS_COMPILE=$SOURCE_FOLDER/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- -j4
    
    #copy updated wlan.ko that matches the kernel
    if [ -f $SOURCE_FOLDER/system/wlan/ti/sta_dk_4_0_4_32/wlan.ko ]
    then
    	cp $SOURCE_FOLDER/system/wlan/ti/sta_dk_4_0_4_32/wlan.ko $SOURCE_FOLDER/device/htc/dream-sapphire/wlan.ko
    fi
    
    #setup compiling environment and build images
    cd $SOURCE_FOLDER
    . build/envsetup.sh
    
    #cd $SOURCE_FOLDER
    lunch
    make -j4
    
    #get to compiled folder
    cd $SOURCE_FOLDER/out/target/product/sapphire/
    echo 'Your files ready for flashing are here:'
    ls *.img

    Save the file and make it executable with:
    Code:
    chmod 755 android.sh

    To run it, just type:
    Code:
    ./android.sh

    That's it! Now just follow the instructions. It should ask for your name, email and then later to what device are you compiling. The script that you put on the text file is meant for Sapphire, so you should choose option that has sapphire on it, US version or EU version, with ENG on it, which will make the compiled OS with root access.

    In the end, you'll have a set of .img files, ready to be installed on your device.

    Using your favourite recovery, wipe everything before flashing the OS and then boot into fastboot. I'm pretty sure that if you really want to compile your own OS, you already know how to use fastboot. But anyway:
    fastboot flash boot boot.img
    fastboot flash system system.img
    fastboot flash userdata userdata.img

    Reboot your device and enjoy your own OS.

    If you run into trouble, let me know.

    Some fixes you might be interested:
    Enable JIT on DalvikVM
    Edit dalvik/vm/Android.mk
    Code:
    ifeq ($(TARGET_ARCH_VARIANT),armv5te)
        WITH_JIT := true
    endif
    Edit vendor/htc/sapphire/BoardConfigVendor.mk
    Code:
    WITH_JIT := true
    ENABLE_JSC_JIT := true

    Add support for audio+video recording on camera
    Code:
    We need to add BUILD_WITH_FULL_STAGEFRIGHT := true to your vendor's Buildxxx.mk to be able to record audio+video on the camera.
    Another property that needs to be active: Thanks to Jubeh

    If you want to run this on 32A's, you need to replace the kernel for a 32A one and you should be good to go.

    Fix the prelinks issues. Make sure to make a backup of the file (build/core/prelink-linux-arm.map) because I'm almost sure it will get officially fixed in the future.
    PHP:
    # 0xC0000000 - 0xFFFFFFFF Kernel
    # 0xB0100000 - 0xBFFFFFFF Thread 0 Stack
    # 0xB0000000 - 0xB00FFFFF Linker
    # 0xA0000000 - 0xBFFFFFFF Prelinked System Libraries
    # 0x90000000 - 0x9FFFFFFF Prelinked App Libraries
    # 0x80000000 - 0x8FFFFFFF Non-prelinked Libraries
    # 0x40000000 - 0x7FFFFFFF mmap'd stuff
    # 0x10000000 - 0x3FFFFFFF Thread Stacks
    # 0x00000000 - 0x0FFFFFFF .text / .data / heap
    
    # Note: The general rule is that libraries should be aligned on 1MB
    # boundaries. For ease of updating this file, you will find a comment
    # on each line, indicating the observed size of the library, which is
    # one of:
    #
    #     [<64K] observed to be less than 64K
    #     [~1M] rounded up, one megabyte (similarly for other sizes)
    #     [???] no size observed, assumed to be one megabyte
    
    # core system libraries
    libdl.so                0xAFF00000 # [<64K]
    libc.so                 0xAFD00000 # [~2M]
    libstdc++.so            0xAFC00000 # [<64K]
    libm.so                 0xAFB00000 # [~1M]
    liblog.so               0xAFA00000 # [<64K]
    libcutils.so            0xAF900000 # [~1M]
    libthread_db.so         0xAF800000 # [<64K]
    libz.so                 0xAF700000 # [~1M]
    libevent.so             0xAF600000 # [???]
    libssl.so               0xAF400000 # [~2M]
    libcrypto.so            0xAF000000 # [~4M]
    libsysutils.so          0xAEF00000 # [~1M]
    
    # bluetooth
    liba2dp.so              0xAEE00000 # [~1M]
    audio.so                0xAED00000 # [~1M]
    input.so                0xAEC00000 # [~1M]
    libbluetoothd.so        0xAEA00000 # [~2M]
    libbluedroid.so         0xAE900000 # [<64K]
    libbluetooth.so         0xAE800000 # [~1M]
    libdbus.so              0xAE700000 # [~1M]
    
    # extended system libraries
    libril.so               0xAE600000 # [~1M]
    libreference-ril.so     0xAE500000 # [~1M]
    libwpa_client.so        0xAE400000 # [<64K]
    libnetutils.so          0xAE300000 # [~1M]
    
    # core dalvik runtime support
    libandroid_servers.so   0xAE200000 # [~1M]
    libicuuc.so             0xADE00000 # [~4M]
    libicui18n.so           0xAD900000 # [~5M]
    libandroid_runtime.so   0xAD300000 # [~6M]
    libnativehelper.so      0xAD100000 # [~2M]
    libdvm-ARM.so           0xAD000000 # [???]
    libdvm.so               0xACA00000 # [~6M]
    # Note: libicudata.so intentionally omitted
    
    # graphics
    libpixelflinger.so      0xAC900000 # [~1M]
    # libcorecg is for backward-compatibility with donut
    libcorecg.so            0xAC800000 # [???]
    libsurfaceflinger_client.so 0xAC700000 # [~1M]
    libsurfaceflinger.so    0xAC500000 # [~2M]
    libGLES_android.so      0xAC400000 # [~1M]
    libagl.so               0xAC300000 # [???]
    
    libGLESv1_CM.so         0xAC200000 # [~1M]
    libGLESv2.so            0xAC100000 # [~1M]
    libOpenVG_CM.so         0xAC000000 # [???]
    libOpenVGU_CM.so        0xABF00000 # [???]
    libEGL.so               0xABE00000 # [~1M]
    libETC1.so              0xABD00000 # [<64K]
    
    libacc.so               0xABC00000 # [~1M]
    
    libexif.so              0xABB00000 # [~1M]
    libcamera_client.so     0xABA80000 # [~1M]
    libui.so                0xAB900000 # [~1M]
    # libsgl is for backward-compatibility with donut
    libsgl.so               0xAB800000 # [???]
    libskia.so              0xAB100000 # [~7M]
    librs_jni.so            0xAB000000 # [~1M]
    libRS.so                0xA9E00000 # [~2M]
    libjnigraphics.so       0xA9D00000 # [<64K]
    libskiagl.so            0xA9C00000 # [~1M]
    
    # audio
    libFLAC.so              0xA9B00000 # [???]
    libaudiopolicy.so       0xA9A00000 # [~1M]
    libaudiopolicygeneric.so 0xA9900000 # [???]
    libsoundpool.so         0xA9800000 # [~1M]
    libgps.so               0xA9700000 # [~1M]
    libspeech.so            0xA9600000 # [~1M]
    liboemcamera.so         0xA9400000 # [~1M]
    libmedia_jni.so         0xA9300000 # [~1M]
    libmediaplayerservice.so 0xA9200000 # [~1M]
    libmedia.so             0xA9000000 # [~2M]
    libFFTEm.so             0xA8F00000 # [~1M]
    libSR_AudioIn.so        0xA8E00000 # [~1M] for external/srec
    libaudioflinger.so      0xA8D00000 # [~1M]
    
    # assorted system libraries
    libsqlite.so            0xA8B00000 # [~2M]
    libexpat.so             0xA8A00000 # [~1M]
    libwebcore.so           0xA8300000 # [~7M]
    libbinder.so            0xA8200000 # [~1M]
    libutils.so             0xA8100000 # [~1M]
    libcameraservice.so     0xA8000000 # [~1M]
    libhardware.so          0xA7F00000 # [<64K]
    libhardware_legacy.so   0xA7E00000 # [~1M]
    libapp_process.so       0xA7D00000 # [???]
    libsystem_server.so     0xA7C00000 # [~1M]
    libime.so               0xA7B00000 # [???]
    libaudio.so             0xA7A00000 # [~1M]
    libcamera.so            0xA7900000 # [~1M]
    libsonivox.so           0xA7800000 # [~1M]
    libvorbisidec.so        0xA7700000 # [~1M]
    libdiskconfig.so        0xA7600000 # [<64K]
    libemoji.so             0xA7500000 # [<64K]
    libjni_latinime.so      0xA7400000 # [~1M]
    libjni_pinyinime.so     0xA7300000 # [~1M]
    libttssynthproxy.so     0xA7200000 # [~1M] for frameworks/base
    libttspico.so           0xA7000000 # [~2M] for external/svox
    
    # pv libraries
    libpvasf.so                    0xA6F00000 # [???]
    libpvasfreg.so                 0xA6E00000 # [???]
    libomx_sharedlibrary.so        0xA6D00000 # [~1M]
    libopencore_download.so        0xA6C00000 # [~1M]
    libopencore_downloadreg.so     0xA6B00000 # [~1M]
    libopencore_net_support.so     0xA6800000 # [~3M]
    libopencore_rtsp.so            0xA6200000 # [~6M]
    libopencore_rtspreg.so         0xA6100000 # [~1M]
    libopencore_author.so          0xA5D00000 # [~4M]
    libomx_aacdec_sharedlibrary.so 0xA5B00000 # [~2M]
    libomx_amrdec_sharedlibrary.so 0xA5A00000 # [~1M]
    libomx_amrenc_sharedlibrary.so 0xA5900000 # [~1M]
    libomx_avcdec_sharedlibrary.so 0xA5800000 # [~1M]
    libomx_avcenc_sharedlibrary.so 0xA5700000 # [???]
    libomx_m4vdec_sharedlibrary.so 0xA5600000 # [~1M]
    libomx_m4venc_sharedlibrary.so 0xA5500000 # [???]
    libomx_mp3dec_sharedlibrary.so 0xA5400000 # [~1M]
    libopencore_mp4local.so        0xA5200000 # [~2M]
    libopencore_mp4localreg.so     0xA5100000 # [~1M]
    libopencore_player.so          0xA4800000 # [~9M]
    
    # opencore hardware support
    libmm-adspsvc.so              0xA4700000 # [<64K]
    libOmxCore.so                 0xA4600000 # [<64K]
    libOmxMpeg4Dec.so             0xA4500000 # [~1M]
    libOmxH264Dec.so              0xA4400000 # [~1M]
    libOmxVidEnc.so               0xA4300000 # [~1M]
    libopencorehw.so              0xA4200000 # [~1M]
    libOmxVdec.so                 0xA4100000 # [~1M]
    libmm-omxcore.so              0xA4000000 # [<64K]
    
    # pv libraries
    libopencore_common.so         0xA3900000 # [~7M]
    libqcomm_omx.so               0xA3800000 # [<64K]
    
    # stagefright libraries
    libstagefright_amrnb_common.so     0xA3700000 # [~1M]
    libstagefright_avc_common.so       0xA3600000 # [~1M]
    libstagefright_color_conversion.so 0xA3500000 # [<64K]
    libstagefright_omx.so              0xA3400000 # [~1M]
    libstagefrighthw.so                0xA3300000 # [~1M]
    libstagefright.so                  0xA2F00000 # [~4M]
    
    # libraries for specific hardware
    libgsl.so               0xA2E00000 # [~1M]
    libhtc_acoustic.so      0xA2D00000 # [<64K]
    libhtc_ril.so           0xA2C00000 # [~1M]
    liblvmxipc.so           0xA2B00000 # [~1M] for vendor/nxp
    libreference-cdma-sms.so 0xA2A00000 # [<64K] for hardware/ril
    
    # libraries for specific apps or temporary libraries
    libcam_ipl.so           0x9F000000 # [???]
    libwbxml.so             0x9EF00000 # [???]
    libwbxml_jni.so         0x9EE00000 # [~1M]
    libxml2wbxml.so         0x9EB00000 # [~1M]
    libdrm1.so              0x9EA00000 # [~1M]
    libdrm1_jni.so          0x9E900000 # [<64K]
    libwapcore.so           0x9E800000 # [???]
    libstreetview.so        0x9E700000 # [???]
    libwapbrowsertest.so    0x9E600000 # [???]
    libminiglobe.so         0x9E500000 # [???]
    libearth.so             0x9E400000 # [???]
    libembunit.so           0x9E300000 # [<64K]
    libneon.so              0x9E200000 # [???]
    libjni_example.so       0x9E100000 # [???]
    libjni_load_test.so     0x9E000000 # [???]
    libjni_lib_test.so      0x9DF00000 # [???]
    librunperf.so           0x9DE00000 # [???]
    libctest.so             0x9DD00000 # [<64K]
    libUAPI_jni.so          0x9DC00000 # [???]
    librpc.so               0x9DB00000 # [~1M]
    libtrace_test.so        0x9DA00000 # [???]
    libsrec_jni.so          0x9D800000 # [~2M]
    libjpeg.so              0x9D700000 # [~1M]
    libiprouteutil.so       0x9D600000 # [~1M] for external/iproute2
    libnetlink.so           0x9D500000 # [<64K] for external/iproute2
    libpagemap.so           0x9D400000 # [<64K] for system/extras/libpagemap
    libstlport.so           0x9D100000 # [~3M] for external/stlport
    libzxing.so             0x9D000000 # [<64K] for goggles
    libinterstitial.so      0x9CF00000 # [<64K] for goggles
    liblept.so              0x9CA00000 # [~5M] for external/leptonica

    How to fix the camera:
    http://xdaforums.com/showpost.php?p=7405081&postcount=502 Drivers part
    http://xdaforums.com/showpost.php?p=7136150&postcount=447 Kernel part

    ---------------------

    In case you don't want to do it yourself, you can just download this package, and flash it from recovery.

    AOSP FROYO 2.2 v3.1

    v3.1 - thanks to Jack for debugging it!
    - Bootanimation is working!
    - Wifi + Kernel from Cyanogen, as mine went boggus and I can't test it if it works without a device.
    - Full APN list
    - Known bugs: camera onscreen controls do FC sometimes. Switching from camera to camcorder works, but fc when reverting back.

    v3
    - Live wallpapers support.
    - Sound recorder is now visible to the user to use.
    - All available languages are included.
    - Fixed missing sound files.
    - Cyanogen's camera fixes are included. Really a pleasure to learn from what he has done!

    v2.1
    - Fixed camera - Use v2 and replace the boot.img with this one

    What's on it:
    v2
    - Fixed GPS (was missing gps.conf + libgps.so was being allocated to wrong prelink).
    - Fixed all prelink errors by mapping all the libraries to the correct mmap banks (edited build/core/prelink-linux-arm.map).
    - Replaced Gallery3D (not complete at sources) by old enhanced Gallery (multitouch working!)
    - Added the Text-To-Speech libraries from source (got those from sdk.mk)
    - Fixed missing sounds (Lock.ogg and Unlock.ogg in OriginalSounds.mk)
    - Camera still not working, but now we don't have a prelink error, so should be fixable by replacing liboemcamera.so by one that works - maybe Cyanogen's??)
    - Bootanimation still not working... (i've looked into it and I can't figure out why it doesn't!)

    v1
    - AOSP 2.2 Froyo
    - WiFi + Kernel 2.6.32 up and running.
    - 3D Drivers
    - JIT + JIT JSC enabled
    - Multi-touch zoom on browser

    Doesn't work:
    - No boot animation, screen stays blank while booting but you can check it out using "adb logcat"
    - Camera
    - Gallery has missing mdpi graphics, I'll fix it later
    2
    yeah i know :) gonna mess a bit with it, nice with the linker :)
    1
    So actually everythings work except camera?

    How is this in terms of speed? : D
    The speed is not an issue. All the rest works, orientation, LED's etc. Only the camera doesn't because there is no open-source drivers for it on the repositories.
    1
    Awesome work mate!

    Two questions though.

    1. Which Radio version is required?
    2. Can I install the gapps from Cyanogenmod for instance?

    Cheers,
    Szusz
    Any radio will work. And yes, you can add gapps add-on from Cyanogen if you wish.