Android Miscellaneous

=Manifest= The Android source is made up of many open-source projects. Each of these open-source projects uses Git as the source code management tool. Managing multiple Git trees is not a simple task and Google created the "repo" tool to help facilitate this. The Android Manifest file is used by the Google repo tool to understand what Git trees Android uses and where these Git trees are downloaded from. When you perform a "repo init" the manifest file is downloaded and when you perform a "repo sync", the manifest file is parsed and repo downloads or updates the appropriate Git trees described in the manifest file.

For the OMAP-Android derivative the manifest file can be viewed on the following webpage by viewing the "default.xml" file.

See: http://git.omapzoom.org/?p=repo/android/platform/omapmanifest.git;a=summary

If you view the default.xml file, you will see something like that following at the top of the file...

  

The above describes two "remote" locations where Git repositories are downloaded from. One remote is Google's Android git (located at git://android.git.kernel.org/) and the other remote is the TI OMAP Zoom git (located at git://git.omapzoom.org/). You will also see at the top of the manifest under the "remote" definitions that there is something called "default" (above), which defines the default remote to use for downloading Git repositories. Please note that Git repositories are usually referred to as "projects."

Once you identify the "remotes" and the default "remote", then if you can look through the remainder of the manifest for each "project" defined you will be able to identify where this project is being downloaded from. For example, a project defined as follows is coming from the TI OMAP Zoom git trees as remote="omap":



Where as a project defined without a remote will default to the default remote which is Googles git. For example:



=Creating an OMAP-Android Mirror= This article describes how to create a mirror of the OMAP-Android repositories on a local server. This allow users working on the local server to create clones of the OMAP-Android repositories locally rather than over the internet.

Prerequisites/Assumptions
This article assumes that you already have repo, git and a git server installed on the local server. If you do not please refer to the following articles.


 * Installing Repo: "http://source.android.com/download"
 * Installing Git: http://wiki.omap.com/index.php?title=Git#Installing_Git
 * Setting up a Git Server: http://wiki.omap.com/index.php?title=Git#Setting_up_a_Git_Server

NOTE: Setting up a Git server is only necessary if users are cloning the local git trees from other hosts on the network. If users are working on the same machine that the local mirror is created on, this setting up a git server to export the git trees is not necessary.

IMPORTANT! If you are working behind a firewall, you will need to use corkscrew in order to create the mirror. When you configure corkscrew it is important that you configure git to only use corkscrew when cloning from kernel.org and omapzoom.org sites. If you do not then when you attempt to perform a local clone of the mirror, git will try to go through the firewall and will not find your local server. For instructions on installing corkscrew and configuring git to use corkscrew vist OMAP Platform Support Tools

Create an OMAP Android Mirror
On the local server create a new directory that where the local mirror will reside. ''Note that the Git server should be configured to export this directory. See reference above for installing a Git server on the Linux host.''

For example, if the Git server was configured to export the directory "/pub/gittrees" on the Linux host, then the following directory could be create for the OMAP-Android mirror...


 * 1) mkdir /pub/gittrees/omapzoom-android/

Create the mirror by executing the following commands, where branch name would be "eclair" or "froyo". If you omit the "-b " then the original donut branch will be cloned.


 * 1) cd /pub/gittrees/omapzoom-android/
 * 2) repo init -u git://git.omapzoom.org/repo/android/platform/omapmanifest.git --mirror -b 
 * 3) repo sync

For example, to create a mirror of the froyo branch execute the following.


 * 1) cd /pub/gittrees/omapzoom-android/
 * 2) repo init -u git://git.omapzoom.org/repo/android/platform/omapmanifest.git --mirror -b froyo
 * 3) repo sync

Clone the Local Mirror
Assuming that the IP address of the server where the mirror resides is 192.168.0.100, then on a developer system on the same network as the server, users may make clones from the local mirror by executing the following steps.

Step 1: Clone the manifest, where branch name would be "eclair" or "froyo". If you omit the "-b " then the original donut branch will be cloned.

cd ~ mkdir mydroid cd mydroid repo init -u git://192.168.0.100/omapzoom-android/platform/omapmanifest.git -b 

Note: If you are working on the server where the mirror exists then you may clone the manifest using the absolute path.

cd ~ mkdir mydroid cd mydroid repo init -u /pub/gittrees/omapzoom-android/platform/omapmanifest.git -b 

Step 2: Edit the manifest to point to the local mirror.

Go to the directory where the manifest is located.

cd mydroid/.repo/manifests vim default.xml

Edit the manifest making the following changes (obviously changing the IP address to match your server's IP address)

diff --git a/default.xml b/default.xml index 2bd9cff..6ae2ec3 100644 --- a/default.xml +++ b/default.xml @@ -1,7 +1,7 @@  -  -  +  +  

Note: If you are working on the server where the mirror exists then you may place the absolute path in the manifest.

diff --git a/default.xml b/default.xml index 2bd9cff..6ae2ec3 100644 --- a/default.xml +++ b/default.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> - <remote fetch="git://android.git.kernel.org/" name="korg" review="review.source.android.com"/> - <remote fetch="git://git.omapzoom.org/" name="omap-mirror" review="review.omapzoom.org"/> + <remote fetch="/pub/gittrees/omapzoom-android/" name="korg" review="review.source.android.com"/> + <remote fetch="/pub/gittrees/omapzoom-android/" name="omap-mirror" review="review.omapzoom.org"/> <default remote="omap-mirror" revision="p-froyo"/>

Finally commit this change to manifest git tree.

git commit -a -m "update manifest to use local mirror"

Step 3: Clone entire Android software from the mirror.

cd mydroid/ repo sync

Step 4: From time to time you may wish to update your clone by re-sync'ing. Executing "repo sync" may update the manifest if changes have been made. Therefore, to ensure that the above change to the manifest does not get over-written execute the following commands when sync'ing to the latest code base.

cd mydroid/.repo/manifests git pull --rebase repo sync

Clone a Specific Release from the Local Mirror
Assuming that the IP address of the server where the mirror resides is 192.168.0.100, then on a developer system on the same network as the server, users may make clones of specific release from the local mirror by executing the following steps.

Step 1: Clone the manifest.

cd ~ mkdir mydroid cd mydroid git clone git://192.168.0.100/omapzoom-android/repo/android/platform/omapmanifest.git

Note: If you are working on the server where the mirror exists then you may clone the manifest using the absolute path.

cd ~ mkdir mydroid cd mydroid git clone /pub/gittrees/omapzoom-android/repo/android/platform/omapmanifest.git

Step 2: Reset the manifest to the specific release you want.

To view the release labels execute the following commands.

cd mydroid/omapmanifest git tag

To reset the manifest to a particular label execute the following commands.

cd mydroid/omapmanifest git reset --hard <release-label> export MANIFEST=`pwd` cd .. repo init -u $MANIFEST

For example, to reset the manifest to Froyo release RLS27.6.1_Froyo execute the following commands.

cd mydroid/omapmanifest git reset --hard RLS27.6.1_Froyo export MANIFEST=`pwd` cd .. repo init -u $MANIFEST

Step 3: To sync the entire code base perform steps 2-4 of the previous section.

=Submitting Patches= Contributing to the omapandroid project uses the same process defined by the OHA for contributing to the Android project. However, omapandroid introduces a second review site to handle changes specific to OMAP.

Review the Android development process and how to use repo, gerrit, and git.

Here are some usefull steps to help you get started.

Setting up your Account with Gerrit:
'''This information is out of date. Please do not use these instructions to sign up for review.omapzoom.org.'''


 * Goto review.source.android.com and click the ‘sign in’ tab on top right corner.
 * There are various ways to sign in, (Preferably use your Google account)- pick the one that   works for you (If you don't have any of those accounts - create one)
 * Click on the settings menu in the top right corner. Then select the "Contact Information" tab.  Make sure you fill out the name and email fields (TI email address) and save it. You can now logout and close the browser.
 * You will get an email from Android Code Review to your registered TI email address. Just click the included  link for verification of the email address.
 * Click on the settings menu in the top right corner and click on the "SSH Keys" tab. Upload your ssh public key
 * Not sure how to get SSH - click on the "Guide to SSH Key's" link and follow the instructions for your OS.
 * Copy the ssh key from id_dsa.pub and paste it in the ‘Add SSH key’ space and click on add tab below.
 * Here are some additional tips for setting your SSH:

[~/.ssh]$ ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/home/tom/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/tom/.ssh/id_dsa. Your public key has been saved in /home/tom/.ssh/id_dsa.pub. The key fingerprint is:50:43:77:c6:97:af:61:82:dc:ea:9b:6b:67:d4:1b:61 tom@volcano


 * Enter your linux machine login username in SSH Username textbox and click ChangeUsername button.


 * Click on the ‘Identities’ tab anad make sure that your TI email address appears there.
 * Now click on the agreement tab, then click on ‘New Contributor Agreement’ and select Corporate, enter I AGREE in the agreement space and enter ‘submit agreement’ tab.
 * Now goto review.omapzoom.org click the ‘sign in’ tab on top right corner.
 * Sign in with the same id (Google or Yahoo) you used before
 * Click on the settings menu in the top right corner. Then select the "Contact Information" tab.  Make sure you fill out the name and email fields (use the same email address you registered before with review.source.android.com) and     save it. Logout and close the browser.
 * You will get an email from Gerrit Code Review to your registered TI email address. Just click the included link for verification of the email address.
 * Click on the settings menu in the top right corner and click on the "SSH Keys" tab. Paste the same public key as above in the ‘Add SSH key’ space and click on add tab below
 * Enter your linux machine login username in SSH Username textbox and click ChangeUsername button.

SSH Proxy Setup:

 * The repo tool uses ssh to access Gerrit. If you are not behind a firewall, then if the keys are correct, everything should be fine
 * However, if you are behind a firewall (as here in TI), you will need to tell ssh about it.
 * Download the corkscrew tool package and install.
 * Add the following to your ~/.ssh/config file and substitue your path to corkscrew where it says " "

Host review.omapzoom.org port 29418 proxycommand /corkscrew 80 %h %p Host review.source.android.com port 29418 proxycommand /corkscrew 80 %h %p Note: Write without 'http://'

Testing the Connection:
ssh -p 29418 <SSH Username>@review.omapzoom.org
 * Log into your account on Gerrit and click on the "Settings" menu. Note your SSH Username (under the SSH Keys tab ).
 * Now issue the following command from the machine(s) you plan on using for 'repo upload'.


 * If it comes back with:

gerrit: no shell availableConnection to review.omapzoom.org closed.

you are good to go :)

=Getting past the Zoom2 white screen issue=

The “white-screen” issue is a problem associated with pre-production Zoom2 board, where the display/LCD remains white during boot-up. Although the screen is white, Android will usually boot up and can still be accessed using a console. In this note, we first describe the cause of the problem and the procedure to fix it for android version L25.12. To the best of our knowledge, the fix is already built into L25.13.

Problem origin

Issue# 1: As explained in the L25.12 release notes (http://www.omappedia.com/wiki/L25.12_Release_Notes#Limitations.2FKnown_Issues), “This is a known issue which happens due to change in GPIO pin muxing in beta and production boards."

Issue# 2: There is a second issue which is due to the fact that in pre-production boards, the McBSP4_CLK is linked to LCD_RESET line. This cause a white screen if mcbsp4 is used for audio.

Problem resolution

I. Resolving Issue #1

The patch for issue# 1 is already included in L25.12.

II. Resolving Issue #2

The patch for issue# 2 is designed for L25.13, and a little tinkering is needed to make it work with L25.12. Follow the following procedure:

1) In the Android directory, locate the file “board-zoom2.c”, which should be in “$YOUR_PATH/mydroid/kernel/android-2.6.29/arch/arm/mach-omap2/board-zoom2.c”.

2) Open the file “board-zoom2.c”, and look for the function static void __init omap_zoom2_init_irq(void) in the file.

3) Replace the contents of static void __init omap_zoom2_init_irq(void) with the code found below: static void __init omap_zoom2_init_irq(void) {	switch (omap_rev_id) {	case OMAP_3420:		omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, omap3_dsp_rate_table_3420, omap3_l3_rate_table);		break;

case OMAP_3430: omap2_init_common_hw(mt46h32m32lf6_sdrc_params,omap3_mpu_rate_table, omap3_dsp_rate_table, omap3_l3_rate_table); break;

case OMAP_3440: omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, omap3_dsp_rate_table_3440,omap3_l3_rate_table); break;

default: omap2_init_common_hw(mt46h32m32lf6_sdrc_params,omap3_mpu_rate_table, omap3_dsp_rate_table,omap3_l3_rate_table); break; }

/* Set Mcbsp only for Producton units */ /* Else you will see white screen on beta boards */

if (omap_rev > OMAP3430_REV_ES3_0) { /* Production board supports McBSP4 */ omap2_mux_register(&zoom2_mux_cfg); } else { /* McBSP4_CLK is linked to LCD_RESET line * on Pre-Production zoom2's 		 * Hence a white screen seen */ 		printk(KERN_WARNING "Issue: McBSP4 not supported on this board"); }	omap_init_irq; omap_gpio_init; zoom2_init_smc911x; }

4) Save file “board-zoom2.c”

5) Now, we need to recompile the Kernel and rebuild Android. Go to the “Android get started” page and follow the instruction to build the kernel. Then, rebuild Android. Essentially, repeat steps 7.3 through 10 in http://www.omappedia.org/wiki/Android_Getting_Started