How To Build Android 4.2.2 for A20-OLinuXino-MICRO from scratch


Image

First you have to download the Allwinner SDK 2.0 with Linux Kernel 3.4 from dl.linux-sunxi.org.

Here is the direct link

Then you need to setup your environment as explained here

Then Build the kernel, kernel modules and u-boot

   cd lichee
   ./build.sh -psun7i_android

When done, continue with Bulding the android image:

   cd ../android4.2
   cd device/softwinner/
   tar zxfv olinuxino-a20.tgz
   cd ../../
   source build/envsetup.sh
   lunch #select olinuxino-a20_eng
   extract-bsp
   make -j4
   pack

At this point you have the same Android 4.2.2 .img like the one which is on our wiki and you can program it to your board with Phoenix Suite!

23 Comments (+add yours?)

  1. Rafael Swiggers
    Feb 01, 2014 @ 14:26:24

    Hello,

    after a change I’ve managed to compile, but when I “pack” I get the following error:

    “ERROR: board dir or path do not exist.”

    Reply

  2. Dave McLaughlin
    Feb 02, 2014 @ 07:05:36

    Same here and is what I have posted in the forum. It is not the same by the way as some parts are missing for the pack as you discovered.

    @Rafael, the reason that pack fails is because the olimex-a20 directory is missing from the lichee/tools/pack/chips/config/suns7i/android/ directory. This is the board entry in the packages.sh file.

    We need to see if we can get this from Olimex or the person who created the source. I suspect this is why the image fails to boot for me as I tried to use the wing-nck70 settings but they don’t match with the script.bin file as the sys_config.fex is configured for capacitive touch and for no UART 6 and 7 and the partition layout may also be wrong from those settings.

    Reply

  3. weegieboy
    Feb 10, 2014 @ 13:58:10

    This still does not build as downloaded. The pack fails because the config is missing. The files on the link are still the same size so nothing new has been added.

    I can build it with changes but it fails to boot with a surfaceflinger crashes. Others have the same issue so this is still not 100% complete 🙂

    Reply

  4. Henno
    Feb 10, 2014 @ 23:26:05

    You deleted the storage sata part in storage_list.xml to make the compilation work?

    And what package do I need to install to have the command “pack” on my ubuntu system? Thanks!

    Reply

  5. Henno
    Feb 10, 2014 @ 23:39:31

    Maybe the files you are looking for are here: http://bundie.neterra.net:8080/index.php?path=a20%2Fpack/

    Reply

  6. Rafael Swiggers
    Feb 11, 2014 @ 02:35:18

    Henno,

    I think those are the correct files. I’ll try.

    Thank’s

    Reply

  7. Dave McLaughlin
    Feb 11, 2014 @ 13:32:32

    I tried the 800×480 version and it still crashes during booting Android.

    I’ve even tried using the sys_config.fex from the supplied working image! Doesn’t work either.

    I/SurfaceFlinger( 2508): GraphicBufferAlloc::createGraphicBuffer
    W/SurfaceFlinger( 2508): hw_get display module Failed!
    D/SurfaceFlinger( 2508): display dispatcher enabled
    W/SurfaceFlinger( 2508): wifidisplay dispatcher disable
    I/SurfaceFlinger( 2508): GraphicBufferAlloc::createGraphicBuffer
    I/SurfaceFlinger( 2508): EGL informations:
    I/SurfaceFlinger( 2508): vendor : Android
    I/SurfaceFlinger( 2508): version : 1.4 Android META-EGL
    I/SurfaceFlinger( 2508): extensions: EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_EXT_create_context_robustness EGL_ANDROID_image_native_buffer
    I/SurfaceFlinger( 2508): Client API: OpenGL_ES
    I/SurfaceFlinger( 2508): EGLSurface: 8-8-8-8, config=0x60000014
    I/SurfaceFlinger( 2508): OpenGL ES informations:
    I/SurfaceFlinger( 2508): vendor : ARM
    I/SurfaceFlinger( 2508): renderer : Mali-400 MP
    I/SurfaceFlinger( 2508): version : OpenGL ES-CM 1.1
    I/SurfaceFlinger( 2508): extensions: GL_EXT_debug_marker GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_point_size_array GL_OES_point_sprite GL_OES_texture_npot GL_OES_query_matrix GL_OES_matrix_palette GL_OES_extended_matrix_palette GL_OES_compressed_ETC1_RGB8_texture GL_OES_EGL_image GL_OES_draw_texture GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_OES_framebuffer_object GL_OES_stencil8 GL_OES_depth24 GL_ARM_rgba8 GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_rgb8_rgba8 GL_EXT_multisampled_render_to_texture GL_OES_texture_cube_map GL_EXT_discard_framebuffer GL_EXT_robustness GL_OES_depth_texture_cube_map
    I/SurfaceFlinger( 2508): GL_MAX_TEXTURE_SIZE = 4096
    I/SurfaceFlinger( 2508): GL_MAX_VIEWPORT_DIMS = 4096 x 4096
    D/SurfaceFlinger( 2508): Screen acquired, type=0 flinger=0x41bec370
    F/libc ( 2508): Fatal signal 11 (SIGSEGV) at 0x00000084 (code=1), thread 2509 (SurfaceFlinger)
    I/AwesomePlayer( 1146): setDataSource_l(URL suppressed)
    I/ServiceManager( 1146): Waiting for service window…
    I/DEBUG ( 2388): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    I/DEBUG ( 2388): Build fingerprint: ‘softwinners/olinuxino_a20/olinuxino-a20:4.2.2/JDQ39/20140203:eng/test-keys’
    I/DEBUG ( 2388): Revision: ‘0’
    I/DEBUG ( 2388): pid: 2508, tid: 2509, name: SurfaceFlinger >>> /system/bin/surfaceflinger <<<
    I/DEBUG ( 2388): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000084

    Reply

  8. Dave McLaughlin
    Feb 12, 2014 @ 07:21:30

    I’ve posted up a new blog today with all of the issues I had and how to actually get it compiled (although it still does not boot into Android without error)

    A20 Android Build Misc Settings

    Reply

  9. OLIMEX Ltd
    Feb 12, 2014 @ 11:55:00

    Hi
    Dimitar forgot to include the pack files please take from http://dl.linux-sunxi.org/users/tsvetan/ANDROID-4.2.2-SDK2.0-KERNEL-3.4/pack.tar.gz and let us know the result!

    Reply

  10. Dave McLaughlin
    Feb 14, 2014 @ 06:55:38

    Revised website link for the firmware fixes.

    http://axonjakarta.wordpress.com

    It’s still not perfect as the interface is in Chinese and the touchscreen does not appear to work but it is bootable now so we have something we can work on. On the blog there is settings for customising the build.

    Reply

  11. Rafael Coutinho
    Jun 04, 2014 @ 15:49:21

    Hi Dave,
    what OS are you using to build?

    I’m trying on ubuntu 14.04 and I get this on ‘lunch’ selection:
    cc: error: unrecognized command line option ‘-mfloat-abi=softfp’
    cc: error: unrecognized command line option ‘-mfpu=neon’
    cc: error: unrecognized command line option ‘-mthumb-interwork’

    and then make fails to find makefile:
    make: *** No targets specified and no makefile found. Stop.

    Reply

  12. Enver
    Jun 10, 2014 @ 19:53:32

    It seems Ubuntu12.04LTS is the way to go for building. Have reverted from 14.04LTS myself.
    –Enver

    Reply

  13. Lokesh
    Aug 26, 2014 @ 09:39:19

    thank you for your blog..
    by following above steps I have successfully compiled the kernel source, i have my imge file “sun7i_android_olinuxino-a20.img” located at the folder /home/android/android1/olimex-a20/lichee/tools/pack/

    But
    Now my problem is

    I am unable to load the “sun7i_android_olinuxino-a20.img” file to the NAND/SD card.

    when i connected my alwinner a20 board to windows pc, phoenix suite detects the board. when i press the upgrade button to upgrade “sun7i_android_olinuxino-a20.img ” immedietely device gets disconneted.

    I am not encountering this problem when i am going to upgrade other “xxxxx.img” file.

    please suggest any solution…

    thank you

    Reply

  14. Ilja Lebedevs
    Aug 29, 2014 @ 15:01:01

    Strange but after ./build.sh -psun7i_android i get:
    /home/user/A20/Android/lichee/linux-3.4
    make -C DX910-SW-99002-r3p2-01rel2/driver/src/devicedrv/ump CONFIG=ca8-virtex820-m400-1 BUILD=release KDIR=/home/user/A20/Android/lichee/linux-3.4
    make[1]: Entering directory `/home/user/A20/Android/lichee/linux-3.4/modules/mali/DX910-SW-99002-r3p2-01rel2/driver/src/devicedrv/ump’
    make -C /home/user/A20/Android/lichee/linux-3.4 M=/home/user/A20/Android/lichee/linux-3.4/modules/mali/DX910-SW-99002-r3p2-01rel2/driver/src/devicedrv/ump modules
    make[2]: Entering directory `/home/user/A20/Android/lichee/linux-3.4′
    CC [M] /home/user/A20/Android/lichee/linux-3.4/modules/mali/DX910-SW-99002-r3p2-01rel2/driver/src/devicedrv/ump/common/ump_kernel_common.o
    arm-linux-gnueabi-gcc: error: directory: No such file or directory
    arm-linux-gnueabi-gcc: error: directory”: No such file or directory
    make[3]: *** [/home/user/A20/Android/lichee/linux-3.4/modules/mali/DX910-SW-99002-r3p2-01rel2/driver/src/devicedrv/ump/common/ump_kernel_common.o] Error 1
    make[2]: *** [_module_/home/user/A20/Android/lichee/linux-3.4/modules/mali/DX910-SW-99002-r3p2-01rel2/driver/src/devicedrv/ump] Error 2
    make[2]: Leaving directory `/home/user/A20/Android/lichee/linux-3.4′
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/home/user/A20/Android/lichee/linux-3.4/modules/mali/DX910-SW-99002-r3p2-01rel2/driver/src/devicedrv/ump’
    make: *** [build] Error 2
    make: Leaving directory `/home/user/A20/Android/lichee/linux-3.4/modules/mali’
    ERROR: build kernel Failed

    So it cant build Mali module
    Building on latest Linuxmint

    Reply

    • ctkd17@gmail.com
      Apr 09, 2015 @ 11:20:43

      try with ./build.sh -p sun7i_android
      I had the same error, bettween -p and sun7i_android must be a space.

      Reply

  15. ctkd17
    Dec 19, 2014 @ 14:39:05

    Hi!

    When i try to build Kernel i have this problem:
    sudo ./build.sh -psun7i_android
    buildroot/scripts/mkcmd.sh: line 40: [: too much arguments
    buildroot/scripts/mkcmd.sh: line 134: [: too much arguments
    ERROR: invalid platform ‘sun7i_android’

    thanks!

    Reply

  16. nabil
    Mar 02, 2015 @ 14:14:06

    olinuxino-a20_eng dosn’t appear at “Lunch menu ” and we try to run the source build.envsetup.sh file again. any help please

    Reply

  17. Trackback: Configuring a build environment for the Olinuxino-A20-micro | Deskwizard's Den
  18. Trackback: OLinuXino la alternativa de hardware libre a Raspberry PI
  19. Trackback: Configuring an Android build environment for A20 with Ubuntu Mate 16.04 | Deskwizard's Den
  20. Gregory Zanelato
    Dec 15, 2018 @ 15:28:12

    HI, i’m executing the command pack inside android4.2. But the command is not found

    Reply

  21. David McLaughlin
    Dec 17, 2018 @ 10:27:53

    Have look in envsetup.sh as this is where pack is located.

    Reply

  22. Trackback: OLinuXino la alternativa de hardware libre a Raspberry PI - Kacharreando

Leave a comment