From OMAPpedia

Revision as of 22:27, 25 September 2012 by A0274177 (Talk | contribs)
Jump to: navigation, search


Flashing Android

Get prebuilt binaries

Download Android binaries boot.img, system.img and userdata.img here

Getting to fastboot mode

You need to enter your Q into fastboot mode. You can do that using adb:

$ adb reboot-bootloader

or using the following trick:

Burn the images on Q

Flashing your Nexus Q will erase the original firmware. Don't do that unless you absolutely sure

This assumes you have paths to the adb and fastboot set up properly. If you build your own Android images, see section #Setting up environment variables. Alternatively, you can install Android SDK which has those tools under platform/tools.

$ sudo fastboot flash boot <dir>/boot.img
$ sudo fastboot flash userdata <dir>/userdata.img
$ sudo fastboot flash system <dir>/system.img
$ sudo fastboot reboot

Here <dir> is either ~/mydroid/out/target/product/steelhead or directory contains downloaded binary images.

After reboot full android should come up. It supports video/audio output to HDMI, input using USB mice and keyboards connected to USB-On-The-Go Adapter. No Bluetooth, Wifi, NFC, sound amplifier support yet.

In order to get Ethernet up you hav to issue:

$ adb root
$ adb shell netcfg eth0 dhcp

Building Android

Downloading ASOP – Jellybean code

See detailed instructions on

First, install android source code management tool:

$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl > ~/bin/repo
$ chmod a+x ~/bin/repo

When downloading from behind a proxy (which is common in some corporate environments), it might be necessary to explicitly specify the proxy that is then used by repo:

$ export HTTP_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>
$ export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>

Getting Android source code:

$ mkdir mydroid
$ cd mydroid
$ repo init -u
$ repo sync -j 4

Install necessary packages (Ubuntu):

# sudo apt-get install gperf xsltproc zlib1g:i386 gcc-multilib libxml2-utils

Get Android device definition for Q

Download device files from here.

$ cd mydroid/device/google
$ mkdir steelhead
$ cd steelhead
$ tar -xzvf <path_to>/android.steelhead.tar.gz


$ cd mydroid/hardware/ti
$ git clone git://
$ cd domx
$ git checkout -b local origin/jb-release

Get binary drivers

Graphics drivers should be obtained prior to building Android images

$ cd mydroid/device/ti
$ git clone git://
$ cd proprietary-open
$ git checkout -b local origin/jb-release
$ git reset --hard 14109844cc22d0ee512d569a09825a0404400079

Apply patches

Bundled kernel headers

$ cd mydroid/bionic
$ git fetch refs/changes/89/26989/1 && git cherry-pick FETCH_HEAD

Ion library

$ cd mydroid/system/core
$ git fetch refs/changes/88/26988/1 && git cherry-pick FETCH_HEAD


$ cd mydroid/hardware/ti/omap4xxx/domx
$ git fetch refs/changes/90/26990/1 && git cherry-pick FETCH_HEAD
$ git fetch refs/changes/91/26991/1 && git cherry-pick FETCH_HEAD

Setting up environment variables

$ cd ~/mydroid
$ source build/
$ setpaths
$ lunch full_steelhead-userdebug

Build Android images

Set up variables

$ cd ~/mydroid
$ make -j12

After build successfully finished you will have all the images under out/target/product/steelhead. You can flash them as described in #Burn the images on Q.

Builing Linux kernel

Android device definition includes prebuilt kernel so this step is optional.

The Kernel is built using Sourcery G++ Lite 2010q1-202 for ARM GNU/Linux version. This tool chain can be obtained from here.

Clone TI android 3.0 kernel

$ mkdir ~/mydroid/kernel
$ cd ~/mydroid/kernel
$ git clone git://
$ cd omap/
$ git checkout -b local origin/p-android-omap-3.0
$ git reset --hard a2d5b450b00fd71309d447eb63fa5591ed7bfa07

Apply patches on kernel

$ cd ~/mydroid/kernel/omap
$ git fetch refs/changes/12/26512/7 && git cherry-pick FETCH_HEAD
$ git fetch refs/changes/13/26513/8 && git cherry-pick FETCH_HEAD
$ git fetch refs/changes/14/26514/10 && git cherry-pick FETCH_HEAD
$ git fetch refs/changes/92/26792/10 && git cherry-pick FETCH_HEAD
$ git fetch refs/changes/34/27034/9 && git cherry-pick FETCH_HEAD
$ git fetch refs/changes/31/27231/3 && git cherry-pick FETCH_HEAD

Build kernel

$ export PATH=$PATH:<codesourcery_path>/arm-2010q1/bin
$ cd ~/mydroid/kernel/omap
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- steelhead_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- zImage

The kernel we just build has not gone in Android yet. Make sure you have the paths set as for Android build. Use the same shell prompt or issue:

$ cd ~/mydroid/
$ source build/envsetup
$ lunch full_steelhead-userdebug

Copy kernel to where android results are placed:

$ cp ~/mydroid/kernel/omap/arch/arm/boot/zImage $OUT/kernel

Do and incremental build so that the zImage goes into boot.img

$ # environment should be set for android build
$ cd ~/mydroid
$ make -j12
Personal tools