Plug computing

Plug computing

All about plug computers.

History

Reinstalling Ubuntu on sheevaplug: Revision

I was asked to help reinstall Ubuntu on a sheevaplug recently. I found a howto but it was quite complex. I ended up writing a bash script that fetches the real installer package, makes the necessary changes and puts everything on a flash drive before calling the original php install script.

Having achieved the result I then went ahead and installed Debian on a SD card as well, and figured out how to switch between the two.

The plug I have is an Ionics PC120DKUS .. smaller than the one FracPete demonstrated but it has a kludgy JTAG box that plugs in on the side for the SDCard slot, usb debugging port and reset button.

BTW since Ubuntu 9.04 is no longer supported, the repos are all broken and unlikely to get any better so it's pretty hard to install any useful software. I think there probably aren't many cases where you would want to reinstall the original ubuntu on your sheevaplug, debian is much more useful!

Here's a plaintext on restoring the original Ubuntu 9.04 to the sheevaplug;

First up, make sure you have php5-cli, ftdi, and mkdosfs installed .. packages are php5-cli libftdi1 dosfstools

Go fetch the installer package from here and untar it; http://www.plugcomputer.org/index.php/us/resources/downloads?func=select&id=5

Edit the file sheevaplug-installer-v1.0/uboot/openocd/config/interface/sheevaplug.cfg, comment out the lines for ft2232_vid_pid and ft2232_device_desc (they're specific to one particular model of sheevaplug.)

Edit sheevaplug-installer-v1.0/runme.php and take out these two lines because php5 doesn't seem to be picking up USER from the environment properly. 

     if ($_ENV["USER"] != 'root')
        die("You must run this as root\n");

Format a USB drive as fat32, copy sheevaplug-installer-v1.0/installer/* into the root directory of the USB drive, then go plug it into the sheevaplug.

Reset your sheevaplug .. and if it's not actually unbootable, you probably need to connect from a terminal through the USB interface and stop it from booting.

Run the script as root; "sudo php5 runme.sh"

After the script stops, wait another couple of minutes until you see the sheevaplug reset itself.

To switch to booting from debian off the SD card, we get to the uboot prompt and put in the following;

setenv bootargs_console console=ttyS0,115200
setenv bootcmd_mmc 'mmc init; ext2load mmc 0:1 0x00800000 /uImage; ext2load mmc 0:1 0x01100000 /uInitrd'
setenv bootcmd 'setenv bootargs $(bootargs_console); run bootcmd_mmc; bootm 0x00800000 0x01100000'

saveenv

And this goes back to booting ubuntu off the internal NAND;

setenv x_bootargs console=ttyS0,115200 mtdparts=orion_nand:512k(uboot),4m@1m(kernel),507m@5m(rootfs) rw
setenv x_bootargs_root ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs
setenv x_bootcmd_kernel nand read 0x6400000 0x100000 0x400000
setenv x_bootcmd_sata ide reset;
setenv x_bootcmd_usb usb start;
setenv  bootcmd '${x_bootcmd_kernel}; setenv bootargs ${x_bootargs} ${x_bootargs_root}; ${x_bootcmd_usb}; ${x_bootcmd_sata}; bootm 0x6400000;'
saveenv