Making a Bootable SD Card on SheevaPlug
by Mike Levin SEO & Datamaster, 09/15/2010
Okay, its one thing to simply use a SheevaPlug, but its another to use it safely and systematically. The idea is to clone many instances of the SheevaPlug application with a simple process. I’ve done my research on the various approaches, and it seems that there are two popular approaches, depending on whether you want to clone the internal NAND drive, or boot from external SD cards. There is relative advantage and disadvantage to each.
It seems popular to use SD cards instead of the internal Flash NAND drive. The advantages seem to be that you’ll never wear out the internal flash memory, which is a possibility with flash ram. Any of us who have worn out USB thumb drives know the effect. But since you can’t easily replace the internal flash, many folks seem to be choosing to use SD cards as their boot drive. It has a certain appeal, reminiscent of game cartridges of old.
Unfortunately, even if you go the bootable SD card route, you still have to connect through the mini USB serial port, restart the SheevaPlug, interrupt boot, and issue some Das U-Boot bootloader commands to switch it over to try to boot from the SD card. We’re not in x86 BIOS-land anymore. You need to learn new tricks to reconfigure embedded systems. Das U-Boot, the preferred bootloader for the SheevaPlug, doesn’t have a concept of “boot order” like x86 BIOS, so you either have to pick the boot device, or use a trick to tell it to boot from one AND THEN the other, knowing that if the first one (the SD card) succeeds, it will never reach the subsequent commands.
In addition, the SD card doesn’t insert flush into the SheevaPlug (as with most laptops), but rather gets left hanging half-way out of the plug, which makes it terribly less elegant than just using the internal NAND to my mind, especially if you’re going to carry it around a lot.
And finally, if you have any notion of easily copying these SD cards from your PC, forget it. They’re partitioned and formatted for Linux. And there just isn’t an easy way to read a raw disk on a PC as far as I can tell. There is commercial software like WinHex or Ghost. But this seems ridiculous to me, when the “dd” command in Linux just does it. So if you go the route of bootable SD cards on the SheevaPlug, you’re probably going to need a Linux box with an SD card reader in order to copy the SD cards, preferably other than the SheevaPlug itself. While it is theoretically possible to use the SheevaPlug to perform the copy, dd doesn’t do any compression, so you’ll have to use a USB stick as big as your SD card, and the SheevaPlug gets VERY WHACKY with USB sticks over 512MB. So, you’ve got a chicken-and-egg problem. It’s best to just stick to a different Linux system equipped with an SD card reader.
Okay, you follow? If you want to clone SD cards, you simply go through the unbricking process using the EISA tool that I describe here http://shankserver.org/2010/09/unbrick-sheevaplug/ but choosing the MMC card instead of the internal NAND. This will give you a fully bootable SD card. If you have a working SheevaPlug, the process looks like this:
- Connect the Serial cable.
- Open PuTTY and connect to the SheevaPlug. Remember the PuTTY bug! After you set up your COM port and 115200 baud, click SSH and back to Serial. Otherwise, you will get an “Invalid port number” error.
- Poke the reset button on the side of the SheevaPlug.
- Tap the Enter key on your keyboard (while PuTTY is active) to interrupt the SheevaPlug’s booting. You will see the Marvell» prompt.
- Close the PuTTY terminal.
- Insert the SD card into your SheevaPlug, and your already prepared and known-not-flakey USB drive into your PC.
- Run ESIA. You should see the mac of your SheevaPlug listed under Devices with the Ready status, along with Debian_Squeeze (or whatever your USB stick contains) under Applications.
- Click Debian_Squeeze (or whatever)
- Click the big Select button.
- Click Install to MMC. It will say Installation files were successfully copied, and to put the USB stick into the SheevaPlug.
- Now you can decide whether you want to set your SheevaPlug to boot from the MMC card. This avoids having to issue fancy Das U-Boot bootloader commands. I’m going check that option. Tell it to proceed.
- Accept the fact that it’s going to get stuck at 8% at . Just give it 5 minutes or so after it gets stuck. When an acceptable amount of time has passed, “x” out of ESIA.
- Load PuTTY. Put in your COM port and 115200 baud rate, and hit Connect. Hit Enter on your keyboard, and you should get the debian login prompt.
- Voila! You’re now switched over to a SD card bootable system. I recommend doing an apt-get update followed by an apt-get upgrade to make it an up-to-date system. You are now ready to clone the SD card.