Hardware Packs for AllWinner A10 Devices and Easier Method to Create a Bootable Ubuntu 12.04 SD Card

Linaro has a tool called linaro-media-create to install Linaro Ubuntu to an SD card by passing the device, hardware pack file, the rootfs and the board as arguments. Hardware packs are files that contains hardware specific binaries and configs files (e.g. bootloader, kernel…).

I’ve done something similar (albeit more basic) for AllWinner A10 devices so that you can easily install and run Ubuntu (and possibly other distributions) on an SD card. I’ve written 2 scripts for this:

  • a10-hwpack-bld.sh – Script to generate evb.bin, build the latest u-boot and linux kernel, retrieve some config files and compress all this in an hardware pack file
  • a1x-media-create.sh – Script to make a bootable SD card for AllWinner A10 devices.

You can get the scripts with git:


I’ve only tested it with Mele A1000, but if you have other A10 devices such as MK802 mini PC or MINI X media player, it should also work. Installing Ubuntu on tablets should also be possible, but you’ll need to generate the hardware pack files and test it yourself. This is alpha and many things still need to be improved. (Update: I’ve just seen I forgot to enable Wi-Fi by default. Just run “depmod -a” to make sure 8192cu is loaded).

In the first section of this post, I’ll explain some details about the scripts, so If you’re just interesting in trying out Ubuntu 12.04, you can skip to the “Creating a bootable Ubuntu SD card for Mele A1000, MK802, MINI X…” section at the end of this post.

a10-hwpack-bld.sh Script

I wrote this script because a build server will be setup soon, and we should be able to get regular builds for u-boot & the Linux kernel (e.g. daily or weekly), without everybody having to build their own.

The build will clone the following repositories:

  • https://github.com/cnxsoft/a10-config – Contains the fex files and some config files for the rootfs
  • https://github.com/hno/uboot-allwinner – The recommended u-boot for A1X (v2011.09-sun4i branch for now)
  • https://github.com/amery/linux-allwinner – The recommended Linux kernel (3.0.31) for A1X.
  • https://github.com/cnxsoft/a10-bin – Binary files (now just Open GLES files) for armel and soon armhf

a10-config has the script.fex for the following devices:

  • Mele A1000/A2000.  1 file for HDMI and 1 file for VGA and composite (display mirroring). This should also work for other A10 media player / mini PC such as MK802 and MINI X.
  • A few EVB fex files – Extracted from leaked tools.rar
  • Ainol tablet (tools.rar)
  • BK7011 (tools.rar). I don’t know what this is.
  • Onda M702(H6) and N507H5 tablets (tools.rar)
  • Teclast T780 tablet (tools.rar)
  • TVDEVEVB (TV Development Board?) (tools.rar)

a10-hwpack-bld.sh is run with the file name (without extension) of the fex files and calls fex2bin utility to generate script.bin (aka evb.bin). For example:


The script will then build u-boot and the Linux kernel and generate the hardpack file which will be available in bld_a10_hwpack_${blddate}/${board}_hwpack_${blddate}.7z (e.g. bld_a10_hwpack_2012.06.12/mele-a1000_hwpack_2012.06.12.7z)

Subsequent calls to ./a10-hwpack-bld.sh will not build u-boot nor the kernel, but simply generates the hwpack file for the new device.

a1x-media-create.sh

a1x-media-create.sh will partition the SD card, format the partition, extract the hwpack file and the rootfs and copy all necessary files to create a bootable SD card.

It basically follows the instructions provided on How to Create Your Own Debian / Ubuntu Image for Mele A1000 page.

It is called as follows:


You can see examples in the section below.

Creating a bootable Ubuntu 12.04 SD card for Mele A1000, MK802, MINI X…

I’ll provide 2 examples:

  • ALIP (ARM Linux Internet Platform) which is based on Ubuntu with Xfce desktop and with the application to access the net such as Firefox and Thunderbird. If needed, you can always use apt-get to install other applications. This is the one I use now.
  • Linaro Ubuntu Desktop – The full Ubuntu 12.04 experience with the monthly Linaro release. This is not supposed to be as stable as the official Ubuntu released every 6 months, but still reasonably stable and you can test the very latest Ubuntu improvements.

The first time, make sure git and 7z are installed and download a1x-media-create.sh script:

If you want to use the image in MK802 or MINI-X, you’ll have to build the hwpack using:
or simply copy evb.bin in MK802 to script.bin in the SD card FAT partition once the image are created for Mele A1000.

Warning: If you use the wrong device in the instructions below (I use/dev/sdb as an example), you may completely wipe out your system, so use with care.

Here are the instructions to install ALIP 12.05 on an SD card:

wget http://dl.dropbox.com/u/45842273/mele-a1000_hwpack_2012.06.13.7z
wget http://releases.linaro.org/12.05/ubuntu/precise-images/alip/linaro-precise-alip-20120525-143.tar.gz
./a1x-media-create.sh /dev/sdb mele-a1000_hwpack_2012.06.13.7z linaro-precise-alip-20120525-143.tar.gz

and the instructions to install Linaro Ubuntu Desktop 12.05:

wget http://dl.dropbox.com/u/45842273/mele-a1000_hwpack_2012.06.13.7z
wget http://releases.linaro.org/12.05/ubuntu/precise-images/ubuntu-desktop/linaro-precise-ubuntu-desktop-20120524-177.tar.gz
./a1x-media-create.sh /dev/sdb mele-a1000_hwpack_2012.06.13.7z linaro-precise-ubuntu-desktop-20120524-177.tar.gz

To use VGA or composite output, download mele-a1000-vga_hwpack_2012.06.13.7z instead of mele-a1000_hwpack_2012.06.13.7z.

 

If you want to try other rootfs such as Ubuntu 12.04 armel / armhf core files (stable release), check my previous post entitled Getting Ubuntu armel/armhf Rootfs in Ubuntu 12.04.
If you prefer Debian, it should also possible, but AFAIK there is no Debian ARM rootfs directly available, and you’ll need to use debootstrap which requires access to the serial console via an USB to serial adapter, at least until the framebuffer console is fixed. Alternatively, there is now a script to automatically install Debian on the SD card.
If you have any issues or have some ideas to improve this, let me know in the comments section.
Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard

81 Replies to “Hardware Packs for AllWinner A10 Devices and Easier Method to Create a Bootable Ubuntu 12.04 SD Card”

  1. I’ve just tried this for an MK802 with the ALIP option and for some reason the result does _not_ boot at all. The original Ubuntu image boots up just fine but I haven’t been able to create an image myself that would boot on the MK802, manually or automatically through your scripts.

    I’ve also tried to modify the evb.bin file to tell the MK802 to use 480p instead of 720p on the HDMI output (need to use it with a picoprojector that doesn’t support HD). For some reason, doing bin2fex and then using script.exe in Windows (fex2bin segfaults 🙁 ) creates an invalid evb.bin file (there is no error but the board stops booting Ubuntu, even if I make absolutely no changes to the evb.fex file and I just run it through script.exe to recreate the evb.bin).

    Has anyone managed to install something other than the default Ubuntu image on the MK802? Or at least has someone managed to change the default output to 480p instead of 720p?

  2. Hi, I have an MK802, which I’ve booted with the older mele a1000 image that’s been floating around. I was trying to upgrade the kernel and each time I do, I’m unable to boot after I replace the uImage and create a new /lib/modules/3.0.31+/ directory.

    I saw that you have a uImage and modules for 3.0.31+ in your mele-a1000_hwpack_2012.06.13. I just found this post and haven’t tried yours yet, but I was wondering if you could publish the kernel config you used to produce it? I’m concerned that the kernel I created was missing some module, or that I created a module where I should have compiled something into the kernel (Its been a few years since I’ve built a kernel, and it was for x86 last time).

    I’m trying to compile my own kernel so I can add drivers for a usb wifi that I have and want to use.

    Thank you,
    ~Eric

  3. root@ubuntu:~# ./a10-hwpack-bld.sh mk802
    ./a10-hwpack-bld.sh: 1: eval: pushd: not found
    Build step failed!

  4. fixed it by removing the ! at the beg of the script.. but now ./a10-hwpack-bld.sh: line 70: fex2bin: command not found

  5. Works get on my Mele A2000. Both ALIP and full desktop verisons. Thank goodness for ALIP as the full desktop is very sllow. However these do not on my mk802. On the mk802 all I get is an occasionally flash on the mouse. The original Ubuntu 10 does boot and work on the mk802. Thanks for your script. I now have a much newer version to explore.

  6. @ Chargher858
    For mk802, you’d have to run:
    ./a10-hwpack-bld.sh mele-a1000

    As I expected the same config and kernel to run on the Mele A1000 and MK802. But it does not seem to work for others (No MK802 to test it).

    You may need to change the script.bin or the kernel config to disable SATA.

  7. Regarding USB to TTL, has it been established where on the board the contacts for that are? I might be willing to purchase one and give it a try.

  8. @ Eric Betts
    Some picture have been uploaded – http://lists.phcomp.co.uk/pipermail/arm-netbook/2012-May/004015.html

    And in one of the following post:

    > Maybe the 4 pins next to the a10 chip are a serial port?
    More than maybe. It’s very likely. The standard pins for uart0 are exactly next to there at the cpu edge.

    There is also a large group of test pads on the other side of the pcb.

    For order of the pins, you would have to try by error I think. The easy part is to find the GND with a multimeter, and for the other pins as long as the voltage does not go above 3.3V, it should be OK.

  9. @ Chargerher858
    Ok, I also use Ubuntu 12.04 but my shell was configured to be bash.

    sudo dpkg-reconfigure dash
    and answer no.

    But If I move back to dash, I can reproduce the issue, removing “!” seems to work for both, so I’ll change this.

  10. @ misko
    For now, we only have armel binary libraries, so if you want to use Open GLES it won’t work with linaro releases.
    If you want to test those an armel image is needed. (e.g. Ubuntu Core armel or an image generated with rootstock).

    The image provided do not use hardware acceleration (and none of the binary libs provided in the hardware pack are used for now), which is probably why Ubuntu Desktop (unity) is slow, but ALIP runs more smoothly with a less demanding desktop envirnment (Xfce).

    Hopefully, AllWinner will make armhf libs available soon.

  11. For me the scrip fails. I’m getting the following output on ubuntu 12.04. :alexandru@ubuntu:~/a10-tools$ sudo ./a1x-media-create.sh /dev/sde mele-a1000_hwpack_2012.06.13.7z linaro-precise-alip-20120525-143.tar.gz
    [sudo] password for alexandru:
    Delete Existing Partition Table
    1+0 records in
    1+0 records out
    1048576 bytes (1.0 MB) copied, 0.164962 s, 6.4 MB/s
    Creating Partitions
    Partition 1 – /dev/sde1
    Partition 2 (Starts at sector No. 30720)
    Format Partition 1 to VFAT
    Format Partition 2 to EXT-4
    mke2fs 1.42 (29-Nov-2011)
    Extracting HW Pack mele-a1000_hwpack_2012.06.13.7z
    ./a1x-media-create.sh: 77: ./a1x-media-create.sh: pushd: not found
    ./a1x-media-create.sh: 79: ./a1x-media-create.sh: popd: not found
    extracting Rootfs linaro-precise-alip-20120525-143.tar.gz
    ./a1x-media-create.sh: 85: ./a1x-media-create.sh: pushd: not found
    File Extension gz
    ./a1x-media-create.sh: 88: [: gz: unexpected operator
    ./a1x-media-create.sh: 90: [: gz: unexpected operator
    ./a1x-media-create.sh: 92: [: gz: unexpected operator
    ./a1x-media-create.sh: 92: [: gz: unexpected operator
    Unknown file extension: gz
    ./a1x-media-create.sh: 96: ./a1x-media-create.sh: popd: not found

  12. @ misko
    An hardfp rootfs can work with this method (on Mele A1000), it’s just it’s not using any of the libraries inside mele-a1000_hwpack_2012.06.13.7z as hardware accelerated X11 is not yet implement in any AllWinner A1X Linux distribution.

    The command line commands you provided above works for me and a few other people on the Mele A1000. It fails on MK802, possibly because of SATA.

    However, If you want to play with the OpenGL ES libraries present in the hwpack, you’re right that you’ll need an armel rootfs.

  13. @ cnxsoft
    ok than kernel and modules are hardfp in mele-a1000_hwpack_2012.06.13.7z
    but mali drivers/libs are vfp in mele-a1000_hwpack_2012.06.13.7z ?

  14. @ Alexandru Stoian
    That’s weird. I’ve change the script again, you can try that.

    If it still doesn’t work and you run Ubuntu, change the shell with:
    sudo dpkg-reconfigure dash
    and answer no.

    and let me know the result.

    If you’re not using Ubuntu let me know which OS you use, I’ll give it a try.

  15. @ misko
    I’ve noticed that with the Ubuntu 10.04 image released by Tom Cubie, I could use both armel and armhf rootfs.
    The kernel and modules (kernel space) and rootfs (user space) seem to just communicate, but do not directly use each other files. That’s why an armhf kernel can be used with both armel and armhf rootfs. Somebody please correct me if I’m wrong.

  16. @ Eric Betts
    I think the issue is being worked on. In the meantime, hno has reverted to the old working u-boot spl (with fat32 support). That’s what I’m using now. mksunxiboot is called in the Makefile, so there’s no need to call it manually.

  17. Worked like a charm – i only had to change the shell from /bin/sh to /bin/bash in your a1x-media-create.sh script.
    Otherwise the push, popd commands are not available.

    I plan to use the Mele as a simple, cheap git repository device with a small energy footprint running in a different office (two location principle). We’ll see how it behaves. (I know it is not really the intended use case for the Mele but that’s life and i do not need a media thingy right now anyways).

  18. @ cnxsoft
    OK Thanks, i will test asap. The following commands still needs to be apply (for network access) or has been already fixed?

    “sudo groupadd -g 3003 aid_inet
    sudo usermod -a -G aid_inet ubuntu”

  19. @ cnxsoft I edited and recreated the alip script.bin with sata=used = 0 Still no go on the mk802. Same behavior only the mouse lights up then off then on … repeat.

  20. @ Robert
    Thanks Robert.

    For you want to try Ubuntu 12.04 on the MK802, you use the old Ubuntu 10.04 image and change the rootfs to Ubuntu 12.04 by following the instructions at http://www.cnx-software.com/2012/04/28/how-to-create-your-own-debian-ubuntu-image-for-mele-a1000-allwinner-a10-based-stb/, or more simply download the binary they made at https://www.miniand.com/forums/forums/2/topics/1

    I’ll try top find somebody with a serial board on arm-netbook to find the issue on MK802 with the latest kernel.

  21. Would I be correct in saying that the file system is locked down due to UFI? We need to partition at the base level, not within the OS. I haven’t researched much, but I can’t delete partitions on Mele and make on big section to parition again.

  22. @ e8hffff
    There’s no UEFI. It’s possible to flash Linux to the Mele or other A10 devices, just like they do firmware updates for Android. I just don’t know exactly how to do that yet. Some people on arm-netbook mailing list should know that, or hte instructions should be available on the net. Beyond the method for flashing, you’d also need to modified u-boot environment to point the rootfs to the right partition.

  23. cnxsoft :@ Claudio Iyes, but I forgot to enable it by default. You need to open a terminal and run “depmod -a” or “insmod 8192cu”

    depmod -a seems not work. After reboot the 8192cu.ko module are still no in ‘lsmod’

    only insmod /lib/modules/… works (i put into /etc/rc.local, but not the best solution)

  24. @ cnxsoft

    Well there is a limitation in deleting partitions and then restructuring their size while managing them from Linux booting off memory card slot.

    I know you can set partition sizes when using LiveSuit in the image config files.

    I’d like some to explain why there is the limitation and how to get around it. I’d prefer to have may two partitions, one the kernel and the other user space. Maybe a third for the low down boot.

  25. @ Claudio

    You need to ‘sudo modprobe 8192cu’ to add. modprobe -l can list modules.

    If you want the module loading automatically then edit /etc/modules and at the 8192cu in a line.

  26. @ e8hffff
    I think the only requirement is to have U-boot SPL at 8K in the SD card, because that’s were the system look for it.
    After that you are free to change the partition size, but you need to edit u-boot configuration.

    There are already 2 partitions: one for the kernel and one for user space (rootfs). If you want a third one, you can modify the script or possibly run tools such as gparted (not tried).

  27. @ cnxsoft

    Thanks but I’m talking about the mapping on the device, not the image that’s put onto the SDCard. Android on Allwinner SoCs usualy has about 7 partitions. It’s a real mess if you want to install proper Linux.

    In Linux, say using gparted you try delete the partitions and they don’t get placed into a pool to build a new partition. There is some underlying structure that’s locked and can only be setup at flash time.

    I’d like to format the partitions on the device and copy over the system over to new partitions using cp -Rp /* /media/x I just can setup the partitions on the device how I want them, as it’s locked up.

  28. @ e8hffff
    Oups… sorry I misunderstood your comment. I’m not sure how it’s done yet. In some other projects i worked on, the partition table was hardcoded in the kernel, and the only way to change that was to change the code and rebuild the kernel. I wonder if it could be the case here.

    You’d better ask on http://lists.phcomp.co.uk/mailman/listinfo/arm-netbook or in IRC #arm-netbook, there are some clever people over there very familiar with AllWinner A10, even an AllWinner employee lurks there.

  29. @ Claudio

    Yes this is on topic. I’m not sure if I’d accept the partition management is handled by a driver as that would require a layer/ring and cpu time.

    From experience with tinkering with roms for my Ainol Elf, the partitioning is carried out at flash time with Livesuit. One file contains a structure list of how to partition with leftover being auto to user space. There must be some sort of direct orchestration to the memory manager chip to perform the partitioning, then the partitions are visible to the system. All guesses.

  30. The Linaro distro seems to be slowly then the one provided by Tom (ubuntu gnome).
    Could be a 3.0.31+ kernel issue, armhf issue or distro one??

  31. On Topic;

    Someone needs to create a script to installs any image on a SD to the main memory of an AllWinner Soc/CPU. This will be a vital part in making successful Linux use on ARM devices, as it will mean inherent boots, no memory card hanging out side. It will also promote devices sold with Linux not Android by resellers.

  32. @e8hffff

    From recollection i think there is a bug in the wear levelling code on the device that needs to be sorted as well …
    for me though if i can get to a nice headless debian armhf distro running on a fast sd card with gpu disabled and wifi/bluetooth as well giving me as close to 512MB RAM as possible I will be well pleased

  33. @ mac me
    An armhf debian server distro with a maximum amount of RAM is a low hanging fruit… I think instructions to do that are already available somewhere in Rhombus Tech Wiki. Not sure about Bluetooth however.

  34. Is there someone hwo want to make an bootable Ubuntu 12.04 SD card for MK802 and sell it to me?

  35. Hi
    I really want know how this whole process can be done ,i have no knowledge of linux.
    At beginning i thought this was done in command prompt in windows, then i notice command is linux.
    Can some one show me step by step….. i have MK802…..is there img ready that I can just drag to SD and boot off straight away?

  36. Hello,

    First, thank you very much for the tuto, that’s a nice work.

    I have a Teclast P85, very close from the T780 in terms of hardware and wanted to use your Hardware pack builder but
    I got several problems:

    1/ illegal character in t780.fex at line 1091
    >Fixed: I retrieved the file, replaced a : by a ; and modified ./a10-hwpack-bld.sh to read the file locally instead of from the GIT

    2/ error at line 69: try patch -p1 Fixed (i Think): I retrieved u-boot-rootwait.patch from a10-config and modified a10-hwpack-bld.sh to read the file locally

    3/ Then, I have the message “Building u-boot” and a10-hwpack-bld.sh exits.
    > Not fixed: I don’t have any error message, I guess it crashed on the line bellow but I don’t know why…

    try make sun4i CROSS_COMPILE=${cross_compiler} -j2 >> ${make_log} 2>&1

    Does someone could give me a hand with this?
    Or just a pre-build hardware package for the t780 would be nice too! I tried with the mele1000 package without success…

    Thank you all !

  37. @ Olivier Piau
    There’s a log file in bld_a10_hwpack_${blddate} directory, you can have a look at it first.
    Maybe it’s because arm-linux-gnueabihf-gcc is not installed on your machine.

    If you know how to use github, you could do a pull request for t780.fex.

  38. I’m still having problems with the fex2bin even later then followed the steps of installation that you’ve mentioned before.
    line 22: fex2bin command not found.
    I`ve downloaded the sunxi-tools and followed the steps, and ran without problems.

  39. I’ve created bootable sd card (nano 12.05 and mele-a1000), but my tv box(based on allwinner a10 – cortex a9 – AML8726M) doesn’t boot from card. It boot android.

    How can I set this hardware for dual boot?

  40. Hi, could you take a look at this: http://forum.a10linux.org/read.php?3,74
    I used only your a1x-media-create.sh because I already had all the files needed for the hwpack. They work with Debian.
    (Touchscreen works with multi-touch disabled in drivers/input/touchscreen/ft5x_ts.h)
    Only boot.scr might be problematic. But I guess this is more of a kernel space problem …

  41. Hey,

    thanks for this thing.
    When i m executing ./a10-hwpack-bld.sh mele-a1000. I am not able to get the 7z file. Following is the error in the log file.

    cp: cannot stat `uboot-allwinner/spl/sun4i-spl.bin’: No such file or directory
    Build step failed!

  42. I bought a liliput touchscreen monitor and the mk802 ii and the ug802, but there is a problem with the input coordinates. When you move your finger down the screen, you see the mouse move to the left When you move your finger to the left, you see your finger move down the screen. An usb mouse works fine, but the touch screen input coordinates seem to be messed up. So I’m recompiling android ICS to try to boot it as is on either the ug802 or the mk802 ii. Then once I get my image booting, I’m going to attempt to modify/create the input driver for the liliput 7 inch touch screen. Any one going down this path? Anyone have pointers for me? I’m looking for direction. I’m still researching this, but ICS is compiling to a fastboot img, but are there some tuorials on how to accomplish what I’m looking for. I’m not totally sure of the terminology yet [still noobie but quickly learning the ropes].

  43. Hi, guys. I have Mele A2000G – it’s mele A2000 with 1024Mb RAM. Involved only 512 MB 🙁 How to use the entire RAM

Leave a Reply

Your email address will not be published. Required fields are marked *

Boardcon Rockchip and Allwinner SoM and SBC products
Boardcon Rockchip and Allwinner SoM and SBC products