Home > Allwinner A-Series, Linux > AllWinner A10 Initramfs Support and Linaro 12.07 Image

AllWinner A10 Initramfs Support and Linaro 12.07 Image

An initramfs is a minimal root filesystem that is loaded at an early stage of the boot process, before the rootfs partition is mounted. This is optional but is now used by many Linux distributions such as Ubuntu in order to speed up boot time among others things.

Up to recently, there was no support for this in the AllWinner A10 nightly builds, and there would be lot of error messages due to ureadahead process with Ubuntu, but I’ve changed that by:

  • Using a boot.scr file (U-Boot Script) for each supported device in order to either follow the default init boot method or do an initramfs boot if uInitrd file is present in the FAT partition.
  • Adding a script (a1x-initramfs.sh) to generate and install uInitrd initramfs in the rootfs. The initramfs can’t be generated at build time since the hardware packs are (mostly) distribution agnostic. If you want an initramfs, you’ll need to run the script manually, as initramfs support is optional.

I mainly followed and adapted the instructions provided by Peter (j1nx) for boot.scr and the initramfs.

As an example, I’ll generate a Linaro ALIP (ARM Linux Internet Platform) 12.07 SD card for Mele A1000 with VGA output.

First let’s download the latest hardware pack from http://dl.linux-sunxi.org/nightly/latest/ in a Linux PC e.g.:

as well as a1x-media-create.sh script and Linaro ALIP 12.07 rootfs:

We’ve got all we need. Let’s create a bootable SD card the usual way:

Now let’s insert the SD card into the Mele A1000 and boot as usual. You should notice a lot of error messages:

Those are due to the lack of initramfs, but are not critical. The boot from power to LXDE took 1m 8s.

I’ll run all the next command as root in the serial console, if you want to run those with a terminal window in LXDE as linaro user, simply run add “sudo”to the commands.

Let’s check the content of the FAT partition:

There’s the u-boot script, script.bin and the kernel image.

Time to generate the initramfs, simply run a1x-initramfs.sh:

uInitrd file has been properly generated in the FAT partition:

Let’s reboot. All errors messages are gone and it just took 38s to boot to LXDE.

This script currently only support Ubuntu / Debian. Feel free to update it to support other distributions.

  1. August 4th, 2012 at 02:38 | #1

    Great job!

    Is this now also included into the build server?

  2. e8hffff
    August 4th, 2012 at 05:58 | #2

    Has anyone yet got the build to write to the internet memory? I’m not that interested running off a SD.

  3. August 4th, 2012 at 09:23 | #3

    @ j1nx
    Yes, the example I showed is based on an image generated on the build server.

  4. August 4th, 2012 at 09:25 | #4

    @ e8hffff
    There are some instructions for that – https://www.miniand.com/forums/forums/2/topics/73

  5. August 4th, 2012 at 20:41 | #5

    ok, well done.

    Does ureadahead also terminates at the end of the boot? The errors are gone but I still had ureadahead terminating at the end of the boot process.

  6. August 5th, 2012 at 09:24 | #6

    Same here
    [ 5.430000] init: ureadahead main process (158) terminated with status 5

    I found some at thread with that problem – http://ubuntuforums.org/showthread.php?t=1423305


    ureadahead –dump
    ureadahead:/var/lib/ureadahead/pack: No such file or directory

    This could be the reason. I won’t have time to check this right now as I’ve just received another very interesting board…

  7. August 5th, 2012 at 14:02 | #7

    I saw that thread indeed. Will look into it again after the holidays. Disabled ureadahead, because it is meant to lower the disk access times anyways.

  8. August 5th, 2012 at 14:05 | #8

    Oh and I think I have a very good idea which board you are looking at ;). Hope to see a review soon 😀

  9. August 5th, 2012 at 14:08 | #9

    There’s something on the front page now which should give you a clue, or maybe that’s what tipped you 🙂

  10. e8hffff
    August 6th, 2012 at 16:36 | #10


    Many thanks. I’m working on other projects, but would have loved to look into using LiveSuit to write an Linux Image a while back. The other day I spent some time catching up on how to use adb and fastboot to manage Android devices. I’m just way behind the mark compared to others in this field.

    I really hope those that make Linux images use something like PPA’s or repositories to keep systems up to date.

    Thanks everyone!

  11. nklh
    August 9th, 2012 at 05:37 | #11

    Boot in less than 20seconds using HDMI hwpack, Linaro’s precise alip and a 16GB Class10 SDcard : very fast but didn’t find how to change locale or at least layout for keyboard.

  12. August 9th, 2012 at 09:06 | #12

    There must be an option in the GUI, but sure where. This is basically Lubuntu so there must be some doc somewhere.
    Using the command line

    sudo dpkg-reconfigure console-data
    sudo dpkg-reconfigure locales

    should work.

  13. August 9th, 2012 at 09:07 | #13

    You might even make that closer to 15 seconds by removing the 3 seconds delay in u-boot and specifying the rootfs file system in u-boot.

  14. nklh
    August 10th, 2012 at 23:09 | #14

    ok, I’ll try but linaro’s alip seems to have a “weird” lxde. it’s very different from Lubuntu’s Desktop version that I use through a VM, although I’m not a Linux Power User. Not afraid of command Line but a GUI is far away effortlessly accessible.

    Meanwhile, I switched to linaro’s ubuntu Desktop but It’s obviously to heavy to be usable without graphic acceleration (I assume isn’t supported yet?), very laggy, freezing sometime (mostly everytime) and also I definitively hate unity :D.

    thanks, for helping, I started to tweak mele’s android config files to switch for a full french azerty keyboard but was not able to do the same under Alip, I’ll try harder 😀

  15. nklh
    August 11th, 2012 at 09:51 | #15

    finally , nothing seems worked with linaro’s alip.

    so :
    -I switched to Linaro’s ubuntu desktop version (hdmi hwpack 2012.08.09 build)
    -Installed lxde through apt-get
    -Added “setxkbmap -layout fr” at end of .bashrc

    it’s a lot smother now.

    Sometimes, the mele don’t achieve boot and the screen don’t switch on if the ethernet cable is connected (I assume it’s that because the ethernet activity led blink a lot) but maybe it’s due to my ISP adsl box.

    And also it don’t let me shutdown it through GUI (command line are salvation )

  16. Pawel
    August 31st, 2012 at 03:01 | #16

    Hi, I have my first Android box (mele a2000). I tried this instruction, everything ended with success, but when mele is booting it stops logging after “Starting kernel …”, sometime is logged 1-5 lines more. I used 3 different SDHC 4GB cards without success. Did someone have the same problem and knows solution?

  1. No trackbacks yet.