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:
sudo apt-get install ia32-libs xserver-xephyr
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:
vm.mmap_min_addr = 4096net.ipv4.ip_local_port_range = 1024 65535
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:
scratchbox-core_1.0.13_i386.debscratchbox-libs_1.0.13_i386.debscratchbox-devkit-apt-https_1.0.4_i386.debscratchbox-devkit-cputransp_1.0.9_i386.debscratchbox-devkit-debian_1.0.10_i386.debscratchbox-devkit-doctools_1.0.10_i386.debscratchbox-devkit-git_1.0.1_i386.debscratchbox-devkit-perl_1.0.4_i386.debscratchbox-devkit-svn_1.0_i386.debscratchbox-toolchain-cs2007q3-glibc2.5-arm7_1.0.11-7_i386.debscratchbox-toolchain-cs2007q3-glibc2.5-i486_1.0.11-5_i386.deb
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:
cd <download-destination>sudo dpkg --force-architecture --install scratchbox-*_i386.deb
The package installation automatically started the Scratchbox environment. All that’s left is to setup a user environment to work with:
sudo sb-adduser "$USER"newgrp sbox
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!