This writeup has been updated for the Scratchbox version to be used
Mistral. It is very similar to the old one but a few
items are a little different.
First let's define some terms.
To summarize the official statement, Maemo is a suite of development tools and a pre-standardized user interface for producing software to run on the Nokia 770 and other handheld devices with decent displays.
In Linux terminology, a
(distribution) is a coherent collection of software packages including a Linux
kernel, and particularly including a package manager and a means to obtain
updated packages from the distro's home. I haven't been able to detect an
official name for the distro that's on the Nokia 770. However, it is similar
to Debian, including in Maemo 2.0 the complete Debian package manager.
As officially defined,
Maemo is not a distro, but in fact Maemo.org is acting as the host site, and
everybody is sure to say,
Maemo is the distro used on the Nokia 770.
Hildon is referred to as an
Framework. It is a set of standards for how applications should appear
to the user, and a suite of infrastructure to make this look-and-feel happen,
specifically a window manager, a status bar, a task switcher, a background (home) screen,
a control panel, and libraries to support all of this. In particular,
the Hildon User Interface is implemented as a modified GTK+ (Gnome Tool Kit)
library, binary compatible with standard GTK+. Hildon is the same kind of
object as Gnome or KDE.
Scratchbox is a cross-compilation tookit. Here is their home site. While it is particularly used by Maemo, and while the home site appears to be hosted or sponsored by Nokia, Scratchbox is not Nokia-specific and works with Familiar and Compaq IPaq. The host system is an Intel (i386) Linux box. Scratchbox includes compilers and libraries, and an ARM emulator. You use it to compile software and build packages that can run on the Nokia 770 and that can become part of the Maemo distro.
Some quick links:
The Maemo site has an extensive tutorial for Maemo, Hildon and Scratchbox, which has been updated for Maemo-2.0. Some people have complained that it's too extensive. In truth, if you're going to port GTK or KDE apps for Maemo you need to know all that stuff, but there are some areas where it's not 100% clear, and so I've summarized a few items here about the basic installation and build process.
The tutorial mentions Debian or Ubuntu as host distros. I'm running it on
SuSE 10.1 and have no problems. SuSE uses RPM as its package manager, and I
wanted to install Scratchbox as a proper package. The
apt package was
useless; it's for using the Debian apt-get syntax but to really install from a
mirror of the SuSE RPMs. I tried
alien --to-rpm to convert the Debian
packages to RPM. However, there were unmet dependencies (probably package
names different from SuSE) and the pre/post install scripts were converted
incorrectly so the "run_me_first.sh" script didn't get installed, nor was any
proper setup done. Useless. I reverted to installing from tarballs.
Scratchbox is a pig. The tutorial says to allow 2 GB for it. My installed size with only the ARM target and very little package clutter, is 2.8 GB. Make sure you pick a spot for it where there's enough space. You may create a symbolic link /scratchbox that points to a directory in a larger filesystem.
The tutorial's installation section
lists a number of source files to be downloaded. Both Maemo-1.1 and Maemo-2.0 have an
at the linked URL (change 2.0 to 1.1 to get the old one). This script, under
installer.html, is a Bourne shell script with a mime-encoded
executable program. It will download all the files and set
everything up for you. I downloaded and un-tarred all the files by hand; if you
use the installer, keep track of which steps it's doing for you, and don't
do them again. The following list shows the needed files in dependency order.
You need to keep in mind what phase each instruction goes with, because different levels and frequencies are commingled in the tutorial.
Installation, only needs to be done once (as root). Run the installation
script, or download and un-tar the Scratchbox tarballs yourself.
(Download the i386 and ARM rootstrap packages but don't un-tar yet -- move
them into /scratchbox/packages where a later step can find them.)
Configure Scratchbox (following the tutorial's summary). This includes creating your home directory
within /scratchbox. The homedir is /scratchbox/users/$USER/home/$USER, and
/scratchbox/users/$USER is the
root that you chroot into.
Startup, makes a bind mount to bring the tools into the chroot area. This needs to be done (as root) once per reboot of the host system. If you can't compile anything, you may have forgotten this step. If you're seriously into development on Scratchbox you may want to create a boot-time startup script for this. The command is /scratchbox/sbin/sbox_ctl start
Login as yourself (ordinary user), which (basically) does chroot to your home area. You'll probably want to do this in a separate xterm since you'll need to do things on the host also. The command is /scratchbox/login (no need to give your loginID).
Once after installation you need to create your rootstrap target(s)
and stuff it with the rootstrap package (large). SDK_PC is for
debugging software without dealing with ARM emulation; SDK_ARM is for
building (and/or testing) the software on the simulated actual ARM
processor. To create the target: sbox-config -ct SDK_ARM (or SDK_PC).
You need to answer these questions. For the
you give a number from a list; you want the
package, not the host compiler, and I've shown the corresponding
numbers in the list shown to me, but follow your list, not blindly
entering these numbers.
|Compiler||0||2 (don't use host)|
You need to pick one or the other target (ARM or i386). Once you do this, the selection persists until changed. The commands would be
Once after installation you have some configuration to do for each target. Select it first with one of the commands above.
Now, download your source code (for this demo I'm doing NTP) and
copy it to your scratchbox homedir: cp /tmp/ntp-4.2.0.tar.gz /scratchbox/users/jimc/home/jimc/ Do all your normal procedures to build the package -- see the
tutorial for lots of good info about porting. You're running on a simulated
ARM processor, emulated by qemu-arm. If you do
uname -m it will say
arm rather than
i686. Here's a sample procedure:
the program is Debian native so don't generate .orig, which sounds important. -s means there is only one binary file in this package (-m for multiple). -e gives the e-mail address of the
maintainer, which I assume means the maintainer of the package file, not of the software itself.
Descriptionline, and following that, a long one where each line starts with whitespace (1 blank is OK). For Maemo-1.1 the instructions were to make the package depend on
maemo; for Maemo-2.0 identify the library and other packages that yours actually depends on (basenames, without version) and list them here. If you're given a documentation stanza and you don't have or aren't going to include a documentation package, remove the stanza.
extended crontabfile to be dropped into /etc/cron.d. SNTP is typically run from cron, but the servers have to be listed on the command line, so I'm not going to provide a default cron entry. Toss this file.
cdto the package directory, then dpkg-buildpackage -rfakeroot
suwhich doesn't really
Here are some problems I encountered when working on NTP, as a guide to what might happen when you Maemo-ize other packages.
make distcleanfirst, but one of the directory makefiles lacked a distclean target. (sntp)
make install, but another of the directory makefiles lacked an install target. (util) It's installing into a subdirectory of debian, from which it will create the compressed tar or cpio component of the .deb file.
So how did SNTP come out? The program runs and displays the time offset, but run as root and given the -r or -a switches it doesn't actually change the time. So this project was not a stunning success, and I'm not going to debug the code. I suspect that my build procedure was not to blame; I'll bet there's something wacko with time management on ARM that SNTP (and I) don't know about.
On the other hand, ntpdate will change the system time; however, it requires /usr/lib/libelf.so (and its referent) which is present in Scratchbox but is not installed by default on the ITB, so I copied the libelf from scratchbox (this is really cowboy programming) and it lets ntpdate execute. (That was on Maemo-1.1; libelf.so.0 is present on Maemo-2.0.) I never finished making the full NTP into a package [on Maemo-1.1]; I just copied over that one executable. On Maemo-2.0 I did succeed in making the packages; ntpdate sets the time, but the NTP daemon just exits with no useful diagnostics even with debug turned on.
I've gotten so tired of using
more, and rather than just copying
less off scratchbox, I decided to make up a proper package for
So how did this one go? I whipped together the control files, copyright
notice, etc, and built the package, in less than 20 minutes.
Again there was no distclean target (error was ignored). It
did configure the package. [On Maemo-1.1] it produced the .deb file,
but when doing
dh_clean -k -i (possibly to build the nonexistent
architecture-independent portion), dh_clean complained
I have no package
to build, which was no lie, and the procedure finished with an
error, not having deposited the various Debian admin files (which I'm not
going to use anyway). It works on the ITB!
So now I have a decent pager. The build process was clean on Maemo-2.0.
Start at the Maemo.Org Cross Referencer, which is for navigating and displaying the Hildon and (some?) Osso sources.
This release notes document is for the original (1.0) Maemo release. It has a list of included packages, and it suggests that you use apt-get to get the binary and source packages (into Scratchbox). Version numbers are of course out of date, but likely you can make something happen on v1.1 also.