Home > AllWinner A1X, Linux > makeSD Script to Write Image to SD Card for Mele A1000 / AllWinner A10 Devices

makeSD Script to Write Image to SD Card for Mele A1000 / AllWinner A10 Devices

Most images released for Mele A1000 (Ubuntu, Puppy Linux..) won’t fit in my SD card, and until now I had to manually partition the SD card, extract the data and copy it to the SD card.

I’ve also noticed the size of the SD card slowly creeps lower overtime. I bought an SD card last week and fdisk reported 3901685760 bytes and this morning the same command reported 3898782720 bytes. That’s probably due to new bad sectors which I believe is actually normal for this type of device. The problem is that a backup of “last week” SD card done with dd might not be restored properly with dd since the SD card is now smaller.

So I decided to write a shell script “makeSD.sh” that will do the following:

  1. Umount the SD card if needed
  2. Partition the SD card
  3. Copy uboot to the SD card
  4. Mount the image file and SD card partitions
  5. Copy the files between the image file and SD
  6. Cleanup the mess, i.e. umount the partitions and delete the mount points.

This script was written using one of my previous post and Rhombus Tech A10 image page.

The command line is as follows:

./makeSD.sh device image

First, you’ll need to install parted and kpartx:

sudo apt-get install parted kpartx

I tried it with Puppy Linux image in a machine running Ubuntu 12.04:

wget http://distro.ibiblio.org/quirky/arm/releases/alpha/mele-sd-4gb-lui-5.2.90.img.xz
7z x mele-sd-4gb-lui-5.2.90.img.xz
./makeSD.sh /dev/sdb mele-sd-4gb-lui-5.2.90.img

You can get the script on github.

Bear in mind that this kind of tools can be dangerous and wipeout your system if you use the wrong device or there is a bug in the script. So use it at your own risk.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter