Upgrading the Sheevaplug to Debian 6 Squeeze

The Sheevaplug is is a very small computer made by Globalscale. It is designed to offer standard computing functions in a very small space. Consuming just a few watts of power, the Sheevaplug makes a good home server, with applications ranging from network storage to web hosting and home security.

This article explains how to upgrade a Sheevaplug to Debian 6 using a pre-built image available from New IT. It is a quick and simple procedure, requiring less technical knowledge than, for example, installing Debian from scratch.

Ubuntu 9.04 Distributed with Sheevaplug now End of Life

In the UK, the Sheevaplug is distributed by New IT and is helpfully preinstalled with Ubuntu 9.04. A good operating system and fine in itself. Ubuntu has moved on though, and version 9.04 is no longer supported. In fact, it has been “end of life” since October 2010. If you are the lucky owner of a Sheevaplug running Ubuntu 9.04, it will no longer be receiving operating system updates, and if your server is in any way “internet facing”, that’s bad news. For the sake of security, you would be well advised to upgrade your system to a supported OS, one that will be patched for security vulnerabilities as and when they are discovered.

Sheevaplug Upgrade Path

You might think that upgrading to the latest release of Ubuntu is the most obvious solution. However, that’s not possible because Ubuntu releases from 9.10 onwards do not support the Sheevaplug architecture. Version 9.04, aka Jaunty Jackalope, was the last version of Ubuntu to support the Sheevaplug.

Debian, though, offers full Sheevaplug support. What’s more, Ubuntu is based on Debian, so the two are quite similar. Anything that runs on Ubuntu is likely to be available for Debian too. Debian is an actively developed OS with thousands of available packages, and offers a good upgrade path for the Sheevaplug.

Moving to Debian

Upgrading the Sheevaplug OS is not too difficult. There are some good guides available. Martin Michlmayr explains here how to upgrade to Debian 6 from scratch. On the other hand, New IT, who sell the Sheevaplug in the UK, offer complete Debian images ready for download. If you just want to upgrade a Sheevaplug without getting too much into the nuts and bolts, these offer a simple solution.

Debian Upgrade Using a Pre-Built Image

It is an easy procedure, as will now be explained. I am assuming here that:

(a) You have a white Sheevaplug.
(b) You have an empty 4G or 8G SD card.
(b) You have a Linux PC or similar (this procedure requires the unix dd command)
(c) You are able to connect to the plug from the PC over USB, using putty, minicom or similar.

Download the Debian Image

The first step is to download the Debian image. Pop over to New IT and browse the wide selection of available images. Select one appropriate to the size of your SD memory card. For example, I downloaded the image transcend-4G-4025483264-NewIT-v1.4-debian-squeeze.img.gz. The size of the image is indicated by the file name (“4G”). There are many images listed, some of which look the same. New IT have provided these alternatives because of small variations in size between SD cards from different manufacturers.

Copy the Debian Image to the SD Card

Got your image ? Good. It should be saved somewhere on your PC (not on the Sheevaplug). Insert the new SD card into your PC and copy the downloaded image onto it as follows. I say “new SD card” because it is advisable to preserve your existing card, if your Sheevaplug uses one, as a backup should this procedure not work. The existing card will work just as well though.

pc# dd if=transcend-4G-4025483264-NewIT-v1.4-debian-squeeze.img.org of=/dev/mmcblk0 bs=1024k

You should use the name of the downloaded image in the “if=” argument. Also, your card device may not be exactly the same as mine (/dev/mmcblk0), so you may need to modify that as appropriate.

When the dd command has completed, use fdisk to view the partitions on the card. You will see that the New IT image is a whole-disk image including 2 partitions, which have now been created on your SD card:

pc# fdisk /dev/mmcblk0
-> p

Disk /dev/mmcblk0: 8011 MB, 8011120640 bytes
4 heads, 16 sectors/track, 244480 cylinders, total 15646720 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: 0xb1164c8a

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 16 24639 12312 83 Linux
/dev/mmcblk0p2 24640 7862271 3918816 83 Linux

The smaller partition contains the Linux kernel. The larger one is the root file system, the bulk of Debian. [You might notice from the above that the SD card used in this example was 8 Gb in size, while the downloaded image was only 4 Gb. It makes no difference. It just means that half of the SD card remained unused. A bit wasteful, but I can reclaim the space at a later date]

Load the new OS into the Sheevaplug

Unmount the SD card from your PC, if it is mounted:

pc# umount /dev/mmcblk0

Insert the SD card into the Sheevaplug.

Connect your PC to the Sheevaplug with an appropriate USB cable. Issue a putty, minicom or similar command to obtain terminal access.

Power on the plug. If you are lucky, Debian will boot automatically. Otherwise, type “boot” at the “Marvel>>” Uboot prompt.

Depending on the history of your Sheevaplug, it still might not boot. You will have to adjust some of the the Uboot parameters. Return to the “Marvel>>” prompt: Either switch the power off and then on, or press the reset switch using some pointy tool (an unfolded paper clip works well).

Configure Uboot Parameters

This New IT forum thread discusses Uboot parameters that can be used with the ready-installed SD cards sold by New IT. Conveniently, the same parameters work for NewIT’s downloadable images.

Following the forum examples, I changed the boot_cmd and bootargs_root parameters, instructing the unit to boot from the twin partitions on the SD card. The final list of boot parameters is shown at the end of this article, and will work in conjunction with the image downloaded above.

But before making any changes it’s probably a good idea to keep a saved copy of the existing Uboot parameters. Use the following command to get a list.

Marvell>> printenv

Copy the entire output of this command paste it into a file somewhere on your PC. It’s a good idea to sort that list, too, for readability, which you can do with the Linux “sort” command.

Having saved your current parameters, make the required modifications using the “setenv” command. Here are the commands I used to make those changes to bootcmd and bootargs_root:

Marvell>> setenv bootcmd='setenv bootargs $(bootargs_console) $(bootargs_root); mmcinit; ext2load mmc 0:1 0x800000 /uImage; bootm 0x00800000'

Marvell>> setenv bootargs_root '/dev/mmcblk0p2 rootdelay=5'

Marvell>> saveenv

Now reset the Sheevalug or type “boot”. It should boot into Debian 6 (Squeeze), a fully supported Debian release.

Install Latest Debian Updates

On the subject of support, update Debian at the first opportunity. Log in and type:

debian# sudo apt-get update
debian# sudo apt-get upgrade dist

This should download and apply a hefty chunk of changes. Once the update has completed, reboot the plug to make them take full effect. Follow a similar procedure every few days to keep the operating system up to date and secure.

Working Uboot parameters for New IT Debian Image

All parameters from the successfully installed Sheevaplug. The list has been sorted for readability:

bootargs_root=root=/dev/mmcblk0p2 rootdelay=5
bootcmd=setenv bootargs $(bootargs_console) $(bootargs_root); mmcinit; ext2load mmc 0:1 0x800000 /uImage; bootm 0x00800000
e=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x1ff00000@0x100000(root)
real_bootcmd=setenv bootargs $(bootargs_console) $(mtdpartitions) $(bootargs_root); nand read.e 0x00800000 0x00100000 0x00400000; bootm 0x00800000
recover1=setenv mainlineLinux yes; setenv arcNumber 2097; setenv bootcmd run recover2; saveenv; reset
recover2="run recover3
recover3=run recover4; nand erase clean 0x00100000 0x00400000; nand write.e 0x00800000 0x00100000 0x00400000
recover4=usb start; fatload usb 0 0x00800000 uImage; fatload usb 0 0x01100000 initrd
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;

Roll Back Procedure

If you wish to roll back this procedure for any reason, proceed as follows:

Power off the Sheevaplug
Replace the old SD card
Power on the sheevaplug
At the “Marvell>>” prompt, set the Uboot paramenters to their previous values using the list saved to your PC.
At the “Marvell>>” prompt, issue a savenv command to make the changes permanent
Reset or power cycle the plug.

5 thoughts on “Upgrading the Sheevaplug to Debian 6 Squeeze

  1. Pingback: Upgrading Sheevaplug to Squeeze « Dave’s Blog

    • Thanks Koutheir. Article updated. I’ve had one of the original white plugs for a couple of years now. Great little thing. Just sits there running all sorts of services, takes only 10 watts or so and never complains.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.