[Arm-netbook] Dissecting the SD Card Image
Paul Kench
paulkench at yahoo.co.uk
Fri Apr 20 14:11:07 BST 2012
Thanks for Tom for providing the image, and apologies for contributing to
blocking that Dropbox account.
While the comments about providing a tar image (personally I would do a
cpio, but potatos, potartos) are accurate, having examined the image, it is
clear that instructions would be needed to take the components and build
them into a working SD card. Hopefully this is a step in that direction.
Note, that I have not yet got this to work, either due to the serial not
being initialised or a dodgy serial cable.
The image contains 3 things:
The uboot (written directly to the sd card, see here
http://rhombus-tech.net/allwinner_a10/a10_boot_process/ for how)
A partition containing A10 magic and the uImage. (this is marked 83 linux,
but is formatted vfat, and size 16mb, not sure what of these factors is
important)
A partition with the Ubuntu root fs.
If you uncompress the image, you can mount the individual partitions with
the following commands (works on a wheezy system).
sudo mount -o loop,offset=1048576 mele-ubuntu-lucid.img <your 1st target
directory>
sudo mount -o loop,offset=17825792 mele-ubuntu-lucid.img <your 2nd target
directory>
(you can mount a dd image directly, who knew? Thanks the internet, here
specifically http://wiki.edseek.com/guide:mount_loopback )
So from there you can create a tar image. Or a cpio (find . | cpio -o -H
newc | gzip > ../cpio_img.cpio.gz).
To extract the uboot (assuming it was written with the same instructions as
from the wiki):
dd if=mele-ubuntu-lucid.img bs=1024 skip=8 count=1000 of=uboot_mele_mmc.bin
Looking at it in hexcurse, you can see the second half is empty so we have
definitely got all of it.
This should write it to your sd card:
sudo dd if=uboot_mele_mmc.bin of=/dev/<card device (note sdx not sdx1)>
bs=1024 seek=8
Here is the fdisk from the the img:
/sbin/fdisk -l mele-ubuntu-lucid.img
Disk mele-ubuntu-lucid.img: 4008 MB, 4008706048 bytes
255 heads, 63 sectors/track, 487 cylinders, total 7829504 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x69e553c5
Device Boot Start End Blocks Id System
mele-ubuntu-lucid.img1 2048 34815 16384 83 Linux
mele-ubuntu-lucid.img2 34816 7829503 3897344 83 Linux
To avoid overwriting uboot create the partitions starting 1M in. I assume
the seek=8 in the uboot dd is to avoid overwriting the partition table.
Before "anyone" says, I know wiki. And I will, I promise. I will be testing
it on my mele later.
Couple of questions, does this card just boot in a mele, or is a specific
set of button pushing needed? Also does it fire up the serial console? It
would be useful to know as I haven't got my console working yet. (And the
ability to change the uart pins in soft/firmware is twisting my melon.)
Paul
More information about the arm-netbook
mailing list