Debian Squeeze on a SheevaPlug

Setup

The process is fairly straight forward, but there are some requirements:

  • A TFTP server with some specific files. These should all be in the root of the TFTP directory.
  • The latest version of the SheevaPlug U-Boot binary.
  • The latest version of the Debian installer image (uImage and uInitrd).
  • The latest version of the Linux kernel (optimized for SheevaPlug; uImage and Modules).
  • A 2+ GB USB thumb drive.
  • Terminal emulation software (GNU screen, PuTTY, minicom, HyperTerm) [Note: Mac OS X’s version of screen seems to have issues with the debian installer, so I used PuTTY in a VM.]


There’s a lot of interrupting the initial boot process, which requires fairly fast attachment of your terminal. If you’re using a VM environment, make sure you tell it to remember your “Attach to Host or VM?” preference, otherwise you’ll miss the interrupt prompt.

Upgrade U-Boot

  • Reset the SheevaPlug
  • Interrupt the boot process
  • “Hit any key to stop autoboot:”
  • Document the MAC addressMarvell>> print ethaddr ethaddr=FF:FF:FF:FF:FF:FF
  • Boot using TFTPMarvell>> setenv ipaddr x.x.x.x Marvell>> setenv serverip y.y.y.y Marvell>> tftpboot 0x0800000 u-boot.kwb Marvell>> nand erase 0x0 0x60000 Marvell>> nand write 0x0800000 0x0 0x60000 Marvell>> reset
  • Fix the MAC address by interrupting the boot process (the new U-Boot loses the setting).Marvell>> setenv ethaddr FF:FF:FF:FF:FF:FF Marvell>> saveenv Marvell>> reset

Burn the new kernel

Marvell>> setenv ipaddr x.x.x.x Marvell>> setenv serverip y.y.y.y Marvell>> tftpboot 0x2000000 sheeva-3.4.7-uImage Marvell>> iminfo Marvell>> nand erase 0x100000 0x400000 Marvell>> nand write 0x2000000 0x100000 0x400000 Marvell>> setenv mainlineLinux yes Marvell>> setenv arcNumber 2097 Marvell>> saveenv

Install Debian

For this section, I recommend using PuTTy on a Windows VM. Or at least something other than GNU Screen on Mac OS X. It doesn’t play nice with the Debian installer character set for some reason. You can try using SynchTERM on Mac OS X, but it still isn’t quite right and it becomes very easy to check the wrong boxes.

Marvell>> setenv ipaddr x.x.x.x Marvell>> setenv serverip y.y.y.y Marvell>> tftpboot 0x0400000 uImage Marvell>> tftpboot 0x0800000 uInitrd Marvell>> setenv bootargs console=ttyS0,115200 base-installer/initramfs-tools/driver-policy=most Marvell>> bootm 0x0400000 0x0800000

Once in the installer, answer the defaults to all the questions, set a root password, etc. When you get to the disk partitioning, it should not detect any disks and will ask to configure iSCSI.

  • Plug in a USB pen drive
  • Use [TAB] to select Go Back
  • Select “Disk Partitioning” again
  • The USB drive is now detected
  • Use default partitioning (everything in /)
  • Be careful selecting packages. I only select the SSH server and NOT Standard System Utilities — otherwise you’ll fill the SheevaPlug
  • Once finished, interrupt boot process and boot from USB:Marvell>> setenv bootargs_console console=ttyS0,115200 Marvell>> setenv bootcmd_usb ‘usb start; ext2load usb 0:1 0x0800000 /uInitrd; ext2load usb 0:1 0x400000 /uImage’ Marvell>> setenv bootcmd ‘setenv bootargs $(bootargs\_console); run bootcmd\_usb; bootm 0x400000 0x0800000’ Marvell>> boot
  • Set up UBIFS (so much faster than JFFS2; 2+ minute boot down to 20 seconds)# apt-get install mtd-utils # ubiformat /dev/mtd2 -s 512 # ubiattach /dev/ubi_ctrl -m 2 # ubimkvol /dev/ubi0 -N rootfs -m # mount -t ubifs ubi0:rootfs /mnt
  • Clone the USB root to the internal flash (UBIFS)# mkdir /tmp/rootfs # mount -o bind / /tmp/rootfs/ # cd /tmp/rootfs # sync # cp -a . /mnt/
  • Fix the /mnt/etc/fstab file# cat << END > /mnt/etc/fstab /dev/root / ubifs defaults,noatime,rw 0 0 tmpfs /var/run tmpfs size=1M,rw,nosuid,mode=0755 0 0 tmpfs /var/lock tmpfs size=1M,rw,noexec,nosuid,nodev,mode=1777 0 0 tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0 END
  • Reboot — interrupt boot cycle, unplug USB
  • Reconfigure the boot commandMarvell>> setenv bootargs ‘console=ttyS0,115200 ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs’ Marvell>> saveenv Marvell>> reset
  • This is needed for a distribution upgrade# apt-get update
    # apt-get upgrade
    # apt-get dist-upgrade
    Change all instances of ‘squeeze’ to ‘wheezy’ in /etc/apt/sources.list
    # ln s /dev/ubi0_0 /dev/root
    # apt-get update
    # apt-get upgrade
    # apt-get dist-upgrade
    # reboot
  • Add deb-multimedia repository to /etc/apt/sources.listdeb http://deb-multimedia.org/ wheezy main
    deb-src http://deb-multimedia.org/ wheezy main# apt-get update
    # apt-get install deb-multimedia-keyring
    # apt-get update
  • If you screw up and find that you can’t boot up the SheevaPlug, this is the only way I found to unbrick it.http://sourceforge.net/projects/esia/
  • Install some packages# apt-get install sudo

Resources:

https://adufray.com/blog/2013/05/08/installing-debian-squeeze-on-a-sheevaplug

How To Install The Debian Multimedia Repository On Debian Operating Systems

http://wiki.hackzine.org/hardware/guruplug-misc.html

https://www.howtoforge.com/how-to-upgrade-debian-squeeze-to-wheezy

Unbrick SheevaPlug

http://www.mythtv.org/wiki/MythTV-HOWTO_-_0.26

https://www.howtoforge.com/using-iscsi-on-debian-squeeze-initiator-and-target