Setting up an Android build environment for WaRP
Building Android for the first time can be an aggravating and time consuming process. Following these step-by-step instructions should result in a working build environment and a successful Android build with all the images that are needed to run Android on WaRP, including the bootloader, kernel and Android system and recovery partition.
This guide was written starting from installation of Ubuntu Desktop 14.04.2 LTS on a VM. Users
Important Notes
- Building Android requires approximately 50GB of free disk space.
- Downloading all the pre-requisite files during the ‘repo sync’ step can take more than an hour depending on connection speed.
- Building Android can take a few hours, depending on the speed of your machine.
Getting Started
This guide was written using a VM (VMWare or VirtualBox should both work fine).
VMWare Workstation (Free Trial)
VirtualBox (Free)
64-bit Ubuntu Desktop 14.04.2 LTS (64-bit version required. 32-bit version will not build Android)
On first boot of Ubuntu, install system updates
If using VMWare, install VMWare Tools now.
Install OpenJDK6
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java6-installer sudo apt-get install bison git gperf libxml2-utils make zlib1g-dev:i386 zip sudo apt-get install g++-multilib sudo apt-get install liblzo2-dev:i386Install gcc and g++
sudo apt-get install gcc sudo apt-get install g++Configure git user and email
git config --global user.name "FirstName LastName" git config --global user.email username@domain.comInstalling vim/gvim
I use gvim for source editing. Because this is a fresh Ubuntu install, go ahead and install your text editor of choice.sudo apt-get install vim-gtkInstall repo
mkdir ~/bin PATH=~/bin:$PATH curl https://storage.googleapis.com/git-repo-downloads/repo &> ~/bin/repo chmod a+x ~/bin/repoInitialize and download Android repository (source code)
Warning: ‘repo sync’ step downloads the source repository and can take a long time depending on connection speed.
mkdir WaRP_Android repo init -u https://github.com/warpboard/platform_manifest/ -b warp/imx_open_jb4.3_1.1.0-ga repo syncSet up environment variables
Add the following lines to ~/.bashrc to define the machine architecture and cross compiler.
export ARCH=arm export CROSS_COMPILE=arm-linux-gnueabi- export PATH=~/bin:$PATH# Android build specific defines
export USE_CCACHE=1Not required, but I like to use these grep and find aliases when working with the kernel. They can be added to ~/.bashrc
alias sgrep='grep --include={*.c,*.h} -rn "./" -i -e' alias kgrep='grep --include={Makefile,Kconfig} -rn "./" -i -e' alias sfind='find . | grep'Build Android
We should be all ready to build now!source build/envsetup.sh lunch warpboard-eng make -j4Build outputs
Congratulations, you should now have successfully built images that you can load onto your WaRP board.
Images should be located in the directory:~/WaRP_Android/out/target/product/warpU-Boot bootloader binary:u-boot.imxBinaries for system:boot.img
recovery.img
system.imgAdditional External Resources
Official Android Instructions for Initializing a Build Environment
Hi
When I finished Build Android, I only have u-boot.imx file, I cant the find boot.img, recovery.img and system.img.
Why?
Thanks
Nex
Hey Nex,
Sounds like the build probably error’d out at some point. Can you post/link to the build log?
Hi Jacob
It found those files after I reboot my computer and rebuild it.
Thanks