Build Android

Get and patch the Android source code

Download the Android patch file

$ cd <ANDROID_WORKING_DIR>/device
then download the patch file from following link into the folder:

Description Resource URL Features
Android source code patch Android-2.3.7_r1.tar.gz (~ 4 MB)
  • Stagefright plugin for hardware video decoder in sam9m10 chips NEW
  • Use H&D SDIO WIFI driverNEW
  • Add camera application
  • Add the touchscreen calibration application to Android
  • Add IP configure application to Android
  • Add configuration files for Android system initialization and ALSA system

Extract the patch file in vendor folder:

$ tar -zxvf Android-2.3.7_r1.tar.gz
Now you can see a new folder < ANDROID_WORKING_DIR >/device/atmel.

Configure and Build Android

Configure compiling environment, take SAM9M10 MCU as an example:

      $ cd <ANDROID_WORKING_DIR>
      $ make clean
      $ source build/envsetup.sh
      $ partner_setup sam9m10
      $ choosecombo Device release sam9m10 eng

build/envsetup.sh
This is to setup Android build environment.

choosecombo
This is used to configure the building environment
  • Syntax:
    choosecombo [Device|Simulator] [release|debug] [device_name] [variants]
  • Parameters of choosecombo
    • Device, used for real device, not simulator
    • Simulator, used for simulator
    • release, used for release version
    • debug, used for debug version
    • variants, three options: user | userdebug | eng. For detailed information, please goto http://source.android.com/source/building.html and have a look at section "Choose a Target".

More about partner_setup
partner_setup is a method to copy the modified code from device/atmel to its original space. This command just changes the space to location. Therefore, if you modify the code under device/atmel, you need to run partner_setup before rebuild the your code.
TIP For SAM9G45 MCU, please execute
      $ partner_setup sam9g45 
      $ choosecombo Device release sam9g45 eng

TIP For SAM9X5 MCU, please execute
      $ partner_setup sam9x5
      $ choosecombo Device release sam9x5 eng
When the configuration is finished, the messages will be similar as following:
      PLATFORM_VERSION_CODENAME=REL
      PLATFORM_VERSION=2.3.7
      TARGET_PRODUCT=sam9m10
      TARGET_BUILD_VARIANT=eng
      TARGET_SIMULATOR=false
      TARGET_BUILD_TYPE=release
      TARGET_BUILD_APPS=
      TARGET_ARCH=arm
      HOST_ARCH=x86
      HOST_OS=linux
      HOST_BUILD_TYPE=release
      BUILD_ID=GWK74
  • Run make
          $ make
    
  • ALERT!Note that if your host machine has multiple CPU cores, you can use
          $ make -j2
    
    or
          $ make -j4
    
    to speed up the building process.
  • If all goes well, a new folder “out” under the current directory will be newly created. You will see message as follows.
    Generated: (out/target/product/sam9m10/android-info.txt)
    Target system fs image: out/target/product/sam9m10/obj/PACKAGING/systemimage_intermediates/system.img
    Install system fs image: out/target/product/sam9m10/system.img
    Target ram disk: out/target/product/sam9m10/ramdisk.img
    Target userdata fs image: out/target/product/sam9m10/userdata.img
    Installed file list: out/target/product/sam9m10/installed-files.txt
    


For more information, you can refer to Android web site: http://source.android.com/porting/build_system.html


See also: GenerateAndroidImage, AndroidRootfs, GetAndroid
r10 - 11 Apr 2013 - 03:23:10 - VoiceShen
 
Android4SAM

Copyright by the contributing authors. All material on the platform is the property of the contributing authors.

Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions

Atmel and others, are registered trademarks or trademarks of Atmel or its subsidiaries.This site is powered by the TWiki collaboration platform

ARM and others are registered trademarks or trademarks or ARM Ltd. Other terms and product names may be trademarks of others.

Under the terms of the Creative Commons Attribution License

Syndicate this siteRSS ATOM