Here at Encore we’ve recently been producing an application for various mobile devices, one of which being the Nokia N810 internet tablet.
The Nokia internet tablets run a cool little operating system called Maemo (a Linux-variant based on Debian) and run on an ARM chip. Nokia provide a great environment for developing and cross-compiling applications for Maemo-based devices – it’s very helpful and excellently documented. That said, we came across a couple of gotchas during our work, one of which I’ll describe in this post.
The Maemo development environment is based on a cross-compilation toolkit named Scratchbox. Nokia provide scripts to set up the the Maemo-flavoured Scratchbox. By default, however, the Maemo/Scratchbox install installs to the root of your filesystem at /scratchbox. This turned out to be a problem, as my Debian virtual machine only has 7gb allocated for the root partition, with the majority of space being in /home.
As the Maemo Scratchbox is essentially composed of a minimal Linux distribution for each platform target, ARM and x86, that was two new Linux distributions installed into the root partition of my existing one! A freshly installed Maemo Scratchbox is 2.1gb. On top of that I was compiling various libraries to use with our app, such as the wxWidgets toolkit, for both target architectures. I soon ran out of space while I was compiling our application.
To make more space, one obvious option would be to edit the partition table. But why would you want the Maemo development environment in your root partition in the first place? Best to put it elsewhere. To avoid uninstalling the work already done, I moved /scratchbox into my home and set up a symlink. There’s a couple of gotchas in doing this. I didn’t find any documents describing precisely how to do this, so here’s what I determined you need to do. All commands should be executed as the root user of your host computer (i.e. not inside scratchbox) and with all your Scratchbox terminals closed down.
$ /scratchbox/sbin/sbox_umountall
$ mv /scratchbox ~someuser/projects/scratchbox
$ ln -s ~someuser/projects/scratchbox /scratchbox
$ /scratchbox/sbin/sbox_mountall
You can now log in as normal with /scratchbox/login. Basically the sbox_umountall and sbox_mountall are the important parts, to make sure everything in the virtual Scratchbox systems is closed down cleanly and restarted again. Without those you may bang your head against the wall if you’re trying to move your Scratchbox!

Entries:
Comments:
User: