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

Orange Pi Development Boards

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.

Leave a Reply

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

avatar
  Subscribe  
newest oldest most voted
Notify of
Razvan Dragomirescu
Guest

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?

Eric Betts
Guest

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

Chargher858
Guest

[email protected]:~# ./a10-hwpack-bld.sh mk802
./a10-hwpack-bld.sh: 1: eval: pushd: not found
Build step failed!

Chargher858
Guest

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

Andy Kirby
Guest

Excellent work there, I will be testing this out on the MK802, I’ll let you know how we get on.
Andy

Robert
Guest

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.

Robert
Guest

@cnxsoft No. Sorry, I do not have USB to TTL. I did open the mk802 as the microSD card does not line up with the case.

Eric Betts
Guest

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.

Chargerher858
Guest

@ cnxsoft

Scripts fail for me on ubuntu 12.04 with an error about pushd unless I remove the “!” from the first line

misko
Guest

I don’t get this.
mele-a1000_hwpack_2012.06.13.7z contain mali armhf version of libraries/drivers or not?

And as much I know http://releases.linaro.org/12.05/ubuntu/precise-images/ubuntu-desktop/linaro-precise-ubuntu-desktop-20120524-177.tar.gz
is hardfp version of ubuntu

trackback

[…] […]

Alexandru Stoian
Guest

For me the scrip fails. I’m getting the following output on ubuntu 12.04. :[email protected]:~/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

misko
Guest

@ cnxsoft
Ok but
mele-a1000_hwpack_2012.06.13.7z is vfp
linaro-precise-ubuntu-desktop-20120524-177.tar.gz is hardfp

It can’t work

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

Alexandru Stoian
Guest

@ cnxsoft
Not working either with sh or with bash. Gives me the same error.

misko
Guest

@ 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 ?

Eric Betts
Guest

I saw the issue you created for the hno/uboot-allwinner repository and I wondered if you’d tried processing the uboot image through https://github.com/hipboi/mksunxiboot ? Embedded systems are not my area, so I figure you’ll have a better idea of the relevance than I.

Jürgen Fey
Guest

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).

Claudio
Guest

Does the WIFI work on the ‘linaro’ distro?
I can’t see in the output of ifconfig command

Claudio
Guest

@ 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”

Robert
Guest

@ 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.

e8hffff
Guest

How do you flash it onto the Mele? I don’t want Android, only proper linux.

e8hffff
Guest

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.

Claudio
Guest

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)

e8hffff
Guest

@ 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.

e8hffff
Guest

@ 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.

e8hffff
Guest

@ 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.

Claudio
Guest

Dunno if could be useful:
http://lists.phcomp.co.uk/pipermail/arm-netbook/2012-May/003487.html
Can’t see what that guy rewrite/hack and how…

e8hffff
Guest

@ 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.

Claudio
Guest

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??