Gentoo Wiki


This article is still a Stub. You can help Gentoo-Wiki by expanding it.



This howto attempts to build Maemo for the Nokia 770, using the SDK.

Once you have Scratchbox installed on your Gentoo host, you should take a look at the already written Installation Documents which are more thorough than this HowTo..

kernel compatibility

enable VDSO in your kernel .config.

Linux Kernel Configuration: Processor type and features
   [*] Compat VDSO support

If you made this change to your kernel, it is now time to recompile, and reboot.

If you boot a kernel without VDSO support and attempt to login to the Scratchbox environment you will recieve the following error.

Inconsistency detected by rtld.c: 1192: dl_main: Assertion `(void *) ph->p_vaddr == _rtld_local._dl_sysinfo_dso' failed!
Inconsistency detected by rtld.c: 1192: dl_main: Assertion `(void *) ph->p_vaddr == _rtld_local._dl_sysinfo_dso' failed!
Inconsistency detected by rtld.c: 1192: dl_main: Assertion `(void *) ph->p_vaddr == _rtld_local._dl_sysinfo_dso' failed!

emerging scratchbox

add sunrise overlay

# Use layman to add the Project Sunrise overlay.
sudo layman -a sunrise

prepare package.keywords

you will need to add a few lines to your package.keywords.

File: /etc/portage/package.keywords

prepare package.use

File: /etc/portage/package.use
sys-devel/scratchbox-toolchain-cs2005q3_2-glibc         arm i386


sudo emerge -tav scratchbox scratchbox-devkit-debian scratchbox-devkit-perl scratchbox-devkit-cputransp scratchbox-devkit-doctools scratchbox-toolchain-cs2005q3_2-glibc 

Scratchbox permissions

Per the ebuild you will need to exec the following emerge command.

emerge --config =sys-devel/scratchbox-1.0.7

Xephyr support

Rebuild your xorg-server with the kdrive USE flag and then restart xorg.

testing Xephyr

Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac &
export DISPLAY=localhost:2


You will need to download the appropriate SDK files from the repository.


maemo 2.2 'gregale' for Nokia 770 development

Copy over the Maemo Dev Platform rootstraps, and rootfs sudo cp Maemo_Dev_Platform_* /opt/scratchbox/packages/

Check Scratchbox configuration

This step is Optional, but good to know about if something breaks. su to root, and run /opt/scratchbox/ example output.

This script has already been run (/opt/scratchbox/.run_me_first_done exists)

Would you like to continue anyway? [yes/no] (no): yes
Do you want to use sudo mode? [yes/no] (no): no
Give the name of the scratchbox group (sbox): 
Stopping Scratchbox: umount, binfmt_misc.
Starting Scratchbox: binfmt_misc, mount.

Starting/Stopping Scratchbox environment

The Scratchbox emerge should have installed /etc/init.d/scratchbox Please use rc-update to dictate how the Scratchbox Environment is controlled.

Manually Controlling Scratchbox Environment sudo /opt/scratchbox/sbin/sbox_ctl start

sudo /opt/scratchbox/sbin/sbox_ctl stop

OPTIONAL: Start/Stop the environment on boot.

sudo su
echo "/opt/scratchbox/sbox_ctl start">> /etc/conf.d/local.start
echo "/opt/scratchbox/sbox_ctl stop">> /etc/conf.d/local.stop

Create a Scratchbox user

You will need to be sure the user account you create already has an account on your system. /opt/scratchbox/sbin/sbox_adduser user

Login to Scratchbox


creating your target scratchbox

Follow the Scratchbox installation instructions on how to use sb-menu and HowTo create a cross-compilation target for ARM and i386 When prompted use the fill-in-the-blank-rootstrap. Maemo_Dev_Platform_v2.2_i386-rootstrap.tgz

Fetch the generate virtuals script into your /opt/scratchbox/packages and rename it to and then sudo chmod +x /opt/scratchbox/packages/

You will also want to download the Debian equivs package to the /packages directory.

Login to your scratchbox using /opt/scratchbox/login and perform;

# manually install the equivs Debian package
fakeroot dpkg --ignore-depends=perl \
--ignore-depends=debhelper --ignore-depends=make \
--ignore-depends=dpkg-dev --ignore-depends=devscripts \
-i /scratchbox/packages/equivs_2.0.7_all.deb

# this script will take a few minutes to complete it's operation.
# install the created Debian packages.
fakeroot dpkg -i tmp/*.deb 

apt-get update

apt-get -f upgrade

testing your Scratchbox target

Test Scratchbox

starting Maemo system

For this to work, you will need to start Xephyr as shown above.

export DISPLAY=localhost:2 start

screenshot of Xephyr and Maemo

links and reference

Retrieved from ""

Last modified: Mon, 08 Sep 2008 07:19:00 +0000 Hits: 4,456