SDK build howto A31

Jump to navigation Jump to 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 A31 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-4.4
  • 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$ ./ -p sun6i_fiber

I found that this failed silently when generating the rootfs(see gen_rootfs_log.txt). The reason for this was that the treat warning as errors flag was set in By removing this then everything worked as expected. Running will produce binaries and images under out/<platform>/{linux,android}.

Building Android

android4.4$ source build/
including device/asus/tilapia/
including device/asus/deb/
including device/asus/grouper/
including device/asus/flo/
including device/lge/mako/
including device/lge/hammerhead/
including device/softwinner/fiber-a31stm/
including device/softwinner/fiber-3g/
including device/softwinner/fiber-a31st512m/
including device/softwinner/fiber-w02/
including device/softwinner/fiber-common/
including device/softwinner/fiber-a31st/
including device/generic/x86/
including device/generic/armv7-a-neon/
including device/generic/mips/
including device/samsung/manta/
including sdk/bash_completion/adb.bash

android4.4$ lunch

You're building on Linux

Lunch menu... pick a combo:
     1. aosp_arm-eng
     2. aosp_x86-eng
     3. aosp_mips-eng
     4. vbox_x86-eng
     5. aosp_tilapia-userdebug
     6. aosp_deb-userdebug
     7. aosp_grouper-userdebug
     8. aosp_flo-userdebug
     9. aosp_mako-userdebug
     10. aosp_hammerhead-userdebug
     11. fiber_a31stm-eng
     12. fiber_a31stm-user
     13. fiber_3g-eng
     14. fiber_a31st512m-eng
     15. fiber_a31st512m-user
     16. fiber_w02-eng
     17. fiber_w02-user
     18. fiber_a31st-eng
     19. fiber_a31st-user
     20. mini_x86-userdebug
     21. mini_armv7a_neon-userdebug
     22. mini_mips-userdebug
     23. aosp_manta-userdebug

Which would you like? [aosp_arm-eng] 13



This should create the image files that are needed for packing.

Packing the Image

Run the following command to pack the final LiveSuit image.

lichee$ ./ pack

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


The resulting file that can flashed using LiveSuit can be found lichee/tools/pack_brandy. In this case it's called sun6i_android_fiber-3g.img