Maemo 2.0 on AMD64

This document describes how to make Scratchbox 0.9.8 work on Ubuntu for AMD64. The approach taken is to set up a 32-bit chroot environment for Scratchbox to run in. Please note that I’m writing this documentation about one week after the fact and thus the information provided here might be incomplete. Do not hesitate to send me corrections.

The approach shown here works just fine with Ubuntu 6.10 (Edgy Eft) as well as Ubuntu 6.06 (Dapper Drake) as the host system. I haven’t tried yet with an Edgy guest system inside the chroot, though.

Part of this document is based on the Ubuntu 32bit CHROOT for AMD64 wiki page by Matt T. Proud.

1. Package prerequisites

Invoke:

2. Setup of the chroot location

Choose a location that has ample free space and create the chroot directory there. I’ll be using /chroot/dapper-i386 in the remainder of this document.

Add that location to /etc/dchroot.conf:

3. Base system installation

Invoke:

Put the following lines into /chroot/dapper-i386/etc/apt/sources.list:

Invoke

to enter the chroot environment as root. Then run:

Exit the shell to leave the chroot environment.

4. System integration

To integrate the 32-bit chroot into your system, download the chroot32 script and place it into /etc/init.d. You’ll want to inspect that file as it will become part of your boot process. Once you’re sure, go on and create the necessary symbolic links in the /etc/rc?.d directories to have the script executed on boot-up. On Debian and its derivates, the distribution tool update-rc.d can be used to set up all runlevels at once:

At this point, you might as well download the scratchbox32-core script needed later on and place that into /etc/init.d, too. Then, after you had a look at the file and made sure it won’t hose your system, integrate this script into your system’s initialization procedure as well:

Since /etc/init.d/chroot32 runs mount --bind to make the chroot’s group and passwd files reflect the content of the host system’s files, the sbox group must be created manually within the host environment:

For <your-user-name>, insert the login name of the user who will be working with Scratchbox. Repeat as necessary for multiple users.

Finally, run the initialization script to prepare the 32-bit chroot environment for use:

5. Installing Scratchbox

Download the Debian packages from the Scratchbox 0.9.8 repository. You’ll probably need:

If you put them somewhere in your home directory, they should now be accessible from inside the 32-bit chroot as the entire /home is mirrored into the chroot tree.

The package installation automatically started the Scratchbox environment. However, we’ll be using our own system integration scripts outside the chroot since doing it that way turns out to be more reliable in my experience. Undo the automatic startup with:

Now exit the shell to leave the chroot environment. Outside of the chroot environment, create this link:

This allows using the supplied sbox_ctl script from outside the chroot without changes. Then run the Scratchbox startup script:

And finally enter the Scratchbox environment:

Congratulations! You should now be able to follow the instructions from the maemo tutorial.

6. Notes

The documentation is a bit unclear on the intended environment to run Xephyr in. In my experience, it works best to run Xephyr outside Scratchbox, but inside the 32-bit chroot. You may want to use my login-xephyr wrapper script around /scratchbox/login in order to start Xephyr together with Scratchbox.