Android Panda Build Source

=Android on PandaBoard Build From Source=

Here we will take a look at Building Android from Source for PandaBoard.

Tools & Dependency packages
Pre-requisite packages for building the Android Filesystem (Note this is with reference to Ubuntu 10.04 64-bit). Ubuntu 64-bit is required by Ice Cream Sandwich.

If you are behind firewall, you will have to set-up firewall using the instructions in

The following commands will install the correct packages to your server:

sudo apt-get install git-core flex bison gperf libesd0-dev zip libwxgtk2.6-dev zlib1g-dev build-essential tofrodos x-dev sudo apt-get install lib32readline5-dev libstdc++6 lib32z1 lib32z1-dev ia32-libs g++-multilib libx11-dev libncurses5-dev

Add the partner repositories and install the JDK:

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" sudo apt-get update sudo apt-get install sun-java6-jdk

Install latest repo tool:

mkdir ~/bin -p sudo apt-get install curl curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo chmod a+x ~/bin/repo export PATH=~/bin:$PATH

Command to get repo version:

repo --version Should be repo version v1.7.8.2 or higer.

If you do not have sudo rights to your machine, contact your System Administrator for assistance.

Tool Chain for building Kernel and Drivers

The Kernel and Driver sources are built using Sourcery G++ Lite 2010q1-202 for ARM GNU/Linux version.

This tool chain can be obtained from

2010q1-202

NOTE: Must use this specific version to avoid internal compiling errors.

Buildilng from AOSP master branch
AOSP supports panda as a build target on the master branch. Please visit http://android.googlesource.com for more details. In general follow below steps to get the AOSP source code and build it for PandaBoard. AOSP includes pre-built kernel, u-boot and x-loader on it's master branch.

The device/ti/panda/README also contains instructions on building and installing the software onto a SD card.

$ mkdir ~/bin $ PATH=~/bin:$PATH $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo $ chmod a+x ~/bin/repo $ mkdir WORKING_DIRECTORY $ cd WORKING_DIRECTORY $ repo init -u https://android.googlesource.com/platform/manifest $ repo sync $ . build/envsetup.sh  $ lunch full_panda-eng $ make -j4

Buildilng from Linaro
Follow below steps to build AOSP from Linaro. When you do repo sync as mentioned below then you get kernel source also in the kernel folder.

export MANIFEST_REPO=git://android.git.linaro.org/platform/manifest.git export MANIFEST_BRANCH= export MANIFEST_FILENAME=landing-panda.xml mkdir android cd android repo init -u ${MANIFEST_REPO} -b ${MANIFEST_BRANCH} -m ${MANIFEST_FILENAME} repo sync export TARGET_PRODUCT=pandaboard export TOOLCHAIN_URL=http://snapshots.linaro.org/android/~linaro-android/toolchain-4.6-2012.05/1/android-toolchain-eabi-linaro-4.6-2012.05-1-2012-05-18_15-55-36-linux-x86.tar.bz2 wget ${TOOLCHAIN_URL} tar -jxvf android-toolchain-eabi-linaro-*

. build/envsetup.sh   lunch full_panda-eng

export HOST_CC= export HOST_CXX= export HOST_CPP= export TARGET_SIMULATOR=false export TARGET_TOOLS_PREFIX=/your_toolchain_path/bin/arm-linux-androideabi- export TARGET_PRODUCT=full_panda

make -j4 boottarball systemtarball userdatatarball showcommands > build_log_YYMMDD.txt 2>&1 &

Buildling Linaro Kernel
Identify the exact build you're interested in, e.g.:

https://android-build.linaro.org/builds/~linaro-android/leb-panda/#build=90

Look at the pinned-manifest.xml. That manifest contains the exact revisions that were used for all the sub-gits. Look for the kernel:



Find the remote "linaro":



Synthesize the git clone command line:

git clone git://git.linaro.org/people/asac/android/kernel/pandroid -b 062684a2a23eae7f3f0b93b437aaa4429f5fbe0c

Now browse build log, accessible by "Log: complete output" link on build's page. (It may be easier to save to your computer, though Ctrl+F also works.)

$ grep ARCH=arm consoleText.txt TARGET_ARCH=arm make ARCH=arm CROSS_COMPILE=/mnt/jenkins/workspace/linaro-android_leb-panda/build/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- defconfig panda_defconfig &&\ make ARCH=arm CROSS_COMPILE=/mnt/jenkins/workspace/linaro-android_leb-panda/build/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- uImage

Those are your build command for kernel, you will reuse them.

Now look in the pinned manifest for the prebuilt subproject, which contains toolchain (caveat: there might be separate Linaro toolchain used instead, describe such case too).



This is using the default remote:





Construct the clone call:

git clone git://android.git.kernel.org/platform/prebuilt -b 671c1cd3e5c89891cadd615e53484df904ac1810

Fix up the build lines:

TARGET_ARCH=arm make ARCH=arm CROSS_COMPILE=prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- defconfig panda_defconfig &&\ make ARCH=arm CROSS_COMPILE=prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- uImage

and build.

Building AOSP kernel
Below steps would get you AOSP kernel source code and build.

git clone https://android.googlesource.com/kernel/omap cd omap git checkout remotes/origin/android-omap-panda-3.0 make ARCH=arm CROSS_COMPILE= mrproper make ARCH=arm CROSS_COMPILE= panda_defconfig make uImage

Building x-loader and u-boot
U-boot and xloader are availalbe from mainline u-boot. Follow below instructions to build them.

git clone git://git.linaro.org/boot/u-boot-linaro-stable.git cd u-boot-linaro-stable.git make CROSS_COMPILE=arm-none-linux-gnueabi- omap4_panda # Replace the CROSS_COMPILE with the name of your compiler

After the compile is done you should see two files named MLO and u-boot.img. u-boot.img is same as u-boot.bin with some header information. Copy the MLO file as MLO in the boot partition of the SD and copy the u-boot.img as u-boot.bin in the boot partition of the SD card.

Install AOSP Images
Follow the instructions in the devices/ti/panda/README file to format the SD card, put the Panda board into fastboot mode, and installing the filesystem images.