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.

Support CNX Software - Donate via PayPal or become a Patron on Patreon

3
Leave a Reply

avatar
3 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
0 Comment authors
Ubuntu 12.04 (and Lubuntu 12.04) images for the MK802 mini PC - LiliputingPuppy Linux on the MK802 $74 mini PC - LiliputingInstalling Linux on MK802 - Page 5 Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
trackback

[…] sudo apt-get install parted kpartx wget https://github.com/cnxsoft/a10-tools/blob/master/makeSD.sh 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 chmod a+x makeSD.sh ./makeSD.sh /dev/sdX mele-sd-4gb-lui-5.2.90.img Replace X by the letter corresponding to your SD card (type fdisk -l to know it). Let us know if it works on MK802. Read more here. […]

trackback

[…] links from CNX Software, I found a version of Puppy pre-built for devices with Allwinner A10 processors, and then loaded it […]

trackback

[…] can actually run any number of Linux-based operating systems to run on the MK802. CNX Software has instructions for preparing your own bootable microSD card with Ubuntu, Debian, or another […]