Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2998382
  • 博文数量: 674
  • 博客积分: 17881
  • 博客等级: 上将
  • 技术积分: 4849
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-17 10:15
文章分类

全部博文(674)

文章存档

2013年(34)

2012年(146)

2011年(197)

2010年(297)

分类: LINUX

2010-03-30 22:16:22

Android Getting Started

From OMAPpedia

Jump to: ,

Contents

[]

 Video Tutorials

This page contains links to tutorials which will go over some of the key Android and Zoom2 concepts in a step-by-step manor. Videos and the text commands are provided with each tutorial.



After installing Ubuntu, this tutorial will show you how to quicky install, build and boot Android on a Zoom2.


Note: The video tutorials are on the early releases of L25x. For latest releases, please follow the text instructions. Video tutorials can be referred for generic setup

Note: Before starting make sure that you have around 10 GB of freespace in order to do a complete build of Android.

 Configuring the Target Device (Zoom)

For instructions on how to setup the Zoom hardware, refer to

 Connect the Target board to PC

To setup Zoom2 to display debug messages via Teraterm/Hyperterm on a PC, connect and configure the below.

Connect a USB cable (mini-B connector) to the J12 receptacle and the other side to the USB port on PC. Windows PC should recognize the USB to serial device connection as "USB Serial Converter A".

For instructions on how to configure this, refer

 Configuring the Host PC

 Linux Distribution

Ubuntu is the recommended Linux distribution for this setup. Other distributions are available, however the configurations listed in this wiki currently only covers Ubuntu.

Ubuntu is available for download at:

Note: Around 10GB of hard disk space is required to build one release of Android.

 Working behind a firewall

Refer to for more information on setting up Ubuntu's Firewall.


 ARM Cross Compiler

CodeSourcery ARM Compiler should be used for building different kernel distribution and software releases on OMAP platforms. Visit for more info.

Note: For L24x, L27x kernel builds, Codesourcer tool chain 2009-q1 release should be used. Quick Link -

Steps

  • Download .tar from above link and untar to a host pc directory.
  • Add Compiler directory to PATH, and cross compiler prefix before build
export PATH=//bin:$PATH
export CROSS_COMPILE=arm-none-linux-gnueabi-

 Additional packages required for building

sudo apt-get install git-core flex bison gperf libesd0-dev zip
sudo apt-get install libwxgtk2.6-dev zlib1g-dev build-essential libstdc++5 
sudo apt-get install tofrodos x-dev libx11-dev libncurses5-dev 
sudo apt-get install sun-java5-jdk

To uninstall “sun-java6-jdk” please type:

sudo apt-get remove sun-java6-jdk
  • Intrepid (8.10) users may need a newer version of libreadline:
sudo apt-get install lib32readline5-dev 
  • Ubuntu 9.10 users may need to install a newer version of standard C++ library
sudo apt-get install libstdc++6
  • Ubuntu 9.10 users need to follow below steps to install sun-java5-jdk
#add the old Jaunty repos to /etc/apt/sources.list 
deb  jaunty multiverse
deb  jaunty-updates multiverse

#then run below commands
sudo apt-get update
sudo apt-get install sun-java5-jdk


  • Ubuntu Intrepid (8.10) users need to roll back on the gcc to the 4.2 version (Intrepid comes with 4.3).

For Ubuntu® users, who previously had java6 installed might run into the following error:

************************************************************
You are attempting to build with the incorrect version of java.

Your version is: java version "1.6.0_10".
The correct version is: 1.5.
 
Please follow the machine setup instructions at 
    
************************************************************

Try to change the default java version with the following command:

sudo update-alternatives –-config java

This will show you the options you have for selecting which java version you want by default. You will have to do this for all java binaries that come with the java jdk (javac, javadoc, javah, etc).

  • Libiconv

This can be downloaded from Follow the instructions and install to the standard location. like:

wget 
tar xzvf libiconv-1.13.1.tar.gz 
cd libiconv-1.13.1/
./configure
make
sudo make install

64-bit Host

On a 64-bit host, you need to force creation of 32-bit code and use the 32-bit version of libiconv. You can do the native 64-bit build and install as described above first. Then to build a 32-bit version:

./configure CFLAGS=-m32
make
sudo make install-lib libdir=/usr/local/lib32

Note: You may also need to install ia32-libs.

 Working with pre-built binaries

For those who're looking to quickly get started with Android on a Zoom2 device may download and install the following pre-built binaries to quickly boot the device.

Image taken from the git tree (on 5/15/09):





Image taken from the git tree (on 6/29/09):






The latest L25.12 binaries (Oct 2009) have been released as

Please refer to the Build instructions section of for details to work with them


For installation you may directly jump to the section.

 Accessing Source Code

TI's official releases usually contain additional licensed content (including 3rd party software) in addition to the content in open source. Licensed content such as Hardware Accelerated MP3, H264 Encoder,720p Video codecs can be obtained via the official releases by license holders through TI.


 Setting Environment

Create the following directories:

$ cd ~/
$ mkdir bin
$ mkdir mydroid

Export tool chain path:

$ export PATH=$PATH:/home//bin
$ export MYDROID=/home//mydroid

 Installing repo

For detail information regarding repo visit:

Other reference links on Git can be found in

Download repo to environment

$ cd ~/bin
$ curl  > ~/bin/repo
$ chmod a+x ~/bin/repo

 Source Versions

Two different versions of source code is available for the community. The "Latest Code" provide up to the minute release. This version of source code is considered unstable. "Stable Release" source code has been tested and is considered to be rather stable.


 Latest Code

Initialize the project to use the latest manifest

$ cd $MYDROID
FOR DONUT
---------
$ repo init -u git://git.omapzoom.org/platform/omapmanifest.git

FOR ECLAIR
----------
$ repo init -u git://git.omapzoom.org/platform/omapmanifest.git -b eclair

$ repo sync

 Stable Release

The stable tested release version will provide a tested, verified stable point in the release. Download these versions if you want a point of known functionality. These stable versions are tested by TI test team and both test results and release notes have been produced. All the Open Sourced code will be accessible via this method. Apart from this you can access certain HW accelerated codecs, WLAN/BT firmware for Zoom-II platform. There will be additional HW accelerated codecs, 3rd part content & features that may be available from releases obtained through TI. To obtain licenses for additional content, contact your TI representative.

To access these releases,

  • obtain the correct manifest file from omapmanifest
  • initialize your project with the manifest you have chosen
  • obtain the source code for the release


 Obtain Correct Manifest

Create a directory to store your manifest

$ cd $MYDROID
$ mkdir my_manifest
$ cd my_manifest  

 Obtain Source Code for Release

Clone manifest project and reviewing current available tags

$ git clone git://git.omapzoom.org/platform/omapmanifest.git 
$ cd omapmanifest
$ export MANIFEST=`pwd`
$ git tag

 Manifest Tags

Example of git tag print out

RLS25.12RC0
RLS25.6rc4
RLS25.6rc7
RLS25.6rc8
RLS25.7rc0
RLS25.7rc1
RLS25.7rc2
.
.
.
RLS25.9rc4
android-1.0


  • RLS25.x

Indicate official released software versions. These versions will have published Release Notes and Product Test results associated with them.

For example: RLS25.6 indicates the official 25.6 release version.


  • RLS25.xrcy

Indicate an intermediate build between official releases. These intermediate builds are called "release candidates". They should be considered unstable intermediate builds. They are used to provide a stable compilation point at which testing can begin between releases. The test results for these builds will not be published externally.


For example: RLS25.7rc1 is a point used for testing between the 25.6 release and the 25.7 release.

  • RLS25.INC2.x

Indicate official released software versions for OMAP3630. These versions will have published Release Notes and Product Test results associated with them.

For example: RLS25.INC2.6 indicates the official 25.6inc2 release version.

  • RLS25.INC2.xrcy

Indicate an intermediate build between official releases for OMAP3630. These intermediate builds are called "release candidates". They should be considered unstable intermediate builds. They are used to provide a stable compilation point at which testing can begin between releases. The test results for these builds will not be published externally.

For example: RLS25.INC2.7rc1 is a point used for testing between the 25inc2.6 release and the 25inc2.7 release.

For example: RLS25E.16 indicates an Eclair (rather than Donut) build.

Select a release git tag and use a hard rest command

$ git reset --hard RLS25.6

Initialize Project

Initialize project based on manifest chosen

$ cd $MYDROID
$ repo init -u $MANIFEST
$ repo sync

This process takes around an hour.

Note: You might see the following error when you try to initialize repo:

Error: IOError: [Errno 2] No such file or directory: '/home// mydroid/.repo/manifests/.git/HEAD'

Following instructions may solve the above error

$ touch ~/.gitconfig
$ rm -rf .repo


 DOWNLOADING PARTIAL CODE

If a user wants to download partial code instead of complete android source , the user can do the below steps

After "repo init" give the below command

$ repo sync

Eg: If user wants latest kernel code from eclair branch

$ repo init -u git://git.omapzoom.org/platform/omapmanifest.git -b eclair

$ repo sync kernel/android-2.6.29/

 Building Android

 Building uboot

  • For releases starting L25.10
$ cd $MYDROID/bootable/bootloader/u-boot
$ make distclean
$ make CROSS_COMPILE=arm-none-linux-gnueabi- omap3430zoom2_config
$ make CROSS_COMPILE=arm-none-linux-gnueabi-
$ cp $MYDROID/bootable/bootloader/u-boot/tools/mkimage ~/bin/

Note (for latest release at least): By default the toolchain (arm-none-linux-gnueabi-) is not in your path, you either have to sym link it to /usr/bin (ie ln -s $HOME/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin/arm-eabi-gcc /usr/bin/arm-none-linux-gnueabi-gcc -- and do that for each tool), or, more easily, specify the full path in the CROSS_COMPILE flag (ie CROSS_COMPILE=$HOME/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin/arm-eabi-) for each of the above make commands.

  • For releases prior to L25.10 release
$ cd $MYDROID/bootloader/u-boot
$ make distclean
$ make CROSS_COMPILE=arm-none-linux-gnueabi- omap3430zoom2_config
$ make CROSS_COMPILE=arm-none-linux-gnueabi-
$ cp $MYDROID/bootable/bootloader/u-boot/tools/mkimage ~/bin/

Note: Configuration option varies by platform. Above is an example for building Zoom2. Change "omap3430zoom2_config" to "omap3430labrador_config" for Zoom1(LDP) or "omap3430sdp_config" to enable a build for SDP or "omap3630zoom3_config" for Zoom3.

Note: If you get "cmd_voltage.c:27: error: inline function 'voltage_info' cannot be declared weak" try an older GCC (CSL 2008q3-72 seems ok)

"uboot" is available at:

  • For releases L25.10 and higher
$MYDROID/bootable/bootloader/u-boot/u-boot.bin
  • For releases prior to L25.10
$MYDROID/bootloader/u-boot/u-boot.bin

 Building xloader

  • For releases starting L25.10
$ cd $MYDROID/bootable/bootloader/x-loader
$ make distclean
$ make CROSS_COMPILE=arm-none-linux-gnueabi- omap3430zoom2_config
$ make CROSS_COMPILE=arm-none-linux-gnueabi- ift


  • For releases prior to L25.10 release
$ cd $MYDROID/bootloader/x-loader
$ make distclean
$ make CROSS_COMPILE=arm-none-linux-gnueabi- omap3430zoom2_config
$ make CROSS_COMPILE=arm-none-linux-gnueabi- ift

Note: Configuration option varies by platform. Above is an example for building zoom2. Change "omap3430zoom2_config" to "omap3430labrador_config" or "omap3430zoom2_config" or "omap3630zoom3_config " to enable a build for zoom1 (LDP) or SDP respectively or Zoom3.


"MLO" is available at:

  • For releases L25.10 and higher
$MYDROID/bootable/bootloader/x-loader/MLO
  • For releases prior to L25.10
$MYDROID/bootloader/x-loader/MLO

 Building kernel

  • For releases L25.10 and higher
$ cd $MYDROID/kernel/android-2.6.29
$ make CROSS_COMPILE=/arm-none-linux-gnueabi- distclean
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- zoom2_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage

To build the kernel modules:

$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- modules

The output module for USB gadget is at:

$MYDROID/kernel/android-2.6.29/drivers/usb/gadget/
  • For releases prior to L25.10
$ cd $MYDROID/kernel
$ make CROSS_COMPILE=/arm-none-linux-gnueabi- distclean
$ make CROSS_COMPILE=arm-none-linux-gnueabi- omap_zoom2_android_defconfig
$ make CROSS_COMPILE=arm-none-linux-gnueabi- uImage

Note: Configuration option varies by platform. Above is an example for building zoom2. Change "omap3430zoom2_config" to "omap_ldp_android_defconfig" to enable a build for zoom1 (LDP). Change "omap3430zoom2_config" to "zoom3_defconfig" enable a build for Zoom3 (OMAP3630).

For USB modules:

$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- modules

The output modules are at:

$MYDROID/kernel/drivers/usb/gadget/
  • "uImage" is available at:
    • For releases L25.10 and higher
$MYDROID/kernel/android-2.6.29/arch/arm/boot/
    • For releases prior to L25.10
$MYDROID/kernel/arch/arm/boot/

 Building Filesystem

Copy the board buildspec.mk. default file found under the vendor/ti/ directory to buildspec.mk at the top of your android root folder. This should setup a reasonable default for the board. Check and edit the file for additional options.


Example for zoom1(ldp) board

cp -Rfp vendor/ti/ldp1/buildspec.mk.default buildspec.mk


Example for Zoom2 or Zoom3 boards (same command)

cp -Rfp vendor/ti/zoom2/buildspec.mk.default buildspec.mk

Build Android

$ make -j2

Note: On latest current build there are .mk conflicts and libaudio conflicts that require you to mv or rm vendor/ti/nextgen and hardware/ti/omap3/libaudio/.

Note: On x86_64 if you get a "/usr/bin/ld: skipping incompatible ... libstdc++.a" error you may need to create two symlinks -- "ln -s /usr/lib32/libstdc++.so.6 /usr/lib32/libstdc++.so" and "ln -s /usr/lib32/libgcc_s.so.1 /usr/lib32/libgcc_s.so". See . I also found that I needed lib32z1-dev and lib32ncurses5-dev.


Note: This make step can be speed up by using make’s -j option to enable parallel execution. Recommended settings are: make -j8 for 2 x Quad Core CPU, make -j4 for either a Quad Core CPU or a 2 x Dual Core, make -j2 for a Dual Core CPU and make for a Single Core CPU.

Actually the -j# is creating the number of threads so the CPU can handle. Each thread will require about 1 GB of RAM. If your CPU is capable of handle 4 threads but you have 2 GB of RAM, the compile time will rise since your box will use Swapfile memory.

If you are not sure how many cores your system has type the following command:

$ cat /proc/cpuinfo

That will list the number of cores that your system has. Use -j* where * is the number of cores listed on /proc/cpuinfo.

 Adding System Sounds to Your Product build

You can add the system sounds by calling a couple of included mk files from your product make file. This has been done already for zoom2 in /vendor/ti/zoom2/zoom2-generic.mk

SYSTEM_SOUNDS_PATH := frameworks/base/data/sounds
include $(SYSTEM_SOUNDS_PATH)/OriginalAudio.mk
include $(SYSTEM_SOUNDS_PATH)/AudioPackage2.mk

Note: this can add many wav and ogg files to your system. After saving this change for your product, you would need to rebuild following the steps above.

After building with these changes, these new sounds will be available to use as ringtones, ui interactions, etc. You will need to enable some sounds in the Android Settings widget. For example, key clicks are OFF by default in a zoom2 product build. To enable keyclicks:

1. Navigate to the Settings widget and open it.
2. Select "Sound & Display"
3. Select "Audible touch tones" to toggle on.
4. Select "Audible selection" to toggle on.

You can also select the default notification sound from this same menu. This should be heard at bootup and other system events. The current default is "Look At Me".

 Arm Only Build Option

Note: If you wouldn't use TI's HW Accelerated codecs and would want to perform only an ARM build, please follow the below instructions

After repo sync perform the following steps:

Edit: “vendor/ti/zoom2/BoardConfig.mk”:

Uncomment  “USE_CAMERA_STUB := true” 
Comment “BOARD_USES_TI_CAMERA_HAL := true” 
Comment "HARDWARE_OMX := true”  

Doing so will not build the TI OMX components and Opencore will choose it’s own codecs instead.

SD media Support Option

Note: This only applies to releases L25.9 and lower

All media files (mp3, mp4, aac, etc...) should be loaded onto the boot partition of the SD card. The fix below allows Android to detect the media files that are located on the boot section of the SD. Without this fix Android will not be able to detect media files and will give an error "unable to find media content".

Edit the following file: mydroid/system/core/mountd/ AutoMount.c

--- a/system/core/mountd/ AutoMount.c
+++ b/system/core/mountd/ AutoMount.c       

    if (mp->state != kMounted && mp->state != kMounting && 
           access(mp->device, R_OK) == 0) {

-        if (DoMountDevice(mp->device, mp->mountPoint) == 0 ||
-            MountPartition(mp->device, mp->mountPoint) == 0)
+        if (MountPartition(mp->device, mp->mountPoint) == 0)         
            {             
             SetState(mp, kMounted);         
            }

 Creating Android's File System

    • For Zoom2
$ cd ~/
$ mkdir myfs
$ cd myfs
$ cp -Rfp $MYDROID/out/target/product/zoom2/root/* .
$ cp -Rfp $MYDROID/out/target/product/zoom2/system/ . 
$ cp -Rfp $MYDROID/out/target/product/zoom2/data/ .
$ mv init.rc init.rc.bak 
$ cp -Rfp init.omapzoom2.rc init.rc 
    • For Zoom3
$ cd ~/
$ mkdir myfs
$ cd myfs
$ cp -Rfp $MYDROID/kernel/android-2.6.29/drivers/usb/gadget/*.ko $MYDROID/out/target/product/zoom2/root
$ cp -Rfp $MYDROID/kernel/android-2.6.29/drivers/misc/ti-st/*.ko $MYDROID/out/target/product/zoom2/root
$ cp -Rfp $MYDROID/out/target/product/zoom2/root/* .
$ cp -Rfp $MYDROID/out/target/product/zoom2/system/ .
$ cp -Rfp $MYDROID/out/target/product/zoom2/data/ .
$ mv init.rc init.rc.bak
$ cp -Rfp $MYDROID/vendor/ti/zoom2/omapzoom2-mmc.rc init.rc


    • Once 'myfs' directory is prepared, copy it to sdcard ext2 or ext3 partition (say mounted as /media/FS)
$ cd myfs
$ sudo cp –Rfp * /media/FS
$ sudo chmod 777 -R /media/FS/*


Note: For LDP, the folder is out/target/product/ldp1; For init.rc, copy omapldpboard.rc

 Creating Android's File System for NAND

$ cd $MYDROID/out/target/product
$ cp -Rfp zoom2 zoom2.bak
$ cd zoom2
$ rm -rf *.img
$ rm -rf obj/PACKAGING/systemimage_unopt_intermediates/system.img
$ cp ~/myfs/* $MYDROID/out/target/product/zoom2/root

Note: Ok to see warnings here. Above step is only to copy files and not folders

$ cp -Rfp ~/myfs/system/* $MYDROID/out/target/product/zoom2/system
$ cp -Rfp ~/myfs/data/* $MYDROID/out/target/product/zoom2/data
$ pico $MYDROID/out/target/product/zoom2/root/init.rc (And uncomment out the following lines (by removing the # sign):
“# mount yaffs2 mtd@system /system”
“# mount yaffs2 mtd@userdata /data nosuid nodev”
“# mount yaffs2 mtd@cache /cache nosuid nodev”
$ cd $MYDROID
$ make -j4
$ cd ~/
$ mkdir myfs_NAND
$ cd myfs_NAND
$ cp $MYDROID/bootable/bootloader/u-boot/tools/mkimage .
$ cp $MYDROID/kernel/android-2.6.29/arch/arm/boot/zImage .
$ cp $MYDROID/out/target/product/zoom2/*.img .
$ cp $MYDROID/bootable/bootloader/u-boot/u-boot.bin .
$ cp $MYDROID/bootable/bootloader/x-loader/MLO .

You should create a txt file called /home//myfs_NAND/env.txt with the following text inside:

bootdelay 5
bootargs console=ttyS3,115200n8 rootdelay=1 mem=256M init=/init videoout=omap24xxvout omap_vout.vid1_static_vrfb_alloc=y
bootcmd nand unlock; nand read.i 81c00000 ${kernel_nand_offset} ${kernel_nand_size}; bootm 81c00000

Create an uMulti image by doing:

$ cd ~/myfs_NAND
$ sudo ./mkimage -A arm -O linux -T multi -C none -a 0x80008000 -e 0x80008000 -n 'L25.11' -d ./zImage:./ramdisk.img uMulti-2

 Opening and changing files in ramdisk.img for debugging

A ramdisk is basically a small filesystem containing the core files needed to initialize the system. It includes the critical init process, as well as init.rc, which is where you can set many system-wide properties. If you really want to know more about it, here is the documentation. Here's a list of files on a typical ramdisk:

data
default.prop
dev
env.txt
init
init.goldfish.rc
init.omapzoom2.rc
init.rc
proc
sbin\
sbin\adbd
sbin\hotplug

Here are the steps to open, edit and create a new ramdisk.img

  • Copy the ramdisk.img to your UBuntu (Linux) machine
  • Change the ramdisk.img name to ramdisk.cpio.gz
       # cp ramdisk.img ramdisk.cpio.gz
  • Extract the ramdisk using the command below
       # gzip -d ramdisk.cpio.gz
  • Create a temporary folder, say tmp, copy ramdisk.cpio to tmp folder
       # mkdir tmp
       # cd tmp
       # cp -Rfp ../ramdisk.cpio .
  • Extract the ramdisk.cpio in the tmp folder with command:
       # cpio -i -F ramdisk.cpio
  • Remove the ramdisk.cpio in the tmp folder, and make any changes you want to the extracted ramdisk.cpio in tmp folder
       < Make your changes in RAMDISK files>
       # rm ramdisk.cpio
  • Recreate the ramdisk.cpio with command:
# cpio -i -t -F ../ramdisk.cpio | cpio -o -H newc -O ../ramdisk_new.cpio

Note that in last step: The command includes two O's. First o is lower-case, second is up-case. ramdisk.cpio in up folder of tmp folder. The command needs it there.

  • To generate a new ramdisk.img, rename the ramdisk_new.cpio to ramdisk.cpio and gzip it
         # cd ..
         # rm -rf ramdisk.cpio
         # mv ramdisk_new.cpio ramdisk.cpio
         # gzip ramdisk.cpio
  • Rename ramdisk.cpio.gz to ramdisk.img
       < Make your changes in RAMDISK files>
       # cp ramdisk.cpio.gz ramdisk.img

 Opening system.img for debugging using UNYAFFS tool

Using unyaffs

The Android OS makes use of a yaffs file system. You can download the 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

To open the system.img you can use the command below

       # mkdir tmp
       # cd tmp 
       # sudo ~/bin/unyaffs 

Once you do this you will see the files/folders below

        app
        bin
        build.prop
        etc
        fonts
        framework
        lib
        media
        usr
        xbin

 Installing Busybox Command Line Tools (Optional)

This article describes how to install the busybox command line tools in the Android file-system. Please note that a pre-built version of busybox has been attached to this article if you would prefer not to build busybox yourself. Skip to if you select to use the prebuilt version. For the more information on the latest busybox environment visit:

  • Prebuilt

 Configure and Build

Download from .

Extract the busybox source

$ tar jxf busybox-1.13.3.tar.bz2

Configure busybox

$ cd busybox-1.13.3/
$ make menuconfig

In menuconfig set the following options

$ Busybox Settings --> Build Options --> Build Busybox as a static binary (no shared libs)  -  Enable this option by pressing "Y"
$ Busybox Settings --> Build Options --> Cross compiler prefix  -  Set this option equal to "arm-none-linux-gnueabi-"
$ Busybox Settings --> Installation Options --> Don't use /usr  -  Enable this option by pressing "Y"

Export path to where the cross-compiler is located on the host. For more information on setting up cross-compiler in environment visit:

$ export PATH=$PATH://bin/

Build busybox

$ make

 Installing Busybox to filesystem

Create a /bin directory in the target file-system. For example:

$ mkdir //bin

Copy the busybox binary to the /bin directory in the target file-system

$ cp busybox //bin

Install the busybox command line tools on the target by executing the following commands:

$ cd /bin
$ ./busybox --install

 Make the Busybox shell the default shell

Edit the console service so that it runs the busybox shell and not the default shell by replacing:

$ vim init.rc
-service console /system/bin/sh
+service console /bin/sh

Add the path of the busybox command line tools to the system path variable by replacing:

$ export PATH /sbin:/system/sbin:/system/bin:/system/xbin
#with
$ export PATH /bin:/sbin:/system/sbin:/system/bin:/system/xbin

 Installing Android

This section helps with flashing the software and instructions to boot the system

 Flashing Android

There are several flashing methods such as to SD, NAND and NFS

 Flashing to SD

Prior to proceeding with these steps, review how to setup and format a SD card under . This will provide instructions on creating the two paritions needed to copy the files.

  • Copying Bootloader (uboot.bin, MLO) and kernel to SD Card into boot partition
$ sudo cp -rf /tmp/mmc1
$ sudo cp -rf /tmp/mmc1
$ sudo cp -rf /tmp/mmc1
  • Copying Android Filesystem to the SD card into the secondary partition
$ sudo cp –Rfp ~/myfs/* /tmp/mmc2
$ sudo chmod –R 777 /tmp/mmc2/*
  • Once the Android Filesystem and the Bootloader are copied, remove and replace the card back into card reader and you should see two new media devices,

/media/boot and /media/disk

  • Now remove the card from the card reader
$ sudo umount /media/boot
$ sudo umount /media/disk

 Flashing to NAND using Fastboot

For a quick and fast way to flash Android into NAND refer to

 Other ways to flash Android

Refer to for more ways to flash a zoom2.

 Booting Android (Boot Args)

If the target device is not setup, refer to Configuring the target device.

Insert the SD card into Zoom2 and reboot or hit the reset button. From Hyperterminal/Teraterm on the PC, you should see a boot prompt. Please type the following commands to boot the Zoom2:

Note: If the device does not boot up with your SDHC card, try partitioning the same SDHC card again. If still the device does not boot up try another SDHC card. Many times changing the SDHC card solves the boot up problems.

Below are boot args for SD card (see the list lower to find the specific boot args that match your release)

 #nand unlock
 #nand ecc sw
 #setenv bootargs 'console=ttyS3,115200n8 root=/dev/mmcblk0p2 rw rootdelay=1 mem=256M init=/init'
 #setenv bootcmd 'mmcinit; fatload mmc 0 0x80c00000 uImage; bootm 0x80c00000'
 #saveenv
 #boot

Now, you should see Android booting on Zoom2....Congratulations!


For releases after L25.9, please note the below changes in boot args (replace them for the above).

L25.9 - Addition of videoout=omap24xxvout ...

#setenv bootargs ‘console=ttyS3,115200n8 root=/dev/mmcblk0p2 rw rootdelay=1 init=/init mem=256M videoout=omap24xxvout’

L25.10 - Change in memory location

#setenv bootcmd 'mmcinit; fatload mmc 0 0x81c00000 uImage; bootm 0x81c00000'

L25.11 - Inclusion of boot arg for Frame Buffer

#setenv bootargs console=ttyS3,115200n8 root=/dev/mmcblk0p2 rw rootdelay=1 mem=256M init=/init \
videoout=omap24xxvout omap_vout.vid1_static_vrfb_alloc=y
#setenv bootcmd 'mmcinit; fatload mmc 0 0x81c00000 uImage; bootm 0x81c00000'

L25.12 - New bootarg to enable video

#setenv bootargs console=ttyS3,115200n8 root=/dev/mmcblk0p2 rw rootdelay=1 mem=256M init=/init \
videoout=omap24xxvout omap_vout.video1_numbuffers=4 omap_vout.vid1_static_vrfb_alloc=y
#setenv bootcmd 'mmcinit; fatload mmc 0 0x81c00000 uImage; bootm 0x81c00000'

L25.13, L25.14 & L25.14M1- New bootarg to enable video

#setenv bootargs console=ttyS3,115200n8 root=/dev/mmcblk0p2 rw rootdelay=1 mem=256M init=/init \
videoout=omap24xxvout omap_vout.video1_numbuffers=6 omap_vout.vid1_static_vrfb_alloc=y
#setenv bootcmd 'mmcinit; fatload mmc 0 0x81c00000 uImage; bootm 0x81c00000'

L25E.16

#setenv bootargs console=ttyS3,115200n8 root=/dev/mmcblk0p2 rw rootdelay=1 mem=256M init=/init \
videoout=omap24xxvout omap_vout.video1_numbuffers=6 omap_vout.vid1_static_vrfb_alloc=y omapfb.vram=“0:4M”
#setenv bootcmd 'mmcinit 0; fatload mmc 0 0x81c00000 uImage; bootm 0x81c00000'

L25inc2.2:

#setenv bootargs console=ttyS3,115200n8 root=/dev/mmcblk0p2 rw rootdelay=1 mem=256M init=/init \
videoout=omap24xxvout omap_vout.video1_numbuffers=6 omap_vout.vid1_static_vrfb_alloc=y omapfb.vram=“0:4M”
#setenv bootcmd 'mmcinit; fatload mmc 0 0x81c00000 uImage; bootm 0x81c00000'

L25inc2.3 - Change in bootcmd and ecc:

 * mmcinit is now "mmcinit 0" or "mmc init 0"
 * we are now using hw ecc for all partitions
#nand unlock
#nand ecc hw
#setenv bootargs console=ttyS3,115200n8 root=/dev/mmcblk0p2 rw rootdelay=1 mem=256M init=/init \
videoout=omap24xxvout omap_vout.video1_numbuffers=6 omap_vout.vid1_static_vrfb_alloc=y omapfb.vram=“0:4M”
#setenv bootcmd 'mmcinit 0; fatload mmc 0 0x81c00000 uImage; bootm 0x81c00000'
#saveenv
#boot

L23.I3x - mmcinit command requires parameter '0'

#set bootargs 'console=ttyS3,115200n8 root=/dev/mmcblk0p2 rw rootdelay=1 mem=256M init=/init  \
stdin=serial stdout=serial stderr=serial omap_vout.vid1_static_vrfb_alloc=y omapfb.vram="0:4M" '
#set bootcmd 'mmcinit 0;fatload mmc 0 0x80300000 uImage;bootm 0x80300000'


For NFS Boot,

 root=/dev/mmcblk0p2 option would change to 
 root=/dev/nfs rw nfsroot=:/,nolock,wsize=1024,rsize=1024 ip=dhcp
 e.g.  root=/dev/nfs rw nfsroot=128.247.77.43:/home/user/l25.7/myfs/,nolock,wsize=1024,rsize=1024 ip=dhcp

Note 1: All the other changes listed above apply depending on the release Note 2: On Zoom2, if there is a debug board installed, to see the console output, change ttyS2 to ttyS3. Note 3: Android boots slowly when running over NFS. Expect to wait for the system to boot.

 Debugging

 Enabling TI Hardware Accelerated Codecs

Since all OpenMax components are available in the public git trees, hardware accelerator binaries have been released that corresponds to certain Android releases.
For accessing the Android git trees, please refer to link above.
To download the hardware accelerator package, look for the "Android_DSP_Binaries" link in the section of this project.

See for the list of publically available codecs.

Please drop all of the hardware accelerator binaries from the DSP directory (from the downloaded installation above) in to your /system/lib/dsp directory in your target file system. Please note that if the "dsp" directory is not present in your target file system it will need to be created.

For more detailed information refer to wiki.


 Installing WLAN and Bluetooth in Android

Refer to page on how to obtain the firmwarre and setup the system for WLAN and BT to work on Android


 Enabling Ethernet Port for Browsing

 Checking the Kernel

Ethernet support is already built into the default Kernel configuration provided by Texas Instruments. To double check if ethernet is set in the kernel configuration, look in the .config file in the Kernel root directory and check that the following is set to "y":

CONFIG_INET 
IP_PNP 
CONFIG_IP_PNP_DHCP 
CONFIG_NET_ETHERNET 
CONFIG_MII 
CONFIG_SMC911X 

If Ethernet and networking configurations are not enabled properly, then use the menu config to enable it. To enter menu config, type "make menuconfig" in the Kernel root directory. Follow the following to enable:

Networking supportàNetworking optionsà 
  TCP/IP networking 
  IP: kernel level autoconfiguration 
  IP: DHCP support 
Device DriversàNetwork device supportàEthernet (10 or 100Mbit)à 
   Generic Media Independent Interface device support 
   SMSC LAN9115678 support 

 Checking the Bootargs

Once you have a proper kernel image, ethernet and TCP/IP should be operational. To get a valid DHCP add "ip=dhcp" to the u-boot bootargs environment variable, i.e.

 setenv bootargs 'console=ttyS3,115200n8 root=/dev/mmcblk0p2 rw rootdelay=1 mem=256M ip=dhcp init=/init'

With the ip variable set in the bootargs, the kernel will use DHCP during boot-up to grab IP address from the DHCP server. Once this variable is set, the kernel will block until it detects a valid connection.

 Checking the Android Properties

To get the Android browser to resolve address names, set the DNS server property. In either the ADB or COM shell, give the following command: “setprop net.dns1 xxx.xxx.xxx.xxx” where xxx.xxx.xxx.xxx is the IP address to your DNS server.

Note: If you are behind a proxy, then at the time this article was written we have NOT found a method to set the proxy server for the Android browser to use. We have tried using "setprop net.eth0.http-proxy hostname:port" and "setprop net.gprs.http-proxy hostname:port", but neither could get us through the proxy. Also, the option of adding an entry of (99,'http_proxy','hostname:port") to the 'system' and 'secure' tables in the /data/data/com.android.providers.settings/databases/settings.db database has also been tried, but failed.


 Installing an Application on Android

How to install an App using Android Debug Bridge (ADB)

ADB is located in \out\host\linux-x86\bin\adb

On the linux host type the following command assuming target is connected on same network via Ethernet

  1. Killall –a adb
  2. export ADBHOST=
  3. adb shell

Then once you get ADB shell you can use various ADB command like ‘install’ to install apk file. For details refer ADB documentation

You may also install an application directly without the shell by typing

  1. adb install appName.apk


 Discuss

If you run into an issue there is a active community around this project to help you out. Firstly, be sure to search this website to see if you issues is already addressed in other pages.


Mailing List

The project mailing list is omapandroid-discussion@gforge.ti.com. You should first subscribe to this list from omapandroid-discussion


IRC Chat

The community around the Zoom platform is typically on #linux-omap channel on irc.freenode.net. You should be able to chat and ask your questions. If you are new to IRC chat checkout the page.

阅读(3063) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~