Howto Installing Maemo SDK 4

Da PtLUG.

Indice

Introduction

Maemo is an opensource development platform for Linux based devices. Actually is the base for the operating system installed on Nokia N770, N800 and the upcoming N810 but it could be adopted, with few changes, even by other similar devices.

In particular, this version of Maemo SDK is the only one that allow developers to develop new applications for N810 and to start porting old application to this new platform.

The SDK is not only a set of libraries and compiler, it gives you a real environment that emulates the Nokia device, so the developer can write applications, debug them and test them. Both command line and gui application are supported in emulator.

Graphical environment is based on a real X server, a window manager and on GTK libraries, with a particular extension called Hildon.

With Maemo SDK you can:

  • Test Maemo applications using a normal PC with Linux.
  • Write and debug applications written by you.
  • Port existing applications written for Linux/GTK and verify if they work correctly.
  • Compile and build ARMEL package so you can install them in the device.

Requirements

These are the minimum requirements to work with Maemo SDK:

  • Intel compatible processor (x86), at least 500 Mhz
  • 256 Mb RAM
  • 2 Gb space on hard disk
  • A Linux distribution (I suggest Debian or Ubuntu)

You need the following software packages:

Starting from 4.x version, Maemo has a simple installer script, so all you need are these two files:

Installing Scratchbox

The first tool you have to install is Scratchbox. I suggest you to use the script provided but you could choose also to install it manually (in this case please refer to [this site] for detailed instructions).

Before beginning the installation of Scratchbox, you have to become root.

First of all set the permission of the script file:

chmod a+x ./maemo-scratchbox-install_4.0.1.sh

Then run it with these parameters:

./maemo-scratchbox-install_4.0.1.sh

Scratchbox environment will be installed in /scratchbox/

Once Scratchbox is installed, you have to add a user to the environment, in this way:

/scratchbox/sbin/sbox_adduser USER yes

where USER is your Linux username.

Please note that you'll have to logout and login again to be able to log into you new Scratchbox environment. To test it you simply have to start Scratchbox from your local user:

andy80@noteboontu:~/download/maemo_4.0.1$ /scratchbox/login

NOTE: on Ubuntu installation, you have to disable VDSO to make Scratchbox work fine, or you'll get errors like this:

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

you can fix that executing this command from root user:

echo 0 | sudo tee /proc/sys/vm/vdso_enabled

Another problem you could have is related to mmap under Ubuntu Hardy, you can fix with this command:

echo 4096 | sudo tee /proc/sys/vm/mmap_min_addr

To make all these changes permanent after each reboot, you can edit /etc/sysctl.conf and add these lines:

vm.vdso_enabled = 0
vm.mmap_min_addr = 4096

then apply it in this way:

sysctl -p

Installing Maemo SDK

When Scratchbox is correctly installed on your system, you can install the Maemo SDK. Please note that you have to do it from normal user (the user you specified in the installation of Scratchbox).

Simply run this command and follow instructions:

bash maemo-sdk-install_4.0.1.sh

When you're prompted for installation type, I suggest you Runtime Environment + All Dev Packages

At the end you should get this message:

Installation was successful!
----------------------------

IMPORTANT! Please read this. 

You now have the maemo 4.0.1 chinook installed on your computer.
You can now start your maemo SDK session with /scratchbox/login and
then select your target with 'sb-conf select CHINOOK_ARMEL' for the
armel target or 'sb-conf select CHINOOK_X86' for the i386 target.

If you have any problems with targets' package databases, you can try
running 'fakeroot apt-get -f install' on your scratchbox target.
This command will try to fix any problems with the package database. 


Nokia EUSA binaries
-------------------

The package maemo-explicit is a metapackage of Nokia EUSA licensed
binaries which can be installed to scratchbox targets. It is highly
recommended to install this package on both targets to ensure a fully
working system.

If you want to install these, login to scratchbox (see commands above)
and run the command 'fakeroot apt-get install maemo-explicit' for both
armel (CHINOOK_ARMEL) and i386 (CHINOOK_X86) targets.

Happy hacking!

Installing Xephyr

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.

To install it in a Debian based distribution, simply execute this (from root):

apt-get install xserver-xephyr

Running Xephyr

To see if all works fine, you should start Xephyr and Maemo environment. Execute this from outside the Scratchbox environment:

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

Now, from another shell, log into Scratchbox and execute this:

[sbox-SDK_CHINOOK_X86:~] > export DISPLAY=:2
[sbox-SDK_CHINOOK_X86:~] > af-sb-init.sh start

This should start the Hildon Application Framework inside the Xephyr window. That's all!

References

Here you can find a list of website where I took information from to write this guide:

Author

This guide has been written by Andrea Grandi.