User:CodeKipper/SDK build howto A23

Jump to: navigation, search

Allwinner usually provides device manufacturers with a complete SDK that includes the matching u-boot and kernel sources (with some odd binaries), Android packages, buildroot, build scripts and a matching Linaro toolchain.

Development board vendors share the SDK with hardware owners to customize. This howto assumes you have such an SDK. This document is based on the A23 SDKs.



This howto is not complete and the intention is to merge it into the original SDK how to.

Contents of the SDK

The SDK is split into several parts, but the build scripts requires them to be complete.

  • android
  • lichee
    • -- main build script
    • buildroot -- rootfs, toolchain, and build scripts
    • linux-3.4 -- linux kernel
    • brandy -- boot related stuff
      • -- simple build script for u-boot
      • u-boot-2011.09 -- Allwinner's port of u-Boot
    • out -- build intermediaries and results. toolchain is also in here
    • tools
      • tools_win -- LiveSuit/PhoenixSuit tools and drivers
      • pack -- tools and configuration related to firmware packing
        • chips -- chip specific files (boot0/u-boot binaries, fex files)
        • common -- common config files and tools
        • out -- work directory for firmware packing
        • pack -- firmware packing script

Android Build

Once you have unpacked the SDK (the lichee directory in particular), you can go in a do a straight full build, which results in a LiveSuite image.

Configuring the Build

The SDK can build android or linux flavor images, and may target different boards. Running ./ will list the options.

lichee$ ./

To change the configuration add config as an argument. Running will produce binaries and images under out/android/common. We will need to point to these files during the building of the android image.

Building Android

android$ source build/ 
including device/asus/grouper/
including device/asus/tilapia/
including device/generic/armv7-a-neon/
including device/generic/armv7-a/
including device/generic/mips/
including device/generic/x86/
including device/lge/mako/
including device/samsung/maguro/
including device/samsung/manta/
including device/samsung/toroplus/
including device/samsung/toro/
including device/softwinner/polaris-c1/
including device/softwinner/polaris-c2/
including device/softwinner/polaris-common/
including device/softwinner/polaris-evb/
including device/softwinner/polaris-p1gms/
including device/softwinner/polaris-p1/
including device/softwinner/polaris-p4/
including device/ti/panda/
including sdk/bash_completion/adb.bash

android$ lunch

You're building on Linux

Lunch menu... pick a combo:
     1. full-eng
     2. full_x86-eng
     3. vbox_x86-eng
     4. full_mips-eng
     5. full_grouper-userdebug
     6. full_tilapia-userdebug
     7. mini_armv7a_neon-userdebug
     8. mini_armv7a-userdebug
     9. mini_mips-userdebug
     10. mini_x86-userdebug
     11. full_mako-userdebug
     12. full_maguro-userdebug
     13. full_manta-userdebug
     14. full_toroplus-userdebug
     15. full_toro-userdebug
     16. polaris_c1-eng
     17. polaris_c2-eng
     18. polaris_evb-eng
     19. polaris_p1gms-user
     20. polaris_p1-eng
     21. polaris_p4-eng
     22. full_panda-userdebug

Which would you like? [full-eng] 21



This should create the image files that are needed for packing. I found that this failed as the kernel and modules were missing from the device/softwinner/polaris-p4/ directory. To fix this then I created symbolic links to the files created when we built buildroot.

android$ cd device/softwinner/polaris-p4/
android$ ln -s ../../../../lichee/out/android/common/bImage kernel
android$ mkdir modules
android$ ln -s ../../../../../lichee/out/android/common/lib/modules/3.4.39 modules/modules
android$ make

Packing the Image

Run the following command to pack the final LiveSuit image.

lichee$ ./ pack

Enter the same selection as you made when you configured the build at the start.

I found that the packing script was looking for the CRANE_IMAGE_OUT variable to be set. I know this is done by in androiddevice/softwinner/polaris-common but I haven't worked out what calls that. In the end I added this line to lichee/tools/pack


The resulting file that can flashed using LiveSuit can be found lichee/tools/pack. In this case it's called sun8iw3p1_android_polaris-p4.img.

Personal tools