bartman's blog

Debian on UBIFS upgrade on SheevaPlug

bartman
Table of Contents

I picked up a SheevaPlug recently. In a few weeks I’ll try to use it as a git server in a classroom setting at Flourish Conf, where I will be speaking about [Git]{tags/git}.

marvell_sheevaplug_1

This platform consists of a 1.2 GHz ARM processor (Feroceon 88FR131 rev 1 (v5l)), 512M of SDRAM, 512M of NAND flash, 1Gbit ethernet, USB, SD card reader, and … well, that’s it.

The software installed on the SheevaPlug leaves a bad taste in my mouth. I am glad that they picked Linux, and more over that they picked Debian/Ubuntu. What I don’t appreciate is that there are a dozen things broken out of the box, and it seems like the system is a hodgepodge of packages from Debian and Ubuntu.

The first thing I decided to do was to install Debian/sqeeze on it. And since I was reinstalling, I wanted to upgrade the on-board flash file system to UBIFS. The following is an account of things I needed to do to get Debian running on UBIFS on the SheevaPlug.

SheevaPlug Installer… #

Before I start, I’ll mention the SheevaPlug Installer.

The installer asks me to…

I guess there are two types of people in the world: those that would have many questions about the above command, and those that woudl not. You are welcome to draw your own conclusions as to which camp I am in.

Prior work… #

Fortunately, I didn’t have to reinvent the wheel. I read the very good Installing Debian To Flash wiki page on PlugWiki. It’s a very precise, and well documented, procedure. I learned a lot about the internal setup. However, the procedure fails around the 75% mark.

When you reach step 8, Convert internal flash root partition to UBIFS, you will get errors like the ones reported here. More specifically using ubimkvol to create an empty volume will fail like this:

# ubimkvol /dev/ubi0 -N rootfs -m
Set volume size to 517386240
[ 1286.379273] UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 0:512, written 0 bytes
[ 1286.388397] UBI warning: ubi_eba_write_leb: failed to write VID header to LEB 2147479551:0, PEB 0
[ 1286.398034] UBI: try another PEB
[ 1286.401461] UBI: run torture test for PEB 0

… after a few failed attempts the kernel might also crash. From what I can tell, this is a bug in the ubifs driver in that kernel (2.6.32-trunk-kirkwood).

A different way of creating an ubifs image… #

Fortunately in the same thread as the error report above, pingtoo outlines the off-line fs creation procedure. While the procedure there crashes too, I was able to get it working after modifying it a bit.

Finished off the last 25%… #

You have followed the Installing Debian To Flash instructions and you have a SheevaPlug running uboot version 3.4.19, and you have installed Debian on a USB stick.

WARNING: at this point you’ll be running the Debian kernel with version 2.6.32-trunk-kirkwood, and if you run ubiattach so you can mount it you will crash. So, don’t.

Since you already burned in the kernel in step 5, Burn a New Kernel, the last step remaining is to fix up uboot to boot your new system.

As of this writing, the most recent prebuilt kernel for the sheeva is 2.6.32.8. This is the one I burned in earlier at offset 0x100000.

Tags: