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:

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

ROCK 5 ITX Rockchip RK3588 mini-ITX motherboard
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
81 Comments
oldest
newest
Razvan Dragomirescu
12 years ago

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 🙁 )… Read more »

Eric Betts
12 years ago

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… Read more »

Chargher858
Chargher858
12 years ago

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

Chargher858
Chargher858
12 years ago

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
12 years ago

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

Robert
Robert
12 years ago

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
Robert
12 years ago

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
12 years ago

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
Chargerher858
12 years ago

@ cnxsoft

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

misko
12 years ago

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

Alexandru Stoian
Alexandru Stoian
12 years ago

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:… Read more »

misko
12 years ago

@ 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
Alexandru Stoian
12 years ago

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

misko
12 years ago

@ 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
12 years ago

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
Jürgen Fey
12 years ago

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
Claudio
12 years ago

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

Claudio
Claudio
12 years ago

@ 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
Robert
12 years ago

@ 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
e8hffff
12 years ago

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

e8hffff
e8hffff
12 years ago

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
Claudio
12 years ago

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
e8hffff
12 years ago

@ 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
e8hffff
12 years ago

@ 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
e8hffff
12 years ago

@ 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 /*… Read more »

Claudio
Claudio
12 years ago

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
e8hffff
12 years ago

@ 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
Claudio
12 years ago

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

e8hffff
e8hffff
12 years ago

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.

mac me
mac me
12 years ago

@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

Ar Isel
Ar Isel
12 years ago

I got an image created for the odys xelio (for hw see: http://www.android-hilfe.de/odys-xelio-forum/224122-odys-xelio-hardware-technik.html ) using evb.bin. Wireless, Sound and Screen work. As do External usb devices.
However, I don’t get evdev to use the internal keys or touchscreen.

Any ideas about that?
ft5x-driver is loaded..

Ar Isel
Ar Isel
12 years ago

evb.bin is here: http://www.filejumbo.com/Download/2260B22FF7E99A02
as for the rest: I just used your scripts, set the first partition to bootable and did a depmod.
I installed wicd since the network configuration didn’t want to work out of the box.

Peter Nordstrom
Peter Nordstrom
12 years ago

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

STEVE
STEVE
12 years ago

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?

Claudio
Claudio
12 years ago

Could we use the same steps described here:
http://www.cnx-software.com/2012/06/18/mele-a1000a2000-android-4-0-image-released/
to flash the NAND with a Linux distro image?

zmaj
zmaj
12 years ago

I did install both on my 7″ tablet unfortunately usb to otg mini usb port didnt work on both.

Olivier Piau
Olivier Piau
12 years ago

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… Read more »

hackandfab
12 years ago

Hi, you’re mixing armel from github.com/cnxsoft/a10-bin with cross_compiler=arm-linux-gnueabihf-

lpleal
lpleal
12 years ago

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.

alex
alex
12 years ago

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?

äxl
äxl
12 years ago

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 …

Ashwin Jain
Ashwin Jain
12 years ago

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!

Maxx57
12 years ago

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… Read more »

Undertaker
Undertaker
11 years ago

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

Blaze
10 years ago

LiveSuit kitchen ublaze.ru for linux (Slackware) Unpack and pack Allwinner img

Screenshot http://i.pixs.ru/storage/3/1/8/port2png_7398383_12772318.png

Download kitchen https://cloud.mail.ru/public/513f69b27c23/livesuit_kitchen_ublaze.ru.tar.bz

How to use it look at my article http://ublaze.ru/allwinner-img/ (Russian)

Boardcon Rockchip RK3588S SBC with 8K, WiFI 6, 4G LTE, NVME SSD, HDMI 2.1...