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 “” 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:

./ 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:

7z x mele-sd-4gb-lui-5.2.90.img.xz
./ /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.

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

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

ROCK 5 ITX RK3588 mini-ITX motherboard

Leave a Reply

Your email address will not be published. Required fields are marked *

Khadas VIM4 SBC
Khadas VIM4 SBC