FriendlyARM: Android: Compiling

From ARMWorks
Jump to: navigation, search

Android > Compiling

Once your Android Build Environment is installed, FriendlyARM provides a couple scripts that make compiling and generating a usable image really easy.

Prerequisites

Build Environment

Compiling

Set Environment/Build Variables

FriendlyARM provides a couple scripts that can quickly get you on your way. The first is the setenv script. Running this script will set all the environment variables you'll need.

   # cd /path/to/android/sources
   # ./setenv

Optionally you can do it the standard way.

   # source /build/envsetup.sh
   # lunch

This will ask you a few question, one being the version you want to build, FriendlyARM has a couple, indicated with the board number, 210, 4412, etc.

Run Build Script

210 Boards

FriendlyARM provides the genrootfs.sh which will build and then create the necessary images, using the installed mktools programs.

   # ./genrootfs.sh image

I ran into an issue with Debian where I had to change the shebang line from #!/bin/sh to #!/bin/bash for script compatibility.

4412 Boards

  # make -j<number of cpu cores>

After compiling, you'll need to generate the images needed.

   # ./gen-img.sh

If you just want to generate the root filesystem run.

  # ./gen-rootfs.sh

For either version, reading through the build scripts can make a lot of sense of what is going on, and his highly recommended.

Issues

If you get a complaint about script issues, you'll need to change the script shebang line from #!/bin/sh to #!/bin/bash this is due to the default shell not being bash in your Linux distribution.