CM-T3730: Android: Building images

From Compulab Mediawiki
Revision as of 08:12, 14 May 2013 by Ilya (talk) (See also)
Jump to: navigation, search

Android Image

The Android Demo filesystem image for CM-T3730 is based on Rowboat Android 4.1.2 Jelly Bean with SGX (3D graphics acceleration) support.

Host Setup

Rowboat Jelly Bean sources can be built only on 64-bit hosts. The current build is tested on Ubuntu 12.04 (64-bit). This article assumes that the Getting Started instructions have been followed precisely and the same directory structure and all the tools were installed. The section Installing the JDK of the Getting Started instruction should be ignored. Also this article will use the $ANDROID_BASE variable to denote the base directory of the Rowboat Android sources.

Java JDK Setup

Default Ubuntu installation comes with OpenJDK which does not work for building the Rowboat Android JB sources. To over come this problem, the Sun Java JDK must be used. Current build was tested with Java SE Development Kit 6u38. This or later version (from now we assume it's XX) can be downloaded from here. Please use the Linux x64 bin installer. Install the JDK into any location. Also this article will use the $JDK_HOME variable to denote the JDK install directory.

cd $JDK_HOME
cp /path/to/jdk/jdk-6uXX-linux-x64.bin $JDK_HOME
chmod a+x jdk-6uXX-linux-x64.bin
./jdk-6uXX-linux-x64.bin

Installing Repo

Repo is a tool that helps to fetch the Rowboat Android sources. Please refer to Android Version Control for more information about Repo. This article will use the $REPO_HOME variable to denote the repo install directory.

  • Download the Repo and add execution permitions:
cd $REPO_HOME
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ${REPO_HOME}/repo
chmod a+x ${REPO_HOME}/repo
  • Add $REPO_HOME to the path:
PATH=${REPO_HOME}:$PATH

Getting Rowboat Android Sources

The Rowboat Android source repository is hosted on the Rowboat Gitorious website.

  • Create an empty directory for the Rowboat Android sources:
mkdir -p /path/to/rowboat/android
export ANDROID_BASE=/path/to/rowboat/android
cd $ANDROID_BASE
  • Get the sources:
repo init -u git://gitorious.org/rowboat/manifest.git -m rowboat-jb-am37x.xml
repo sync

Applying Patches

The Rowboat Android source tree is a collection of individual git repositories rather than a single git tree. The CM-T3730 Android Demo package provides a collection of patches for CM-T3730 support. The patch collection is organized into sub-collections; each sub-collection relates to an individual git repository. All sub-collections form a tree structure that preserves the Rowboat Android Source tree structure. All patches are generated vs. source tree version determined by the Rowboat Android manifest named rowboat-jb-am37x.xml.

  • Patching the build/ directory:
cd $ANDROID_BASE/build
git checkout -b cm-t3730-dev
git am /path/to/cm-t3730-android/development/build/*
  • Patching the device/ directory:
cd $ANDROID_BASE/device/
mkdir -p compulab/cm_t3730
cd compulab/cm_t3730
git init
git checkout -b cm-t3730-dev
git am /path/to/cm-t3730-android/development/device/compulab/cm_t3730/*
  • Patching the hardware/ directory:
cd $ANDROID_BASE/hardware/
mkdir -p devmem2
cd devmem2
git init
git am /path/to/cm-t3730-android/development/hardware/devmem2/*
  • Patching the hardware/ti/omap3 directory:
cd $ANDROID_BASE/hardware/ti/omap3
git checkout -b cm-t3730-dev
git am /path/to/cm-t3730-android/development/hardware/ti/omap3/*
  • Patching the hardware/ti/sgx directory:
cd $ANDROID_BASE/hardware/ti/sgx
git checkout -b cm-t3730-dev
git am /path/to/cm-t3730-android/development/hardware/ti/sgx/*
  • Patching the kernel directory:
cd $ANDROID_BASE/kernel
git checkout -b cm-t3730-dev
git am /path/to/cm-t3730-android/development/kernel/*

Building Android images

  • Setup Build Environment
export ANDROID_BASE=/path/to/rowboat/adnroid
cd $ANDROID_BASE
export PATH=$JDK_HOME/bin:$PATH
export PATH=$ANDROID_BASE/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin:$PATH
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export TARGET_PRODUCT=cm_t3730
  • Replace the Makefile in the Android home directory with the patched version:
rm -rf ${ANDROID_BASE)/Makefile
cp ${ANDROID_BASE)/build/core/root.mk ${ANDROID_BASE)/Makefile
  • To build the full Android Demo image (including Android filesystem, SGX, and Linux kernel):
    make OMAPES=5.x -j<N>
where N should be twice the number of processors/cores on your host machine.
  • To build a single Android Demo image component:
    • The Android filesystem:
      make droid -j<N>
    • The SGX:
      make sgx OMAPES=5.x -j<N>
    • The Linux kernel:
      make kernel_build -j<N>
  • To create Android filesystem tarball:
    make fs_tarball

See also