Maemo 5.0 on AMD64

This document used to describe how to make Scratchbox and the Maemo SDK work inside a 32-bit chroot on Ubuntu for the AMD64 (x86_64) architecture. As it turns out, this hazardous procedure is no longer necessary.

Instead of cascading one chroot environment into another, it is in fact possible to simply install the 32-bit Scratchbox packages directly. I have updated this document accordingly. The installation as described here works with Scratchbox 1.0.12 on Ubuntu 8.10 (Intrepid Ibex). Your mileage may vary with other distributions, particularly non-Debian ones. Do not hesitate to send me corrections.

1. Package prerequisites

You'll need the 32-bit versions of various system libraries to enable the execution of 32-bit binaries on your AMD64 system. Other than that, only the xserver-xephyr package will be needed:

2. System-level hacks

Unfortunately, due to incompatibilities of some arcane Scratchbox code with certain Linux kernel settings, a bit of ugly hackery is required to get things to work at all. First, you need to append the parameter vdso32=0 to the kernel boot command line. To do so, edit the kopt entry in /boot/grub/menu.lst. Don’t forget to run sudo update-grub afterwards.

Then you’ll probably also need to mess with some kernel parameters:

To apply these sysctl settings permanently, simply drop the file 60-scratchbox.conf into the /etc/sysctl.d directory. For more information about these tweaks and why they are needed, refer to the Known issues in scratchbox listed in the SDK installation instructions.

3. Installing Scratchbox

After you have rebooted, download the latest Debian packages from the Scratchbox 1 repository. You’ll probably need:

This were the versions that worked for me, at the time of writing. It might be worthwhile to keep an eye out for updated packages though. Unfortunately it isn’t possible to simply add the repository to /etc/apt/sources.list, since the architecture doesn’t match. Now install the downloaded packages, forcing dpkg to ignore the architecture mismatch:

The package installation automatically started the Scratchbox environment. All that’s left is to setup a user environment to work with:

Now try to enter your shiny new Scratchbox environment using the scratchbox command.

If everything went well, you should now be able to continue with the regular instructions for the manual SDK install. Good luck!