This article takes Maemo2.2 and Ubuntu6.10 for example. However, what we need to install another edition of Maemo platform is just to change the rootstrap gived below. As for Ubuntu, I think those above 6.06 will be allright.
1. All packages we need:
-
scratchbox-core-1.0.7-i386.tar.gz
-
scratchbox-devkit-debian-1.0.7-i386.tar.gz
-
scratchbox-libs-1.0.7-i386.tar.gz
-
scratchbox-toolchain-cs2005q3.2-glibc-arm-1.0.5-i386.tar.gz
-
scratchbox-toolchain-cs2005q3.2-glibc-i386-1.0.5-i386.tar.gz
Download them from http://www.scratchbox.org/download/files/sbox-releases/apophis/tarball/
-
Maemo_Dev_Platform_v2.2_i386-rootstrap.tgz
Download it from http://repository.maemo.org/stable/gregale/i386/
Note: File copy may brake files!?
If you copied these files from other computers, check them by double click before installation. Download them YOURSELF if any is broken.
2. Extract tar files (for each package) to the / directory by running:
- # tar zxf scratchbox-core-1.0.7-i386.tar.gz -C /
- # tar zxf scratchbox-devkit-debian-1.0.7-i386.tar.gz -C /
- # tar zxf scratchbox-libs-1.0.7-i386.tar.gz -C /
- # tar zxf scratchbox-toolchain-cs2005q3.2-glibc-arm-1.0.5-i386.tar.gz -C /
- # tar zxf scratchbox-toolchain-cs2005q3.2-glibc-i386-1.0.5-i386.tar.gz -C /
Note: Use "zxvf" instead of "zxf" to see the process of installation if you want.
3. Run:
- # /scratchbox/run_me_first.sh
Normally an error apears now. Follow the given tip, and copy the command("echo ..."). Then you can run it again without any errors:
Follow the questions next in order to create sbox user group and setup scratchbox (default answers will be all right).
Do you want to use sudo mode? [yes/no] (no): no
Give the name of the scratchbox group (sbox): sbox
The group 'sbox' does not seem to exist!
Would you like me to create the group 'sbox' for you? [yes/no] (yes): yes
Creating group "sbox"...
Stopping Scratchbox: umount, binfmt_misc.
Starting Scratchbox: binfmt_misc, mount.
Now you should add one or more users with /scratchbox/sbin/sbox_adduser
4. Add users to scratchbox with command: (For 'username', use your Linux user login name.)
- # /scratchbox/sbin/sbox_adduser <username></username>
This adds the user to 'sbox' user group, creates the Scratchbox user directory under /scratcbox/users directory and mounts several directories (/dev, /proc, /tmp) under user/ directory.
For example:
- root@cloud# /scratchbox/sbin/sbox_adduser cloud
- Add user Huichun to group 'sbox'? [yes/no] (yes): yes
Scratchbox user account for user cloud added
5. Reboot computer.
6. Check if my name has been added successfully:
- cloud@cloud ~$ groups
- cloud ... sbox
7. Start sbox:
- # /scratchbox/sbin/sbox_ctl start
(Error may apear again. Copy and run the "echo.." command given following the error. See step 3.)
8. User login. Run:
- cloud@cloud ~$ /scratchbox/login
You may see:
You dont have active target in scratchbox chroot.
Please create one by running "sb-menu" before continuingWelcome 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-: ~] >
9. Run:
- [sbox-: ~] > sb-menu
10. Configuration.
1) Setup a target.
You can input "SDK_PC" as its name like the tutorial.
Select the second type (...i386). -> Done -> None
2) Before choosing "Yes":
(1) Make sure you have Maemo_Dev_Platform_v2.2_i386-rootstrap.tgz.
(in /home/cloud/ for example)
(2) Run: (Start another terminal, and swich to root user)
# mv /home/cloud/Maemo_Dev_Platform_v2.2_i386-rootstrap.tgz /scratchbox/packages/
3) Choose "Yes", then copy the file name into the blank after the path. Push Enter.
4) Choose "No" when to install files.
5) Active taget. You will see "[sbox-SDK_PC: ~] >" now, if everything is correct.
Note: Use command # mv in 2), not # cp, which may brake the file!
11. Run:
- [sbox-SDK_PC: ~] > vi .bash_profile
Copy these in:
export LANGUAGE=en_GB
export PAGER=less
The settings are necessary to be able to use the man command inside scratchbox and for the localisation to work properly.
12. Make a new file named start-xephyr.sh in /home/cloud/ (home folder).
Copy these in:
#!/bin/sh -e
prefix=/scratchbox/users/${LOGNAME}/targets/SDK_PC/usr
export LD_LIBRARY_PATH=${prefix}/lib; export LD_LIBRARY_PATH
exec ${prefix}/bin/Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac
Note: Do not make the new file under root user! (Anyway Ubuntu does not allow root user to login in screen mode.)
13. Run this to make start-xephyr.sh executable:
- # chmod +x start-xephyr.sh
14. Run this to start the backgroud, which is white..though not in the tutorial...
- $ ./start-xephyr.sh &
15. Finally, run them to start the emulator:
- [sbox-SDK_PC: ~] > export DISPLAY=:2
- [sbox-SDK_PC: ~] > af-sb-init.sh start
To stop it, run:
- [sbox-SDK_PC: ~] > af-sb-init.sh stop
See more at http://maemo.org/development/documentation/tutorials/Maemo_2.2_Tutorial.html