n900: maemo fremantle SDK and gregale SDK in same scratchbox

Nokia has recently announced the introduction of the stunning n900, the evolution of the n770, n800, and n810 internet tablets. The n900 is not just an internet tablet, it is a phone!

This announcement has sparked renewed interest in the maemo development environment for the n-series devices.

Back when I bought a n770 tablet, I experimented with gregale SDK, the n770 development environment based on Scratchbox. Now that the n900 is out, I decided to try out the lastest fremantle SDK beta for the n900.

The first thing I tried to do (after building and testing presage on it, of course) was to co-install the n770 gregale SDK along with the n900 fremantle SDK beta2 in the same scratchbox installation (specifically, the one supported by the fremantle SDK), so that I can build for both the n770 and n900.

This is easy to do, provided you know what you are doing. Basically, it boils down to setting up a new scratchbox target. This can be easily achieved using sb-menu.

You first need to get the gregale SDK rootstraps and toolchain:

from the following URLs:

Only the rootstraps and toolchains are needed, since scratchbox is already installed (this is very easy to accomplish by simply running the fremantle SDK installation script provided by Nokia).

Next, deploy the toolchains in your scratchbox installation (assuming it's located in /scratchbox):
tar zxvf scratchbox-toolchain-cs2005q3.2-glibc-* -C /

and copy the rootstraps to
cp Maemo_Dev_Platform_v2.2_* /scratchbox/packages

To set up the n770 x86 target, start up sb-menu:

  • select the Setup option
  • create a new target: i.e. GREGALE_X86
  • select the cs2005q3.2-glibc-i386 compiler toolchain
  • add the debian-sarge, doctools, perl, apt-https devkits (for armel targets, you also need qemu devkit)
  • select cpu transparency: none (for armel targets, you will want arm transparency)
  • extract the Maemo_Dev_Platform_v2.2_i386-rootstrap.tgz rootstrap to the target by selecting it by pressing spacebar when highlighted in the dialog (use the armel rootstrap for the armel target)
  • install all filesets to the target (skipping c-runtime only)

That's it. The steps to setup an armel target (I like to call it GREGALE_ARMEL) are analogous and I'll omit listing them explicitly.