Sbox102Maemo

Running maemo SDK on Scratchbox 1.0.2

For simplicity, this tutorial installs from tarballs to /opt/scratchbox, and refers to the ARM target with qemu cpu transparency.

Install scratchbox

Download scratchbox 1.0.2 from: [WWW] http://www.scratchbox.org/download/scratchbox-1.0/

You need the atlest the following packages:

scratchbox-core
scratchbox-libs
scratchbox-devkit-debian

Next, you need to select the toolchains you want:

scratchbox-toolchain-arm-gcc3.4-glibc2.3  
  - for compiling kernel and if want a better optimizing compiled
scratchbox-toolchain-i686-gcc3.3-glibc2.3 
  - for running SDK in x86 env, faster, easier debugging and valgrinding
scratchbox-toolchain-arm-gcc3.3-glibc2.3
  - legacy toolchain. you need this if you want to compile c++ appliations instead of c apps 

Legacy toolchain was not ported to sbox 1.0.2 build system yet, so install the 1.0.1 version instead, if you need it: [WWW] http://www.scratchbox.org/download/files/sbox-releases/1.0-old/

If you use tarballs, you can extract them anywhere as root. In this case, scratchbox was extracted to /opt/scratchbox

Configure scratchbox

# /opt/scratchbox/run_me_first.sh
Do you want to use sudo mode? [yes/no] (no): no
Give the name of the scratchbox group (sbox):
No such group!
The group 'sbox' does not seem to exist!
Would you like me to create the group 'sbox' for you? [yes/no] (yes):
No such group!
Creating group "sbox"...

Stopping Scratchbox: umount, binfmt_misc.
Starting Scratchbox: binfmt_misc, mount.

Now you should add one or more users with /opt/scratchbox/sbin/sbox_adduser
# /opt/scratchbox/sbin/sbox_adduser myuser
Add user myuser to group 'sbox'? [yes/no] (yes):
Adding user `myuser' to group `sbox'...
Done.
Scratchbox user account for user myuser added
#

Create a symlink to start scratcbox automatically on boot and stop on shutdown. This is ""distribution specific"" setup.

# ln -s /opt/scratchbox/sbin/sbox_ctl /etc/rc2.d/S99sbox
# ln -s /opt/scratchbox/sbin/sbox_ctl /etc/rc0.d/K20sbox
# ln -s /opt/scratchbox/sbin/sbox_ctl /etc/rc6.d/K20sbox

Setup Scratchbox target

If you are currently logged in as myuser, relogin to join "sbox" group.

$ /opt/scratchbox/login

You dont have active target in scratchbox chroot.
Please create one by running "sb-menu" before continuing


Welcome to Scratchbox, the cross-compilation toolkit!

Use 'sb-menu' to change your compilation target.
See /scratchbox/doc/ for documentation.

sb-conf: No current target
[sbox-: ~] >        

Use sb-menu to setup ARM target

  1. Name the target ARM

  2. Select arm-gcc-3.3-glibc-2.3 compiler

  3. Select debian and perl devkits

  4. Select qemu-arm cpu transparency

  5. no to all other questions but selecting target.

  6. exit sb-menu

[sbox-ARM: ~] >

install maemo SDK

Download and extract SDK rootstrap

[sbox-ARM: ~] > wget http://repository.maemo.org/unstable/1.1rc5/arm/Maemo_Dev_Platform_RS_v1.1rc5_arm.tgz
[sbox-ARM: ~] > sb-reinstall Maemo_Dev_Platform_RS_v1.1rc5_arm.tgz

Done!

Now: compile a hello world c program and try to run it to see test that everything is set up correctly

#include <stdio.h>
main(){printf("Hello maemo!\n");}
[sbox-ARM: ~] > gcc -o hello hello.c
[sbox-ARM: ~] > file hello
arm elf ...
[sbox-ARM: ~] > ./hello
hello maemo!
[sbox-ARM: ~] >

Start maemo

start an X-server in 16-bit mode, *outside scratchbox*

$ Xephyr :1 -screen 800x480x16 -dpi 96 -ac & 

Start Maemo desktop:

export DISPLAY=:1
af-sb-init.sh start

Maemo desktop should appear in your sbox.

To run your own apps in the correct env,

run-standalone.sh /path/to/your/app

That's all that is different from sbox 98!

TODO: Xephyr devkit.. Xoo would be nice too, but depends on practically everything...

last edited 2007-04-09 20:45:50 by ToniTimonen