How to install scratchbox for Nokia 770 2007 Hacker Edition (HE)

July 2011

How to Install Scratchbox Development Environment for Nokia 770 2007 Hacker Edition (2007 HE)

The 2007 Hacker Edition uses Maemo 3.1 Bora (see Wiki Hacker Edition)

These direction are a modification of http://tablets-dev.nokia.com/3.1/INSTALL.txt . Since some of the install scripts no longer work do to a relocation of file repositories, these modifications will provide the manual download locations.

Step 1 – Install Scratchbox apophis r4

Download the following deb files:

scratchbox-core 1.0.7
scratchbox-libs 1.0.7http://tablets-dev.nokia.com/3.1/INSTALL.txt
scratchbox-devkit-cputransp 1.0.2
scratchbox-devkit-debian 1.0.8
scratchbox-devkit-doctools 1.0.6
scratchbox-devkit-perl 1.0.4
scratchbox-devkit-maemo3 1.0
scratchbox-toolchain-cs2005q3.2-glibc-arm 1.0.5
scratchbox-toolchain-cs2005q3.2-glibc-i386 1.0.
From scratchbox.org repository at:
http://scratchbox.org/download/files/sbox-releases/branches/apophis/r4/deb/
and place these files in /tmp directory (this is where install script will look for them)

(Note: these install files are for a debian system – for tarball install use: http://scratchbox.org/download/files/sbox-releases/branches/apophis/r4/tarball/)

Download the Install Script maemo-scratchbox-install_3.1.sh from:http:
http://repository.maemo.org/stable/3.1/
and place this file in root /

Then execute the following commands:

sudo chmod a+x /maemo-scratchbox-install_3.1.sh

sudo /maemo-scratchbox-install_3.1.sh -c -d -u <username>

(Note: this is for debian system for tarball move the tarball files to /tmp and execute: sudo /maemo-scratchbox-install_3.1.sh -c -s /scratchbox -u <username>)

where <username> is your linux username

Create a file called start.sh with the following lines in it:

#!/bin/sh -e
echo 0 > /proc/sys/vm/vdso_enabled
echo 4096 > /proc/sys/vm/mmap_min_addr
/scratchbox/sbin/sbox_ctl start

and place this file in /scratchbox
then execute: sudo chmod 755 /scratchbox/start.sh

At this point you will need to reboot your computer:

After rebooting, test your install by doing the following:

sudo /scratchbox/start.sh
/scratchbox/login

Your should get a scratchbox prompt (Note to login, you must not be root)

Type exit to exit scratchbox and proceed to step 2

Step 2 – Install rootstrap and nokia binaries

You will need an internet connection.

If you did not start scratchbox from Step 1 – start it now

Then download the rootstraps: maemo-sdk-rootstrap_3.1_armel.tgz
from: http://repository.maemo.org/stable/3.1/armel/
and: maemo-sdk-rootstrap_3.1_i386.tgz
from: http://repository.maemo.org/stable/3.1/i386/

each of these is about 100Mb

Place these two rootstrap files in: /scratchbox/users/<username>/home/<username>
where <username> is the same as you provided in the scratchbox installation

Download maemo-sdk-install_3.1.sh
from: http://repository.maemo.org/stable/3.1/
Place this file in root / and perform the following:

sudo chmod a+x /maemo-sdk-install_3.1.sh
/maemo-sdk-install_3.1.sh -c (Not as root)

The nokia license will appear after a short time. You will need to scroll through it and accept it.

Note the networking inside scratchbox does not work yet.
You will need to do a few more steps.

Perform the following:

sudo cp /etc/resolv.conf /scratchbox/etc/resolv.conf

and as root:

echo “hosts: files dns” > /scratchbox/etc/nsswitch.conf

This will set up networking inside scratchbox

Login in to scratchbox: /scratchbox/login

Perform the following:

[sbox-SDK_X86: ~] > apt-get update

[sbox-SDK_X86: ~] > fakeroot apt-get install maemo-explicit

[sbox-SDK_X86: ~] > fakeroot apt-get -f install

[sbox-SDK_X86: ~] > sb-conf select SDK_ARMEL

[sbox-SDK_ARMEL: ~] >apt-get update

[sbox-SDK_ARMEL: ~] > fakeroot apt-get install maemo-explicit

[sbox-SDK_ARMEL: ~] > fakeroot apt-get -f install

[sbox-SDK_ARMEL: ~] sb-conf select SDK_X86

Step 3 – Install Xephyr

On Debian based systems you can install xephyr with the following outside of scratchbox.

sudo apt-get install xserver-xephyr

otherwise you will need to get files from:
http://packages.debian.org/unstable/x11/xserver-xephyr

Create a file called start-xephyr.sh with the following lines in it:

#!/bin/sh -e
Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac &

and place this file in /scratchbox
then execute: sudo chmod 755 /scratchbox/start-xephyr.sh

Then start xephyr with: /scratchbox/start-xephyr.sh

Login to scratchbox and execute the following:
(Note only SDK_X86 works with xephyr)

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

If the Xephyr window closes,
you may need to run /scratchbox/start-xephyr.sh again

To close xephyr execute the following inside of scratchbox:

[ sbox-SDK_X86: ~] > af-sb-init.sh stop

Step 4 – Install osso-xterm

With Xephyr closed execute the following inside scratchbox:

[sbox-SDK_X86: ~] > apt-get install osso-xterm

All of the packages can be found at:
http://repository.maemo.org/pool/bora/
For example the osso-xterm package of i386 is at:
http://repository.maemo.org/pool/bora/free/binary/

Start Xephyr again and you will see osso-xterm in the extras menu

IMPORTANT – TO UNINSTALL SCRATCHBOX

Execute the following:

sudo /scratchbox/sbin/sbox_umount_all

then check the mounts to see that no scratchbox components are mounted

use the command: mount

If no scratchbox components are mounted then you can remove scratchbox with:

sudo -r /scratchbox

(Failure to unmount scratchbox could cause damage to you system)

Advertisements

Leave a comment