Maemo 5 alpha SDK installation


  1. Automated installation
    1. Scratchbox1 installation
    2. SDK installation
  2. Manual installation
    1. Scratchbox1 installation
    2. SDK installation
  3. Installing Nokia-closed binaries
  4. Xephyr X11-server installation
  5. Starting/shutting down hildon application framework
  6. Known issues in scratchbox1
    1. VDSO support
    2. Qemu and mmap minimum address
    3. Tip: /etc/sysctl.conf
  7. Known issues in SDK


Maemo 5 alpha SDK has been tested on Ubuntu Intrepid and Debian stable distrubutions. It can be installed with the aid of the following installers:

  • scratchbox installer : Downloads and installs the required version of scratchbox1 onto your host computer.
  • SDK installer: Downloads the minimal rootstraps for both armel and i386 targets in scratchbox and sets up the targets.

1. Automated installation

The scratchbox installer script downloads and installs the required version of scratchbox to your host system. This is the easiest and recommended way for installing scratchbox the first time. If you already have an existing scratchbox installation, jump to section 2.1

1.1 Scratchbox1 installation

1. Download the scratchbox installer script.

2. Run it as root user specifying the username to be added to scratchbox users and sbox group. On Ubuntu, you can use 'sudo' command to run the script as follows:

$ sudo ./ -u USER    

3. For the group membership to be effective in the current terminal session , run the following command:

$ newgrp sbox

You should now have a working scratchbox environment ready. In a rare situation, if the installer cannot work properly on your system you may have to do a manual installation. This is explained in chapter 2.1.

Running this installer will not modify any files outside its given install path. Downloaded files are temporarily stored in /tmp directory. These can be safely removed after the installer has finished its execution.

On Debian based distributions, the install script will use Debian packages. Packages install to the default path, /scratchbox.

On any other Linux distribution, the install script will use .tar.gz files which can be installed to any given path. Scratchbox installation should be separate from host system's tools, e.g. to /scratchbox or /opt/scratchbox.


1.2 SDK installation

Following steps will quickly guide you through the installation of the open source components of the SDK.

1. Download the SDK installer script

2. Run it outside scratchbox environment as follows:

$ sh

If you have installed scratchbox in a path alternative to /scratchbox, you need to specify the path with '-s PATH' option.
More information on the available options can be found here.

3. On running the script, the SDK license information is displayed. Acceptance of the licence is needed inorder to proceed with the installation. Press 'Enter' key to accept and proceed.



4. You are presented with four options to configure the installation of the SDK:

1. Minimal Rootstrap only : Choose this only if you want to install only a minimal environment. Note that you will then need to manually install the packages you need.

2. Runtime Environment: Use this to install and run software inside scratchbox. For development, we recommend option 3.

3. Runtime Environment + All Dev Packages : Choose this to get a full development environment.

4. Runtime Environment + All Dev and Dbg Packages : You will get a full development environment plus debug symbols for many system components.

The default selection is option 3. Make your selection and proceed further.


5. The summary of the selection made uptil now is presented to you. If all settings are as you have expected, proceed further. Else, cancel the installation and start again.


6. The installer continues to download the minimal rootstraps for both X86 and ARMEL targets, installs them and there after installs the packages based on your selection in step 4. Once the installation is successfull, you can further install the Nokia binaries as instructed in section 3.

For starting up the UI framework in the SDK, please refer to section 4 and section 5.


Options available for the SDK installer

The sdk installer can be run with various options if needed. The available options are:

-v Display version and exit
-h Show this usage guide
-c Use exisitng downloads, don't try to download again
-y Yes, force remove of existing targets
-d Use defaults. Non-interactive mode
-p URI Specify http_proxy for scratchbox user (By default, host system's proxy is used ).
-s PATH Specify scratchbox installation path (default /scratchbox)
-q NAME Specify Qemu version (default qemu-arm-cvs-m)
-a FILE Specify alternative sources.list file for both targets
-A Advanced mode

2. Manual installation

If you have an existing installation of scratchbox1, you can upgrade it manually by following the instructions below. You may also need manual installation, if for some reason the automated installation script fails to install scratchbox1 on your host system.

2.1 Scratchbox1 installation

In Fremantle, the following scratchbox1 packages are used:

scratchbox-core 1.0.13
scratchbox-libs 1.0.13
scratchbox-devkit-cputransp 1.0.8
scratchbox-devkit-debian 1.0.10
scratchbox-devkit-doctools 1.0.10
scratchbox-devkit-git 1.0.1
scratchbox-devkit-svn 1.0
scratchbox-devkit-perl 1.0.4
scratchbox-toolchain-cs2007q3-glibc2.5-arm7 1.0.10-6
scratchbox-toolchain-cs2007q3-glibc2.5-i486 1.0.10-4
scratchbox-toolchain-host-gcc 1.0.13

2.1.1 Installing Scratchbox1 on Debian GNU/Linux

1. Add the following entry in your host system's /etc/apt/sources.list file:

deb maemo5-sdk main

2. Execute the following commands:

$ sudo apt-get update
$ sudo apt-get install scratchbox-core scratchbox-libs scratchbox-devkit-cputransp scratchbox-devkit-debian scratchbox-devkit-doctools scratchbox-devkit-git scratchbox-devkit-svn scratchbox-devkit-perl scratchbox-toolchain-cs2007q3-glibc2.5-arm7 scratchbox-toolchain-cs2007q3-glibc2.5-i486 scratchbox-toolchain-host-gcc

3. After downloading, Scratchbox will be unpacked to '/scratchbox' directory and the installation procedure will ask you some questions about the group and user accounts. Default group to Scratchbox users is 'sbox'. Group can be renamed, but default should be fine unless you have LDAP or similar network authentication scheme. If network authentication is used, then using an existing user group is recommended.

Users who will be using Scratchbox1 should be added using command:

 $ sb-adduser USER

It will automatically include users to the Scratchbox1 group, create user directories under '/scratchbox/users' and mount several directories (/dev, /proc, /tmp) under the user directory.

4. For the group membership to be effective in the current terminal session , run the following command:

$ newgrp sbox

Note: This command will change the existing group ID during the login session to sbox.

5.Start Scratchbox1 using the command:

$ scratchbox  OR
$ /scratchbox/login

2.1.2 Installing Scratchbox1 on other Linux distributions

You will need root privileges for this part of the installation.

1. Obtain the required scratchbox1 packages (see above ) as tarballs from here.

2. Uncompress the tarballs to the /directory

$ tar zxf <package> -C /

Note: If '/' directory does not contain enough space for Scratchbox1, it can be installed to some other partition by creating a symbolic link from '/scratchbox' to desired place with the command: ln -s /opt/sb /scratchbox

3. After extraction, configure Scratchbox with the following command:

$ /scratchbox/

Answer the questions (Defaults should be fine). This creates 'sbox' user group and sets up scratchbox1.

4. Add users to Scratchbox1 with the command:

$ /scratchbox/sbin/sbox_adduser <username>

It will automatically include users to the Scratchbox group, create user directories under '/scratchbox/users' and mount several directories (/dev, /proc, /tmp) under the user directory.

5. For the group membership to be effective in the current terminal session , run the following command:

$ newgrp sbox

6. Start scratchbox with the command:

$ /scratchbox/login 

Note: Since scratchbox1 was installed from tarballs, rebooting your machine will clear away all the mounts and binfmt_misc registrations that Scratchbox1 requires to work. To get your scratchbox working again after reboot, you have to run the following command as root:

$ /scratchbox/sbin/sbox_ctl start

For more information on Scratchbox1 installation, please refer the installation pages at


2.2 SDK installation

Generally, you do not need to do a manual install unless the maemo SDK installer script cannot function in your specific environment. If you do need, then here is the way to do it.

Make sure that you have the scratchbox installation complete prior to installing the SDK manually. See section 2.1 for manual scratchbox installation or section 1.1 for automated scratchbox installation.

1. Login to scratchbox using the command below:

$ scratchbox OR /scratchbox/login

2. The nextstep is to set up the X86 and ARMEL targets. There are two ways to set them up: one using the command line utility called sb-conf and the other using the interactive sb-menu command. In either case, the settings are as follows:

  • X86 target:
    • Compiler: cs2007q3-glibc2.5-i486
    • Devkits: perl debian-etch doctools svn git
    • CPU-transparency: none
  • ARMEL target:
    • Compiler: cs2007q3-glibc2.5-arm7
    • Devkits: perl debian-etch doctools svn git
    • CPU-transparency: /scratchbox/devkits/cputransp/bin/qemu-arm-cvs-m


Using sb-conf command line utility:

  • X86 target:
    sb-conf st FREMANTLE_X86 -c cs2007q3-glibc2.5-i486 -d perl:debian-etch:doctools:svn:git -t none
  • ARMEL target:
    sb-conf st FREMANTLE_ARMEL -c cs2007q3-glibc2.5-arm7 -d cputransp:perl:debian-etch:doctools:svn:git -t qemu-arm-cvs-m

You can alternatively use sb-menu interactive command to do the same setup.

3. Download the minimal rootstraps for both the architectures.


4. Select the FREMANTLE_X86 target

sb-conf se FREMANTLE_X86

5. Install the minimal rootstrap

[sbox-FREMANTLE_X86: ~] > sb-conf rs maemo-sdk-rootstrap_5.0alpha_i386.tgz

6. Install etc, devkits and fakeroot on the target and perform apt-get update.

[sbox-FREMANTLE_X86: ~] > sb-conf in -edFL
[sbox-FREMANTLE_X86: ~] > apt-get update

7. At this point, a simple C program should be compilable as the rootstrap provides you with a minimal compilation environment. The modular SDK provides you with the possibility to install only the packages that you need. The repository contains meta-packages for differentcomponents, for eg: desktop, connectivity, multimedia-framework etc. We also have three top-level meta-packages that allow easy installation of runtime, development and debug environments.

Maemo runtime environment

[sbox-FREMANTLE_X86: ~] > fakeroot apt-get install maemo-sdk-runtime

Maemo runtime + development environment

[sbox-FREMANTLE_X86: ~] > fakeroot apt-get install maemo-sdk-dev

Maemo runtime + development + debug environment

[sbox-FREMANTLE_X86: ~] > fakeroot apt-get install maemo-sdk-debug

8. Repeat the same for FREMANTLE_ARMEL target


3. Installing Nokia-closed binaries

Caution: Install the Nokia binaries only after successfully installing the open source components of the SDK

Inorder to obtain Nokia-closed binaries, you are required to accept the End User License Agreement. Visit to do so. Upon acceptance, you are given a specific "Token" to access the Nokia binaries repository. Please note that such obtained token may not be re-distributed or disclosed.

Along with the token, you are also given a repository url that can added to /etc/apt/sources.list inside scratchbox. Follow the steps below to install all the provided Nokia binaries + open components that depend on Nokia-closed packages.

1. Add the sources.list entry to the /etc/apt/sources.list inside scratchbox targets.

apt-get update
fakeroot apt-get install nokia-binaries


4. Xephyr X11-server installation

You need to install the Xephyr X11 server software to your host system before you can run applications inside maemo 5.0-alpha SDK.

Xephyr is an X11 server that provides a device screen for the developer so that you can see all the maemo application windows and visuals on your computer. It is not included in the SDK. You need to install it yourself into your host system.

Getting Xephyr

On debian based linux systems, you can install Xephyr by executing the following command outside scratchbox.

$ sudo apt-get install xserver-xephyr

Starting Xephyr

Xephyr requires command line parameters so that it can provide a real working window for the maemo environment. Start Xephyr outside scratchbox as follows:

Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac &

5. Starting/shutting down the maemo SDK environment

1. Make sure that Xephyr is running (as explained above) outside scratchbox environment.

2. Set the DISPLAY variable to match the display setting given for the Xephyr server (parameter :2 in the above example)

[sbox-FREMANTLE_X86: ~] > export DISPLAY=:2

3. Start the hildon application framework as follows:

[sbox-FREMANTLE_X86: ~] > start



4. Start hildon-home as follows:

[sbox-FREMANTLE_X86: ~] > hildon-home &

5. You can shut down the application framework as follows:

[sbox-FREMANTLE_X86: ~] > af-sb-init stop

6. Known issus in scratchbox

The following issues have been noted in the usage of scratchbox

1. VDSO support

Scratchbox does not work when VDSO support is enabled in the host's kernel. We're working on making it possible, but at the moment there are some workarounds, which are presented here.

If your host has VDSO turned on you will get an error like this when trying to login to Scratchbox.

No directory, logging in with HOME=/
Inconsistency detected by rtld.c: 1192: dl_main: Assertion `(void *)
ph->p_vaddr == _rtld_local._dl_sysinfo_dso' failed!

64 bit kernel version 2.6.25 or newer

64 bit Linux kernels starting from version 2.6.25 enable VDSO by default and do not offer a /proc filesystem option to turn it off. Notably Debian Lenny and Fedora9 are using such kernels. It has been reported that with a kernel boot parameter it is possible to disable VDSO .

The kernel boot parameter option has been verified to work on a 64 bit system. In short;

add vdso32=0 to your kernel boot parameters

Older kernel versions

The status of VDSO support can be verified from the /proc filesystem. Only values 0 and 2 are compatible with Scratchbox.

Depending on the kernel version the VDSO support can most likely be found in /proc/sys/kernel/vdso or /proc/sys/vm/vdso_enabled. You can disable it for the current session by echoing a 0 to the given location under the /proc filesystem as root.

For example on Ubuntu Intrepid:

   $ sudo sysctl vm.vdso_enabled=0

2. Qemu and mmap minimum address

The QEMU used by Scratchbox is not compatible with mmap_min_addr value higher than 4096. This feature is not enabled in all kernels and the default value may differ. You can check the value of the mmap_min_addr from the /proc filesystem. The location for this setting is /proc/sys/vm/mmap_min_addr. You can set a desired value for the current session by echoing it to the given location as root.

For Ubuntu Intrepid:

   $ sudo sysctl vm.mmap_min_addr=4097

3. Tip: /etc/sysctl.conf

You can set all of these permanently by adding the following lines to /etc/sysctl.conf . The vdso_enabled option is not available in latest 64 bit kernels.

   vm.vdso_enabled = 0
vm.mmap_min_addr = 4096

and running sysctl -p as root.

WARNING : You should try setting these values by echoing them to the given locations before adding them to sysctl.conf to see if they cause any problems. For example, in some Ubuntu Gutsy installations, it has been observed that changing the vdso settings will hang the system and thus making permanent changes in sysctl.conf may, in these cases, make your system unbootable.


7. Known issues in SDK

The following issues have been noted during the testing of the SDK:

1. In armel target, the hildon UI does not come up while starting the hildon application framework. This is mainly due drawbacks in the user mode qemu.It is being worked upon. It is neither recommended to run applications on this target because qemu-arm-cvs-m has no threading support.

2. hildon-home process is not started by default in the script. It needs to be manually started in the release as instructed in section 4. This program is needed if you intend to try out custom home applets.

3. Task switcher is not present. Hence you can run one application at a time from the UI. The final Maemo 5 will contain however the task switcher.

4. The SDK is not currently usable with only open components manily due to come open to closed dependencies. This makes installation of Nokia closed binaries crucial for the complete functionality of the SDK.

5. Unnecessary warnings and debugging messages are printed out when the hildon application framework is started.

6. On Debian Lenny, on scratchbox x86 target, the response time of actions on using the UI framework is noted to be high.