Building donut for dream – Second attempt: a home screen

The first attempt was not a success, but based on the discussion at http://groups.google.com/group/android-platform/browse_thread/thread/929aa624d2da63a7 I decided to make another build with less proprietary files.

Before the patch with the extracting and adding of the extra proprietary files was applied on the source tree (master, cupcake and donut) there was a small list of proprietary files. I used that list again with libcamera.so added because otherwise you cannot make a build. I kept the extract-files.sh the same because I doesn’t matter if the files are inside the proprietary directory. I changed the AndroidBoard.mk file  inside the ~/mydroid/vendor/htc/dream-open to this (only showing the htc proprietary section, the rest is kept the same)

# htc proprietary code
#
proprietary := $(LOCAL_PATH)/proprietary

PRODUCT_COPY_FILES += \
   $(proprietary)/akmd:system/bin/akmd

PRODUCT_COPY_FILES += \
   $(proprietary)/AudioFilter.csv:system/etc/AudioFilter.csv \
   $(proprietary)/AudioPara4.csv:system/etc/AudioPara4.csv \
   $(proprietary)/gps.conf:system/etc/gps.conf \
   $(proprietary)/brf6300.bin:system/etc/firmware/brf6300.bin \
   $(proprietary)/tiwlan.ini:system/etc/wifi/tiwlan.ini \
   $(proprietary)/Fw1251r1c.bin:system/etc/wifi/Fw1251r1c.bin

PRODUCT_COPY_FILES += \
   $(proprietary)/libaudioeq.so:system/lib/libaudioeq.so \
   $(proprietary)/libgps.so:system/lib/libgps.so \
   $(proprietary)/libhgl.so:system/lib/libhgl.so \
   $(proprietary)/libhtc_acoustic.so:system/lib/libhtc_acoustic.so \
   $(proprietary)/libhtc_ril.so:system/lib/libhtc_ril.so \
   $(proprietary)/libOmxCore.so:system/lib/libOmxCore.so \
   $(proprietary)/libqcamera.so:system/lib/libqcamera.so \
   $(proprietary)/libcamera.so:system/lib/libcamera.so

PRODUCT_COPY_FILES += \
   $(proprietary)/libgps.so:obj/lib/libgps.so \
   $(proprietary)/libOmxCore.so:obj/lib/libOmxCore.so

After the build is finished, I flashed the images again to the phone and did a reboot. This time donut boots and shows a home screen.

Donut Home Screen

Donut Home Screen

About phone screen

About phone screen

Although the phone boots, you can’t do anything serious with it. For example you cannot make phone calls because the simcard is not recognized. This also prevents the use of 3G connection. When enabling Wifi the system crashes and reboots (and ends in an endless boot sequence because Wifi is set to enabled but cannot be started).  The camera and media playing seems to work fine. But missing the phone functionality makes it not useful.

So next question is, how to get the phone functionality working? When looking at the proprietary files which are not added this time to the image, I did not find one related to this functionality. So is it related to something else or should we search for the solution inside the closed parts of the Android Dev Phone (maybe the radio part)?

If the issue is related to the closed parts of the system, then we should wait for HTC when they provide us with an updated version of the proprietary files. It is a pity that this dependency exists for a open sourced operating system. Shouldn’t it be possible to develop open variants of the proprietary files by looking at the hardware specifications of the Dream?

To be continued… (hopefully soon)

Read more from the Uncategorized category. If you would like to leave a comment, click here: 4 Comments. or stay up to date with this post via RSS, or you can Trackback from your site.

Building donut for dream – First attempt: a black screen

Yesterday I started downloading the source code from the donut branch again to see if it was possible to get it running on the HTC Dream (Android Dev Phone).

I build the source the same way as building cupcake but this time I used the defaults (like the prebuilt kernel and wlan.ko module) and did not change the htc_dream.mk build script.

The libcamera.so proprietary file is needed (and should be extracted from the official image) to make a sucessfull build (succesfull like that it builds). This is a difference with cupcake.

After flashing the phone, it shows the two boot logo’s and than a black screen. Looking at the debug information (shown inside logcat within Eclipse) you can see that there is an endless loop whereby android crash (the system_server) and is started over again (and crash… etc). Some of the errors are shown in this discussion (http://groups.google.com/group/android-platform/browse_thread/thread/929aa624d2da63a7).

So not a bootable donut version yet. For the record the steps I took

Initialize repo and get the source

cd ~
mkdir mydroid
cd mydroid
repo init -u git://android.git.kernel.org/platform/manifest.git -b donut
repo sync

Extract proprietary files (after source is downloaded)

cd ~/mydroid/vendor/htc/dream-open
./extractfiles.sh

You can also use the unyaffs method (described in this post http://www.johandekoning.nl/index.php/2009/06/07/building-android-15-getting-the-source/). But don’t forget to copy the libcamera.so from the lib folder

cp ~/htc/lib/libcamera.so ~/mydroid/vendor/htc/dream-open/proprietary/libcamera.so

Build source

Create a buildspec.mk file (inside the ~/mydroid directory) to define that a htc-dream build should be made. Because the prebuilt kernel is used, the file has the following contents:

TARGET_PRODUCT:=htc_dream

Save the file and start the make command from the mydroid directory

make

Flashing the phone

After build is finished flash the image files to your phone within fastboot (more details at http://www.johandekoning.nl/index.php/2009/07/03/building-android-1-5-flashing-the-phone/).

fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash recovery recovery.img
fastboot flash userdata userdata.img

And reboot the device

fastboot reboot

Result

Now you will have a non bootable donut version :) I will try a second attempt whereby I use less proprietary files to see if it boots (this suggestion is made in the same discussion about building donut http://groups.google.com/group/android-platform/browse_thread/thread/929aa624d2da63a7)

Read more from the Uncategorized category. If you would like to leave a comment, click here: 2 Comments. or stay up to date with this post via RSS, or you can Trackback from your site.

Proprietary patch is now part of Android source tree

When building Android 1.5 (cupcake) for the HTC Dream (Android Dev Phone), you had to apply patch (10899) with to command

repo download platform/vendor/htc/dream-open 10889/4

But this patch is now part of the android source tree (for the tree different branches: master, cupcake and donut). This will simplify the build process and therefore I will update the blogpost.

There is also the discussion with the different branches (which one to use). Inside the building Android 1.5 posts I use the cupcake-release branch. There is a good explaination about the different branches written by Jean-Baptiste Queru at http://groups.google.com/group/android-platform/browse_thread/thread/3670ed63a7d9e3ab Reading this post I decide from the development perspective to update the blogposts so that the cupcake branch is used.

While there is less development on the cupcake branch, I did not managed to get a working donut build. Will download the source code again in the coming days to perform another build. I will post the results on this blogpost.

Read more from the Uncategorized category. If you would like to leave a comment, click here: 1 Comment. or stay up to date with this post via RSS, or you can Trackback from your site.

New Android 1.5 branch available

Inside the Android repository there is a new branch available with the name cupcake-release. On the Android Platform Forum (http://groups.google.com/group/android-platform/browse_thread/thread/4853d33c28abb5f5) this is what being said about this new branch

cupcake-release is the branch that is used to build devices, whereas
cupcake is the branch that is used to build the SDK (we separate them
for a variety of reasons). Until 1.5r2 (mid-May) they were identical
for all practical purposes, so the distinction (which had existed on
our internal servers for a long time) didn’t get reflected on the
outside, but since mid-May they’ve been drifting a bit and we decided
to reflect the differences on the outside.

The current state of cupcake-release is a loose match for the CRC01
release that is being deployed to some consumer devices.

Admittedly, we still need to do a better job at matching the various
forms of the version numbers, especially for the device builds.

I updated the blogposts about building Android 1.5. It will now use the cupcake-release branch. So read the blogposts (again) if you want to build your own Android version based on this source.

Read more from the Uncategorized category. If you would like to leave a comment, click here: 12 Comments. or stay up to date with this post via RSS, or you can Trackback from your site.

Building Android 1.5 – Chinese translation

Weiguo (a visitor of this website) made a chinese translation of the building Android 1.5 blogpost serie. So if you prefer chinese you can find the details here http://www.hiapk.com/bbs/thread-7714-1-1.html

FYI This version and the chinese version are not updated together (by one person). So difference between the two versions will probaly occur

Read more from the Uncategorized category. If you would like to leave a comment, click here: Comment. or stay up to date with this post via RSS, or you can Trackback from your site.

Building Android 1.5 – Google Apps and audio files

Note 30 july 2009: updated the post. It now reflects the changes made to the repository (dream is now called dream-open)

Note 13 july 2009: Vladimir Stepanov post a reply today, telling me that the media files are already part of the source tree and can be found at ~/mydroid/fameworks/base/data/sounds. Adding the media files is a lot easier this way. I changed this blogpost about how to include those media files inside the system image.

This will be (for now) the last post of the building Android 1.5 for the Android Dev Phone. In the previous posts I explained how to prepare your building environment (Ubuntu 8.04), get the source and make it ready for building, building the source and finaly flash it to your device. Your own build should be working fine, but comparing to the official builds you are missing the Google applications like GMail, Google Maps, Android Market and YouTube. Besides the applications missing there are also no ringtones available on your device.

In this blogpost you will extract the Google Applications and media files from the official HTC Android 1.5 image (this can be done by extracting them from your device or with the use of unyaffs). The extracted files will be added to your own Android image. This results in an Android build which is almost the same as the HTC version.

Note: it is also possible to install the applications and add the media files while your device is running. But the purpose of this blog post is to create your own image which can be flashed over and over again (or even exchanged between other Android Dev Phone users)

Audio Files

In the official HTC image (http://www.htc.com/www/support/android/adp.html) a system/media directory exists which contains audio files for the alarms, notifications, ringtones and ui. These audio files are also part of the source tree but are not included by default.

Inside the ~/mydroid/frameworks/base/data/sounds folder you will find the different audio files. Together with those audio files there are two build scripts: OriginalAudio.mk and AudioPackage2.mk (containing a larger audio pack). Just rename one of those two script to Android.mk.

mv ~/mydroid/frameworks/base/data/sounds/OriginalAudio.mk ~/mydroid/frameworks/base/data/sounds/Android.mk

You can create a new image by running the make command from ~\mydroid location. The make command will not compile everything again. Only the changed files. In our case nothing will be recompiled, only the media files will be added to the system.img.

After the make command is finished you can flash the new image to your phone. If you are already running your own build, you only need to flash the system.img. You can found more details about the flash process at the Flashing The Phone blogpost.

Google Applications

Besides the missing audio files, are also the closed source Google Applications not installed. The following list of applications are not installed

checkin.apk (needed for login with Google Account)
Gmail.apk
GmailProvider.apk (the synchronization module for GMail)
GoogleApps.apk
GoogleContactsProvider.apk (replacement for the ContactsProvider. This version will synchronize with your Google Contacts)
GooglePartnerSetup.apk
GoogleSettingsProvider.apk
GoogleSubscribedFeedsProvider.apk (replacement for the  SubscribedFeedsProvider.apk)
gtalkservice.apk (for Google Talk)
Maps.apk (Google Maps)
MediaUploader.apk
NetworkLocation.apk (for determining your location based on network cells)
SetupWizard.apk (for setting up your Google Account connected with your device)
Street.apk (Google Maps StreetView)
Talk.apk (Google Talk application)
Vending.apk (Android Market applicatioN)
VoiceSearch.apk (Voice Search)
YouTube.apk (YouTube application)

Note: the HTC image does have more  application installed by default. But I think those are not relevant for your own build but HTC related: BugReport.apk, DebugTool.apk, FieldTest.apk, HtcLog.apk and QxdmLog.apk. Let me know if you think (with some information) that these packages should be part of your own build. Also the use/need of the Ftp.apk package is not clear. And I did not add the SystemUpdater.apk because this is your own build so you should provide updates for it (and not HTC/Google).

The Google applications make use of extra libraries and permission files. So also these files should be part of our build:

com.google.android.gtalkservice.jar (is placed inside the framework directory of the system image and will be used with GoogleTalk)
com.google.android.maps.jar (also part of the framework and is use by Google Maps)
com.google.android.gtalkservice.xml  (permission file for gtalkservice library, placed inside the etc\permissions directory)
com.google.android. maps.xml (permission file for maps library, placed inside the etc\permissions directory)

Just like with the media files, the extracting of these files can be done with adb or unyaffs. The keep thing seperated, I decided to put the extracted files inside the ~/mydroid/vendor/google directory. Because the google directory does not exist, go to the ~/mydroid/vendor location and create the google folder.

cd ~/mydroid/vendor
mkdir google
cd google

Extracting with adb

The procedure for extracting the files with the adb tool is the same as with the media files. Just create a new script called extract-google-files.sh inside the ~/mydroid/vendor/google folder. Place the following commands inside the file

#!/bin/sh

mkdir -p app
adb pull /system/app/checkin.apk app/checkin.apk
adb pull /system/app/Gmail.apk app/Gmail.apk
adb pull /system/app/GmailProvider.apk app/GmailProvider.apk
adb pull /system/app/GoogleApps.apk app/GoogleApps.apk
adb pull /system/app/GoogleContactsProvider.apk app/GoogleContactsProvider.apk
adb pull /system/app/GooglePartnerSetup.apk app/GooglePartnerSetup.apk
adb pull /system/app/GoogleSettingsProvider.apk app/GoogleSettingsProvider.apk
adb pull /system/app/GoogleSubscribedFeedsProvider.apk app/GoogleSubscribedFeedsProvider.apk
adb pull /system/app/gtalkservice.apk app/gtalkservice.apk
adb pull /system/app/Maps.apk app/Maps.apk
adb pull /system/app/MediaUploader.apk app/MediaUploader.apk
adb pull /system/app/NetworkLocation.apk app/NetworkLocation.apk
adb pull /system/app/SetupWizard.apk app/SetupWizard.apk
adb pull /system/app/Street.apk app/Street.apk
adb pull /system/app/Talk.apk app/Talk.apk
adb pull /system/app/Vending.apk app/Vending.apk
adb pull /system/app/VoiceSearch.apk app/VoiceSearch.apk
adb pull /system/app/YouTube.apk app/YouTube.apk

mkdir -p etc/permissions
adb pull /system/etc/permissions/com.google.android.gtalkservice.xml etc/permissions/com.google.android.gtalkservice.xml
adb pull /system/etc/permissions/com.google.android.maps.xml etc/permissions/com.google.android.maps.xml

mkdir -p framework
adb pull /system/framework/com.google.android.gtalkservice.jar framework/com.google.android.gtalkservice.jar
adb pull /system/framework/com.google.android.maps.jar framework/com.google.android.maps.jar

Save and exit the editor. Make sure that your device is connected to Ubuntu. Execute the script by executing the command (from the location ~/mydroid/vendor/google)

./extract-google-files.sh

The different files, needed for the Google applications, will be extracted from your device and placed inside app, etc or framework directory. The build script should be updated so that those files are included inside your own build. This will be explained further in this blog post. First I will explain how to get the files with the use of unyaffs.

Extracting with unyaffs

For the media files I already explained how to use the unyaffs tool. So I presume that the system image is extracted inside the ~/htc directory. You only need to copy the files to the ~/vendor/google location. This will need some more commands than with the media files.

mkdir -p ~/mydroid/vendor/google/app
cp ~/htc/app/checkin.apk ~/mydroid/vendor/google/app/checkin.apk
cp ~/htc/app/Gmail.apk ~/mydroid/vendor/google/app/Gmail.apk
cp ~/htc/app/GmailProvider.apk ~/mydroid/vendor/google/app/GmailProvider.apk
cp ~/htc/app/GoogleApps.apk ~/mydroid/vendor/google/app/GoogleApps.apk
cp ~/htc/app/GoogleContactsProvider.apk ~/mydroid/vendor/google/app/GoogleContactsProvider.apk
cp ~/htc/app/GooglePartnerSetup.apk ~/mydroid/vendor/google/app/GooglePartnerSetup.apk
cp ~/htc/app/GoogleSettingsProvider.apk ~/mydroid/vendor/google/app/GoogleSettingsProvider.apk
cp ~/htc/app/GoogleSubscribedFeedsProvider.apk ~/mydroid/vendor/google/app/GoogleSubscribedFeedsProvider.apk
cp ~/htc/app/gtalkservice.apk ~/mydroid/vendor/google/app/gtalkservice.apk
cp ~/htc/app/Maps.apk ~/mydroid/vendor/google/app/Maps.apk
cp ~/htc/app/MediaUploader.apk ~/mydroid/vendor/google/app/MediaUploader.apk
cp ~/htc/app/NetworkLocation.apk ~/mydroid/vendor/google/app/NetworkLocation.apk
cp ~/htc/app/SetupWizard.apk ~/mydroid/vendor/google/app/SetupWizard.apk
cp ~/htc/app/Street.apk ~/mydroid/vendor/google/app/Street.apk
cp ~/htc/app/Talk.apk ~/mydroid/vendor/google/app/Talk.apk
cp ~/htc/app/Vending.apk ~/mydroid/vendor/google/app/Vending.apk
cp ~/htc/app/VoiceSearch.apk ~/mydroid/vendor/google/app/VoiceSearch.apk
cp ~/htc/app/YouTube.apk ~/mydroid/vendor/google/app/YouTube.apk

mkdir -p ~/mydroid/vendor/google/etc/permissions
cp ~/htc/etc/permissions/com.google.android.gtalkservice.xml ~/mydroid/vendor/google/etc/permissions/com.google.android.gtalkservice.xml
cp ~/htc/etc/permissions/com.google.android.maps.xml ~/mydroid/vendor/google/etc/permissions/com.google.android.maps.xml

mkdir -p ~/mydroid/vendor/google/framework
cp ~/htc/framework/com.google.android.gtalkservice.jar ~/mydroid/vendor/google/framework/com.google.android.gtalkservice.jar
cp ~/htc/framework/com.google.android.maps.jar ~/mydroid/vendor/google/framework/com.google.android.maps.jar

The different files needed for the application are now placed inside the app, etc and framework directory (at ~/mydroid/vendor/google). Next step is to edit the buildscripts

Changing the build script for the Google applications

The htc_dream.mk build script should be edited. I decided to change the htc_dream.mk build script so that it does not depend on the build/target/product/generic.mk script (which depends on the build/target/product.core.mk file). The reason I do this, is that I don’t want to have the generic providers be part of my own build. Those providers will be replaced with the Google specific version (so the ContactsProvider is not needed anymore because the GoogleContactsProvider will be used instead). I could off course remove them from the generic.mk and core.mk files, but I don’t want to edit those files to keep things seperated. Because the core.mk also contains packages which I don’t want to be part of the build, I cannot change the dependency of the htc_dream.mk from generic.mk to core.mk. So the dependencies will be completly removed.

At the point also the SdkSetup package is not needed anymore, because we are using the SetupWizard package. (The SdkSetup package does some small things like making it possible to make phone calls. This functionality is also part of the SetupWizard package).

To add the Google applications a PRODUCT_COPY_FILES section should be added to the htc_dream.mk file. We use PRODUCT_COPY_FILES because the packages are already in a binary format and only need to be copied to the system image.

One of the packages is the NetworkLocation package. This package contains functionality to determine your position based on network GSM cells. To get this package working an extra build property should be set. This can be done by adding the PRODUCT_PROPERTY_OVERRIDES variable to the htc_dream.mk file which contains the property ro.com.google.locationfeatures=1

The complete htc_dream.mk script (which can be find inside the ~/mydroid/vendor/htc/dream-open location) is placed below.

PRODUCT_PROPERTY_OVERRIDES := \
    ro.config.notification_sound=F1_New_SMS.ogg \
    ro.com.google.locationfeatures=1

PRODUCT_PACKAGES := \
    framework-res \
    Browser \
    Contacts \
    Launcher \
    HTMLViewer \
    Phone \
    DownloadProvider \
    GoogleSearch \
    MediaProvider \
    SettingsProvider \
    TelephonyProvider \
    UserDictionaryProvider \
    PackageInstaller \
    Bugreport \
    AlarmClock \
    AlarmProvider \
    Calendar \
    Camera \
    DrmProvider \
    LatinIME \
    Mms \
    Music \
    Settings \
    Sync \
    Updater \
    CalendarProvider \
    SyncProvider \
    Calculator \
    Email \
    ImProvider \
    VoiceDialer

PRODUCT_COPY_FILES := \
	vendor/google/app/checkin.apk:system/app/checkin.apk \
	vendor/google/app/Gmail.apk:system/app/Gmail.apk \
	vendor/google/app/GmailProvider.apk:system/app/GmailProvider.apk \
	vendor/google/app/GoogleApps.apk:system/app/GoogleApps.apk \
	vendor/google/app/GoogleContactsProvider.apk:system/app/GoogleContactsProvider.apk \
	vendor/google/app/GooglePartnerSetup.apk:system/app/GooglePartnerSetup.apk \
	vendor/google/app/GoogleSettingsProvider.apk:system/app/GoogleSettingsProvider.apk \
	vendor/google/app/GoogleSubscribedFeedsProvider.apk:system/app/GoogleSubscribedFeedsProvider.apk \
	vendor/google/app/gtalkservice.apk:system/app/gtalkservice.apk \
	vendor/google/app/Maps.apk:system/app/Maps.apk \
	vendor/google/app/MediaUploader.apk:system/app/MediaUploader.apk \
	vendor/google/app/NetworkLocation.apk:system/app/NetworkLocation.apk \
	vendor/google/app/SetupWizard.apk:system/app/SetupWizard.apk \
	vendor/google/app/Street.apk:system/app/Street.apk \
	vendor/google/app/Talk.apk:system/app/Talk.apk \
	vendor/google/app/Vending.apk:system/app/Vending.apk \
	vendor/google/app/VoiceSearch.apk:system/app/VoiceSearch.apk \
	vendor/google/app/YouTube.apk:system/app/YouTube.apk \
	vendor/google/etc/permissions/com.google.android.gtalkservice.xml:system/etc/permissions/com.google.android.gtalkservice.xml \
	vendor/google/etc/permissions/com.google.android.maps.xml:system/etc/permissions/com.google.android.maps.xml \
	vendor/google/framework/com.google.android.gtalkservice.jar:system/framework/com.google.android.gtalkservice.jar \
	vendor/google/framework/com.google.android.maps.jar:system/framework/com.google.android.maps.jar

# Overrides
PRODUCT_NAME := htc_dream
PRODUCT_DEVICE := dream-open
PRODUCT_MANUFACTURER := htc
PRODUCT_BRAND := generic
PRODUCT_POLICY := android.policy_phone

Save the file and exit the editor. The build script for the google applications is now ready. Before running the make command again remove the ~/mydroid/out/target/product/dream-open/system directory first. If you don’t remove this directory when you remove packages (like the SdkSetup) from your build, those packages will still be copied to your final build. The system directory contains the binary version of your system image but when you remove this directory the binary files will not be recompiled again (there are intermediates version inside the ~/mydroid/out/target/product/dream/obj directory

rm -rf ~/mydroid/out/target/product/dream-open/system

Now you can run the make command again (from the ~\mydroid locatin).  Like I already said, the make command will not compile everything again. Only the changed files. In our case nothing will be recompiled, only the google files will be added to the system.img.

After the make command is finished you can flash the new image to your phone. If you are already running your own build, you only need to flash the system.img. You can found more details about the flash process at the Flashing The Phone blogpost.

What’s next?

If you start your device with the image containing the Google applications files, the Setup Wizard will be shown. Complete the steps of this wizard to connect your Google Account to your device. You will now have an image running that contains the different Google applications which should run correctly (also the Calendar application should work now).

So that brings us to the end of the Building Android 1.5 series. I hoped you liked it and got enough information for making your own build. If not, just post a reply on one of the blog posts so that I can give you more details.  Although this is the final post of this blogpost serie, I will continue writing about Android (and other technologies). So look at my website often or follow me on Twitter to get updates.

Blogpost in the Building Android 1.5 serie

Read more from the Uncategorized category. If you would like to leave a comment, click here: 18 Comments. or stay up to date with this post via RSS, or you can Trackback from your site.

Building Android 1.5 – Flashing the phone

Note 30 july 2009: updated the post. It now reflects the changes made to the repository (dream is now called dream-open)

In the previous blog posts I described how to setup your build environment, get the Android source and how to build it for the Android Dev Phone. When you followed these steps you should now have an own version of the Android OS image available which can be flashed on your Android Dev Phone. But first, as usual, some preperations to make the flashing succesful.

Note: flashing your Android phone will remove your data from the phone (not the SD card). For example the SMS messages will be destroyed. It is possible to keep this “userdata” by NOT flashing the userdata partition. I found out that this can sometimes result in strange behaviors of the OS. Another option is to backup the data first (with applications from the Android Market)

Note: in my opinion flashing your Android will not brick your phone easily (brick means that you can only use your phone as a building block). You should be able to access the bootloader of the device even when your build does not work. But there is a possibility that things can go wrong. So I am not responsable for any damage to your phone. Know what you are doing. Besides the step by step walkthrough, I try to give you as much information so that you know why you are doing those steps. If you are not sure that what you are doing is right, just post a question to this blog or ask it on the Android Platform Forum  (http://groups.google.com/group/android-platform)

Radio image

The radio part of the Android OS for the Android Dev Phone is, just like the proprietary files, closed source. The radio part makes communication with the GSM network possible. This part is not build with the Android source code but can be downloaded at the HTC support site as separate download (http://www.htc.com/www/support/android/adp.html).

Because your build can be seen as an Android 1.5 version, it is important that you use the 1.5 version of the Radio image. Previous versions are not compatible.

The steps which I took to make sure that I have the right radio version on my phone and that it is working properly, is to flash the phone first to the official HTC 1.5 version of Android. If you already did that you can skip those steps. If you are not sure which radio version is running on your phone, follow these steps on your dev phone

Press menu (from the home screen)
Choose settings
Scroll down to the last option About Phone
At the bottom you will find information about which version is installed

The baseband version shows the radio image version which is in use. It should end with 2.22.19.16I (just like the download name ota-radio-2_22_19_26I). If this is not the case, you should first flash the phone with the HTC image for Android 1.5

The steps for flashing the phone with the HTC image are clearly described at http://www.htc.com/www/support/android/adp.html If you follow these steps (and use the Android 1.5 version) you should end with your dev phone running the HTC Android 1.5 version. I will give you some extra information which can be usefull during the flashing procedure.

About phone screen

About phone screen

Fastboot

For the update process described by HTC you will need the tool fastboot. You can download this tool from the same website as where you find the HTC images. Another option is to use your own version of fastboot which is created during the build process. You will find this application (which is in our case the Linux version) in ~/mydroid/out/host/linux-x86/bin. If you are a Windows user, you should use the fastboot executable provided by HTC. I don’t know if building the source on Mac OS X is as clear as on Ubuntu (it should be possible to compile the source) and that the fastboot version can be used.

Make sure that the fastboot utility location is inside the PATH variable. So that it can be found on the whole system independent on the location of which the terminal is currently active.

Connect ADP with Ubuntu

In a previous blog post I explained how to connect your device with Ubuntu which runs within VMWare as Virtual Machine. Those steps (http://www.johandekoning.nl/index.php/2009/02/07/android-dev-phone-ubuntu-and-vmware-server/) are also relevant when running Ubuntu natively (except for the VMWare steps).  Or follow the steps (when for example you want to use fastboot with Windows) which are written for the Android SDK http://developer.android.com/guide/developing/device.html

Flashing the device

So the HTC Android 1.5 version is running well? You made sure that the right radio version is installed? Fastboot is working properly? And made (optionally) a backup of your important data?

If that’s the case it is time for flashing the phone. The flashing part is quit easy and will take only a couple of minutes. First the device should be started in fastboot mode. The Android Dev Phone contains a bootloader which makes it possible to flash the phone. I think, but I am not sure, that this bootloader is always accessible (or you should execute some kind of operation which will destroy the bootloader part but I don’t know how to do that) making it possible to flash your Android over and over again with for example your own build (if your build is not working or you make changes) or the official HTC one.

To use fastboot execute the following steps on your device

If your device is running, shut is down
Power up the device while holding the BACK key
Hold the BACK key until you see a screen with the message Fastboot

The device is now in fastboot mode. The bootloader exists in different version. You can have a version with a rainbow background or one with skating Androids. It doesn’t matter, the flashing will work for both. Of course only when using a Dev Phone, the G1 does not support the flashing part.

The images which will be flashed to your device are inside the ~/mydroid/out/target/product/dream-open directory. So move to that directory and check if the following four images exists

You don’t have to flash all partitions on your Android device every time. If you don’t change the kernel than you can skip the boot image. But off course you should flash the boot partition for the first time because it is different than the HTC one.

From the ~/mydroid/out/target/product/dream-open directory, use the following commands to flash the phone

fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash recovery recovery.img
fastboot flash userdata userdata.img

Every fastboot command will send the image first to the device and (after succesfully received) will be written to the specific device partition. After all partitions are flashed succesfully you can reboot the device. This can be done by executing

fastboot reboot

It is also possible to exit fastboot by pressing Menu+CALL+END CALL button on your device.

It’s alive!

The first boot can take some time. You will get an Android splash screen, followed by another (grey logo) Android splash screen. Finally the home screen will be available. The Android system will be different comparing to the HTC version. A summary of what you can do and can’t with your own build.

Can

Can’t

What’s next?

I will write another post about how to add the Google Apps, Market and ringtones to your own build. For now the flashing part is completed (so turn on the lights again :D ). Questions and other feedback can be given to this post.

Blogpost in the Building Android 1.5 serie

Read more from the Uncategorized category. If you would like to leave a comment, click here: 31 Comments. or stay up to date with this post via RSS, or you can Trackback from your site.

Contribute to Android – My repo/git adventure

Note (29 july 2009): found out that the merge action is generating a empty change commit (which depends on change 9828 and is needed by my change). I started a discussion at http://groups.google.com/group/repo-discuss/browse_thread/thread/c9c29d4eca6c7989 and got a response that I should use git reset. Updated this post to reflect the new procedure

While I am still working on some blogpost about flashing the Android Dev Phone and adding the Google Apps, I was wondering if I can easily contribute some changes to the Android source tree. In my blog about getting the Android Source, I applied a patch and edit the extract-files.sh and AndroidBoard.mk inside vendor/htc/dream by hand so that all proprietary used for the HTC Dream are extracted from an ADP and added to your own Android system image. But wouldn’t it be nice when you just apply one patch and do not have to edit the files by hand. This is where the journey begins.

In the beginning…

Before making the changes to both scripts I started with a clean local source tree. I got the source (android-1.5r2 as described here) together with the specific htc vendor parts (by using the local_manifest.xml). After repo sync is finished, it is time to perform the changes which will result in a new patch.

When repo was asking for my name and emailaddress, I used my gmail account. If you don’t use a gmail account you cannot post changes to the source tree.

Patch 9828

I knew that change 9828 already updates the two script files (but there are still parts missing). I decided to apply this patch to my local source tree with the idea that it will be an extension on this patch

repo download platform/vendor/htc/dream 9828

Because I want to make an extension on this patch I should make a local branch first containing this change which can be later merged to the developer branch which will contain the additions to both script. So you can skip this step if your change does not depend on another patch.

git checkout -b branch9828

This will make a local branch called branch9828

Contribute steps

Updating 2c2e915..b15e33c
Fast forward
AndroidBoard.mk  |   12 ++++++++++++
extract-files.sh |   14 ++++++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)
mode change 100755 => 100644 extract-files.sh

At http://source.android.com/submit-patches is described how to submit patches. I used these steps as my guide in the repo/git adventure. But like an outdated tourist guide book I found some rocks on my path.

Starting a topic branch

Before I can make my changes I should start a topic branch on my local work environment. This topic branch is used to keep changes together. You can have multiple topic branches in your local work environment. But keep changes seperate so that the use of a patch is clear.

Using repo start default (where default is the topic branch name, but you can name it whatever you want) does not work for me. You should also add the project which you are going to change (or supply the -all argument but I think that you should really limit it to a project to keep things seperately). The change I want to contribute is in the platform/vendor/htc/dream project

repo start default platform/vendor/htc/dream

This command will not give you back any feedback. On the other way, if you use it wrong it will give you feedback.

Merging the 9828 branch

The new change will be an addition on the 9828 step. I already created a local branch for those changes and I want to merge those to my default local development branch. This way I can use repo upload to send my change to the review server. So you can skip those steps if you don’t depend on unapproved changes

git reset--hard branch9828
HEAD is now at b15e33c... Added more proprietary libraries.

Because the local branch9828 is not needed anymore, I deleted it

git branch -d branch9828
Deleted branch branch 9828

Editing the files

With a texteditor I changed and saved both files. I will not place the changes I made to both files here in this blogpost because you can see them easily by going to https://review.source.android.com/Gerrit#change,10813 and look at the Side-By-Side diffs.

Staging changes

The steps at http://source.android.com/submit-patches describes that you should perform a git add to “stage” the changes for the next commit. This is optional when you don’t add files. So in my case I did not performed this step

Change status

After I changed both files I can see the status of the current branch by executing

repo status

You will get some kind of result (this is the repo status result after changing both script files)

# on branch default
project vendor/htc/dream/                       branch default
 -m     AndroidBoard.mk
 -m     extract-files.sh

This status reports makes clear that both files are changed (-m before each line). But what are the exact changes? You can use git diff to see detailed information.

git diff
diff --git a/AndroidBoard.mk b/AndroidBoard.mk
index 7f82037..58e2cd0 100644
--- a/AndroidBoard.mk
+++ b/AndroidBoard.mk
@@ -85,3 +85,8 @@ PRODUCT_COPY_FILES += \
 PRODUCT_COPY_FILES += \
        $(proprietary)/tiwlan.ini:system/etc/wifi/tiwlan.ini \
        $(proprietary)/Fw1251r1c.bin:system/etc/wifi/Fw1251r1c.bin
+
+PRODUCT_COPY_FILES += \
+        $(proprietary)/lights.msm7k.so:system/lib/hw/lights.msm7k.so \
+        $(proprietary)/AudioPreProcess.csv:system/etc/AudioPreProcess.csv
+
diff --git a/extract-files.sh b/extract-files.sh
index ccd78a3..7318500 100644
--- a/extract-files.sh
+++ b/extract-files.sh
@@ -31,4 +31,7 @@ adb pull /system/lib/hw/sensors.trout.so proprietary/sensors.t
 adb pull /system/etc/wifi/Fw1251r1c.bin proprietary/Fw1251r1c.bin
 adb pull /system/etc/wifi/tiwlan.ini proprietary/tiwlan.ini

+adb pull /system/lib/hw/lights.msm7k.so proprietary/lights.msm7k.so
+adb pull /system/etc/AudioPreProcess.csv proprietary/AudioPreProcess.csv
The diff  will only give you the changes. The lines starting with @@ are used as location markers pointing to where inside a file the change is made. Lines with a + are new added lines.

Committing changes

Next step is to commit the changes. Because I did not add new files I run the command

git commit -a

Commit will find the changes and the default texteditor will be opened for providing a comment (in my case it is gedit). There is a comment template which I changed to


Added more proprietary libraries.

The Led light of the HTC Dream should work when
extra libraries are extracted from the HTC Dream and
added to the system image.

The wlan.ko is not extracted (comparing to change 10501).
This is already part of the project or can be build from
source.

Saved and close the file and the commit command will result with a message like

Created commit 6aab35e: Added more proprietary libraries.
 2 files changed, 8 insertions(+), 0 deletions(-)

Note: If you provide an empty comment then the commit will be aborted

Contributor Agreement and public SSH key (only for the first time)

Last step is to upload the changes to the review server. Because it is the first time I want to post some changes to the Android Source tree I have to complete a Contributor Agreement (https://review.source.android.com/Gerrit#settings,new-agreement) to give permission that your changes can be distributed to others. I logged in with my Google Account (the one I also used when getting the source from repo) and because I am an individual I selected the Individual Ageement Type, filled in the form and submitted it.

Because you signed this agreement it is important that repo knows who you are by providing a public SSH key. The steps for creating this key should only be executed once and are stored (as default) inside the ~/.ssh directory. I am not going to describe the steps of creating this SSH keys because those are clearly written down in a step by step manual at http://github.com/guides/providing-your-ssh-key

Note: xclip (a tool for sending the content to the clipboard) can be installed on ubuntu with: sudo apt-get install xclip

The contents of the public key (which is on you clipboard) should be added to your personal page on the review server (https://review.source.android.com/Gerrit#settings,ssh-keys, maybe you should login with you Google Account). Paste the content of the clipboard inside the Add SSH Public Key box and press Add.

Note: don’t mind the / characters inside the clipboard content. Adding the messy content of the clipboard will work.

After the key is added it will be shown in the list (https://review.source.android.com/Gerrit#settings,ssh-keys).These steps should only repeated again I you want to use a different key when for example you are using a different environment.

Uploading changes

Even we had to take a sidepath (for creating the SSH key), the last step is to upload the changes. It is possible that in the meantime someone is working at the same files. So before uploading, synchonize the source

repo sync

Upload the changes by executing

repo upload

If you are working on multiple changes and have multiple topic branches, some editor window will be shown. In my case I only have one topic branch so I get a prompt if I want to upload the sources

Upload project vendor/htc/dream-open/:
  branch default ( 4 commits, Tue Jul 28 07:05:46 2009 +0200):
         0c35fa84 Add /system/lib/libhtc_acoustic.so to the list of needed proprietary files. Without it, audio does not play in Android 1.5.
         c93fac29 Whoops, fix file permission touched by editor.
         b15e33c5 Added more proprietary libraries.
         f2a9ebde Added more proprietary libraries.
to review.source.android.com (y/n)? y
Counting objects: 7, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 653 bytes, done.
Total 4 (delta 3), reused 0 (delta 0)
To ssh://johan.c.de.koning@review.source.android.com:29418/platform/vendor/htc/dream-open
 * [new branch]      default -> refs/for/cupcake

New Changes:

https://review.source.android.com/10813

--------------------------------------------
[OK    ] vendor/htc/dream-open/ default

Changes are submitted and a url is given back. On this url you can find details about the change made (like the Side-by-side diffs). The result given back also makes clear that this change depends on other changes.

And they lived happily ever after….

So what’s next? I uploaded the change to the review server. This does not mean that when you do a repo sync you will automatically get this change. No, like the server name said, it should be reviewed first. But by who and when? I don’t know. In the meantime you can use these changes by applying them on your local source

repo download platform/vendor/htc/dream 10813

Looks like there will be a sequel of this journey: Contribute to Android – Judgement of the reviewer

Read more from the Uncategorized category. If you would like to leave a comment, click here: 3 Comments. or stay up to date with this post via RSS, or you can Trackback from your site.

Building Android 1.5 – Building the source

Note (30 july 2009): made some changes because of the repository changes (dream is now called dream-open)

Note (16 july 2009): based on the comments of Foogod a section is added to this blogpost about how to create an updated wifi module. The wlan.ko module which is downloaded by default is not compatible (by version) with the compiled kernel. The new wlan.ko module will resolve the Wifi issue

Note (2 july 2009): I updated the htc_dream.mk script. The updated version will also add the Calculator, Email, ImProvider (which is not GTalk Client) and the VoiceDialer packages to your build. These application are open source and are also part of the Android source tree. Don’t know why these are not by default in the product configuration file.

Note (23 june 2009): the SdkSetup package is not by default added to the system image.  By editing the htc_dream.mk build script the SdkSetup package will be added. Previously I added the package by adding a LOCAL_MODULE_TAGS line to the build script of the SdkSetup package. But by changing the htc_dream.mk buildscript the process is more easier, clearer and the build script will also be used later for adding other packages.

My previous two blogitems about Android described the steps for setting up the build environment and getting the Android source. The next step is to build the source code. Let’s build our own kernel first.

Building the kernel

The kernel can be seen as the core of the OS. Execute the following steps to configure and perform a kernel build which is compatible for the dream hardware (ARM)

cd ~/mydroid/kernel
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin
cp arch/arm/configs/msm_defconfig .config
make oldconfig && make

Result of this build will be an image of the kernel  found at ~/mydroid/arch/arm/boot/zImage. This kernel will be used for building the other parts of the operating system.

Building the Wifi Module

The ~/mydroid/vendor/htc/dream-open contains a wlan.ko module by default when downloading the source from the Android repository. The problem is that this version is not compatible with the compiled kernel (different version number). Because the wlan.ko is not a proprietary file, you can compile your own version of this module which is compatible with the kernel.

The sourcecode of the wlan.ko module can be found at ~/mydroid/system/wlan/ti/sta_dk_4_0_4_32. Execute the following commands to create a version compatible wifi module

cd ~/mydroid/system/wlan/ti/sta_dk_4_0_4_32
export KERNEL_DIR=~/mydroid/kernel/
make

After make is complete there will be a binary version of the wlan.ko module inside the ~/mydroid/system/wlan/ti/sta_dk_4_0_4_32. This module should be copied to the ~/mydroid/vendor/htc/dream-open location

cp wlan.ko ~/mydroid/vendor/htc/dream-open

Note: make sure, when building the wifi module, that the same terminal is used (the terminal which was also used for building the kernel). This will keep the PATH location to the arm-eabi-gcc compiler available. If you closed the terminal/used another one execute the export PATH command first (before executing make)

export PATH=$PATH:~/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin

Changing the HTC build script

The SdkSetup application (.apk) is needed to make incoming call possible (it sets the phone to the “provisioned” state) and makes the home button work. Because the package is not deployed by default, the htc_dream.mk build script should be changed. Edit the file htc_dream.mk inside the ~/mydroid/vendor/htc/dream-open directory by adding the following lines at top of the document

PRODUCT_PACKAGES := \
 Calculator \
 Email \
 ImProvider \
 SdkSetup \
 VoiceDialer

Save the file and exit the editor. The SdkSetup package will now be part of the build.

Building the system image

It is time to start a long task which will compile and create the system image of the Android OS. Two lines added to a configuration file are needed and than the compiler can do it job (and you can watch television or walk with the dog because this takes some time).  Go to the top level of the Android source

cd ~/mydroid

Use a texteditor to create a file called buildspec.mk. Add the following two lines to this file, save the file and exit the editor

TARGET_PRODUCT:=htc_dream
TARGET_PREBUILT_KERNEL:=kernel/arch/arm/boot/zImage

The TARGET_PREBUILT_KERNEL point to the location of the kernel we build earlier.

Let’s start the build by running the command

make

What’s next?

Because I don’t want to wait until your build is over, I am now going to play on my Nintendo Wii. In the next post I will give details about the flash process of your Android Device. While you are waiting you can take some time to give some feedback on these blogposts (even if you want to talk about the Nintendo Wii).

Blogpost in the Building Android 1.5 serie

Read more from the Uncategorized category. If you would like to leave a comment, click here: 77 Comments. or stay up to date with this post via RSS, or you can Trackback from your site.

Building Android 1.5 – Getting the source

Note (7 augusts 2009): patch 10889 is now part of the source tree and cupcake branch is used instead of cupcake-release

Note (30 july 2009): because of the changes made inside the Android repository, I decided to change the 10501 patch so that the wlan.ko module is not extracted from the device. The wlan.ko module is part of the dream-open project or you can build the latest version of the wlan.ko from source (as described in the blog posts). Instead of patch 10501, patch 10889 is used.

Note (27 july 2009): based on this forum post from JBQ (Software Engineer at Google), I decided to take the cupcake-release branch for the Building 1.5 series. I will write a different blogpost later about the other branches

Note (15 july 2009): the platform/vendor/htc/dream project inside the Android source tree is renamed to platform/vendor/htc/dream-open. Only the local_manifest.xml and the command for applying the patch should be changed (changes are made in this blogpost). The project is renamed because of some cleanup actions by Google. Problem is now with the latest Android1.5r2 source code, that Wifi is not working. Try to found a solution for that.

Note (24 june 2009): contributed a patch to the Android Source (change 10501) for updating the extact-files.sh and AndroidBoard.mk scripts which where outdated for the proprietary files. This simplifies the process of getting the source a little bit.

Note (9 june 2009): I updated this blogpost to make wifi and the led light of your Android Dev Phone working inside your own build.

In the previous blogpost I described how to set up the build environment. The next step will be downloading the source and apply some changes so that it will succesfully build. Getting the source is described at http://source.android.com/download but I will give a more detailed overview (and the details for making the build ready for the Android Dev Phone)

Installing repo

The repo tool will be used to get the Android source from Git. Before you can use Repo it should be installed, initialized and configured. I did not described the installation of repo in setting up the build environment because the repo script is Android specific.

Open a terminal inside Ubuntu and make sure that you are inside your home directory

cd ~

Inside the home directory, create a new directory called bin

mkdir bin

The bin directory should be part of your path ($PATH).  Edit the .bashrc file inside your user home directory (which is the current directoy you are working) and add the following line to the end of the file

export PATH=$PATH:~/bin

Save .bashrc and open a new terminal (this will execute .bashrc). Check if the bin directory is inside your path

echo $PATH

The results will be different for each installation because a different username will be used (or you would like my username jcdekoning) and maybe even more locations are inside your path. The result within my installation gives back

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/jcdekoning/bin

The last part (home/jcdekoning/bin) is pointing to the bin directory inside the users home directory (in my case /home/jcdekoning).

The next step is to download the repo script (with curl) and make it executable (chmod). Use to following two commands

curl http://android.git.kernel.org/repo > ~/bin/repo
chmod a+x ~/bin/repo

Initializing the Repo client

You need to make a location where you want to store the files (source, configuration, etc) from Git. I create a directoy inside the users home which is called mydroid

cd ~
mkdir mydroid
cd mydroid

Inside the mydroid directory you need to execute repo init to specify where the android files are remotely located. By running repo init -u git://android.git.kernel.org/platform/manifest.git you will get the master version of the Android source. The problem with this version is that it is mostly not stable and can have expiremental code. Therefore I use a specific branch of the Android source which hold a stable build for Android 1.5

repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake

Repo will ask for your name and email address. When you are planning to  submit code back to the Android source, use a email address which is assciated with a Google account.

If repo init is succesfully finished you will receive a message with at the

repo initialized in /home/jcdekoning/mydroid

You did not download the source yet, you only configured the repo tool so that it knowns where the source can be found. Inside the mydroid directoy you will find a .repo directory

Repo configuration changes for Android Dev Phone

Note: the download of the kernel source files is only needed if you want to compile the kernel by your own. You can also skip this configuration change and use the prebuilt kernel which is part of the dream-open project. It is possible that this prebuilt kernel is not the latest version

It is possible to download the source at this point, but we need to make some changes to retrieve specific source for the Android Dev Phone (internally called Dream).

Inside the .repo directory (within mydroid) you need to create a local_manifest.xml. This file containsa description of the three extra project needed for the Dev Phone. The contents of the local_manifest.xml

<?xml version="1.0" encoding="UTF-8"?>
 <manifest>
  <project path="kernel" name="kernel/msm" revision="refs/heads/android-msm-2.6.27"/>
 </manifest>

With the local_manifest.xml in place it is time to get the source code. Inside the mydroid directory (and not the .repo directory) execute the command

repo sync

No sit back, relax, drink some coffee or read some of my other blog posts because downloading the code will take some time.

Proprietary binaries

Note: the patch changes are now part of the source tree.

Some closed source files which are specific for the Dream need to be extracted from a Android device running 1.5. These files are not part of the source tree but are needed for running Android on the Android Dev Phone. Within you mydroid directory you find /vendor/htc/dream-open. There is a script called extract-files.sh. This script will use the adb tool to retrieve the files from an android device. But the content of this script is outdated for version 1.5.

To update the content of the extract-files.sh script (and the AndroidBoard.mk file) get a patch (10889):

repo download platform/vendor/htc/dream-open 10889/4

You can now get the proprietary files from you Android device by connecting it to Ubuntu and execute the extract.files.sh script

./extract-files.sh

Sometimes the Android connection between my Ubuntu in VMWare is not working properly. Therefore I use a different method for extracting the files from the official Android 1.5 image. By extracting the image provided by HTC

Using unyaffs

This part is only relevant when you don’t want or not able to extract the proprietary files from an Android device. So skip this part if you already have the files extracted. These files should be downloaded to /vendor/htc/dream-open/proprietary

The Android OS makes use of a yaffs file system. You can download the unyaffs tool at http://code.google.com/p/unyaffs/ to extract the content of an Android image. There is a prebuildversion available at the Downloads section. Place the unyaffs tool inside the ~/bin directory so that the tool can be found because it is inside the PATH definition

When the unyaffs is downloaded, make sure it can be executed

cd ~/bin
chmod a+x unyaffs

Official Android images provided by HTC for the Android Dev Phone can be found at http://www.htc.com/www/support/android/adp.html You will extract the system image to get the proprietary files. At the HTC download page, make sure you download the Android 1.5 system image (signed-dream_devphone_userdebug-img-148830.zip). Inside my home directory I create a new directory where the content of the zip file will be stored (~/htc). It is important to use the same directory name otherwise the script for copying the proprietary files will not work.

The downloaded system image archive contains four different .img files

When our own build is compiled we will end up with our build Android OS which also consists of these four different image files. The system.img will be extracted using the unyaffs tool

cd ~/htc
sudo ~/bin/unyaffs system.img

If the unyaffs is executed succesfully it will give a message like end of image. When looking at the content of the htc directory you will find new created files and folders (like app, bin, etc, lib, usr). The proprietary files are stored inside the etc and lib directory. Create with your favorite text editor a new file called htc-copy.sh (the location where you save this file doesn’t matter. I saved it inside ~/htc) and give it the following content.

#!/bin/sh

mkdir -p ~/mydroid/vendor/htc/dream-open/proprietary

cp ~/htc/bin/akmd ~/mydroid/vendor/htc/dream-open/proprietary/akmd

cp ~/htc/etc/AudioFilter.csv ~/mydroid/vendor/htc/dream-open/proprietary/AudioFilter.csv
cp ~/htc/etc/AudioPara4.csv ~/mydroid/vendor/htc/dream-open/proprietary/AudioPara4.csv
cp ~/htc/etc/AudioPreProcess.csv ~/mydroid/vendor/htc/dream-open/proprietary/AudioPreProcess.csv
cp ~/htc/etc/firmware/brf6300.bin ~/mydroid/vendor/htc/dream-open/proprietary/brf6300.bin
cp ~/htc/etc/gps.conf ~/mydroid/vendor/htc/dream-open/proprietary/gps.conf
cp ~/htc/etc/wifi/Fw1251r1c.bin ~/mydroid/vendor/htc/dream-open/proprietary/Fw1251r1c.bin
cp ~/htc/etc/wifi/tiwlan.ini ~/mydroid/vendor/htc/dream-open/proprietary/tiwlan.ini

cp ~/htc/lib/libaudioeq.so ~/mydroid/vendor/htc/dream-open/proprietary/libaudioeq.so
cp ~/htc/lib/libgps.so ~/mydroid/vendor/htc/dream-open/proprietary/libgps.so
cp ~/htc/lib/libhgl.so ~/mydroid/vendor/htc/dream-open/proprietary/libhgl.so
cp ~/htc/lib/libhtc_acoustic.so ~/mydroid/vendor/htc/dream-open/proprietary/libhtc_acoustic.so
cp ~/htc/lib/libhtc_ril.so ~/mydroid/vendor/htc/dream-open/proprietary/libhtc_ril.so
cp ~/htc/lib/libjni_pinyinime.so ~/mydroid/vendor/htc/dream-open/proprietary/libjni_pinyinime.so
cp ~/htc/lib/libmm-adspsvc.so ~/mydroid/vendor/htc/dream-open/proprietary/libmm-adspsvc.so
cp ~/htc/lib/libOmxCore.so ~/mydroid/vendor/htc/dream-open/proprietary/libOmxCore.so
cp ~/htc/lib/libOmxH264Dec.so ~/mydroid/vendor/htc/dream-open/proprietary/libOmxH264Dec.so
cp ~/htc/lib/libOmxMpeg4Dec.so ~/mydroid/vendor/htc/dream-open/proprietary/libOmxMpeg4Dec.so
cp ~/htc/lib/libOmxVidEnc.so ~/mydroid/vendor/htc/dream-open/proprietary/libOmxVidEnc.so
cp ~/htc/lib/libopencorehw.so ~/mydroid/vendor/htc/dream-open/proprietary/libopencorehw.so
cp ~/htc/lib/libpvasf.so ~/mydroid/vendor/htc/dream-open/proprietary/libpvasf.so
cp ~/htc/lib/libpvasfreg.so ~/mydroid/vendor/htc/dream-open/proprietary/libpvasfreg.so
cp ~/htc/lib/libqcamera.so ~/mydroid/vendor/htc/dream-open/proprietary/libqcamera.so
cp ~/htc/lib/libspeech.so ~/mydroid/vendor/htc/dream-open/proprietary/libspeech.so

cp ~/htc/lib/hw/lights.goldfish.so ~/mydroid/vendor/htc/dream-open/proprietary/lights.goldfish.so
cp ~/htc/lib/hw/lights.msm7k.so ~/mydroid/vendor/htc/dream-open/proprietary/lights.msm7k.so
cp ~/htc/lib/hw/sensors.trout.so ~/mydroid/vendor/htc/dream-open/proprietary/sensors.trout.so

chmod 755 ~/mydroid/vendor/htc/dream-open/proprietary/akmd

Execute the htc-copy.sh script so that the files will be copied to the ~/mydroid/vendor/htc/dream-open location.

chmod a+x htc-copy.sh
./htc-copy.sh

You can check if the script is succesful by going to ~/mydroid/vendor/htc/dream-open/proprietary and take a look at the contents of this directory.

What’s next?

So the source is downloaded, patched for the dream device and also the proprietary binary files are in place. The next step will be configuring the build and finally, the real work, compiling the source. I will write down more information about these steps in a next blog. Feel free to give comments on this post even if those are possitive.

Blogpost in the Building Android 1.5 serie

Read more from the Uncategorized category. If you would like to leave a comment, click here: 40 Comments. or stay up to date with this post via RSS, or you can Trackback from your site.

« Previous PageNext Page »