Downloading Scratchbox
Using apt, dpkg (Debian based systems)
For the latest stable release of Scratchbox, do (as root)
$ echo "deb http://scratchbox.org/debian/ stable main" >> /etc/apt/sources.list
If you're developing for maemo environment (bora), do (as root)
$ echo "deb http://scratchbox.org/debian/ maemo3-sdk main" >> /etc/apt/sources.list
There are other repositories as well, such as
- legacy
- apophis
- apophis-r4
- apophis-r3
If you want to stick with a particular release, accept only packages (and their updates) in that release, use that release name (for example, apophis-r4). If you want the latest release of an individual branch, use the branch name (for example, apophis).
After you've selected the distribution you want, do
$ apt-get update $ apt-get install <package-name-1> <package-name-2> ... <package-name-N>
You'll need at least
- scratchbox-core
- scratchbox-libs
- scratchbox-devkit-cputransp (CPU transparency methods)
And a toolchain to suit your target
- scratchbox-toolchain-the-toolchain-of-your-choice
- scratchbox-toolchain-host-gcc (for developing Scratchbox itself)
And additional host tools, such as tools for debian based systems
- scratchbox-devkit-debian
- scratchbox-devkit-doctools (tools for building documentation)
- scratchbox-devkit-maemo3 (maemo3 debian environment and additional tools)
- scratchbox-devkit-perl (additional perl modules)
These instructions may work for:
These instructions may not work for: Ubuntu 6.10, Ubuntu 7.10
Downloading Binaries for Other Systems
Select the packages you need based on the description in the previous section, and download the tarballs from download pages, such as the one at http://www.scratchbox.org/download/files/sbox-releases/apophis/tarball/ .
When you've finished downloading, do the following (for each package as root)
$ cd / $ tar zxf <tarball-name>
This puts everything into a /scratchbox directory in your root volume. If your root does not have enough space or you want to run concurrent Scratchbox installations (to have different targets open at the same time), you can install the current stable branch of Scratchbox also to another directory than /scratchbox. Change the / in the previous command line to a prefix of your choice. For legacy versions, you can create a symlink /scratchbox and have that point to your preferred install location.
If you want to change the name of the Scratchbox directory itself, make sure you've extracted all the packages before changing the name.
These instructions may work for: Ubuntu 6.10, Ubuntu 7.10
These instructions may not work for:
Installing and Configuring Scratchbox
After extraction configure Scratchbox with the following commands (as root):
$ sudo sh # /scratchbox/run_me_first.sh Do you want to use sudo mode? [yes/no] (no): Give the name of the scratchbox group (sbox): The group 'sbox' does not seem to exist! Would you like me to create the group 'sbox' for you? [yes/no] (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 # # /scratchbox/sbin/sbox_adduser <you> Add user <you> to group 'sbox'? [yes/no] (yes): Adding user `<you>' to group `sbox'... Done. Scratchbox user account for user <you> added # # exit $ groups <you> adm dialout cdrom floppy audio dip video plugdev lpadmin scanner admin $
Note that if you doe not see the sbox group in the groups list above, one will not be able to execute the login script. You may have to do something to refresh the list of groups visible to your account, such as log in and log out, or reboot your host. YMMV.
After the installation is completed and the sbox group is listed, you can login to Scratchbox with your Scratchbox user account simply issuing (as a normal user)
$ /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-: ~] >
Troubleshooting
Scratchbox is not properly set up!
$ /scratchbox/login ERROR: Scratchbox is not properly set up!
Arg! For some reason you may have to do the following, whereupon the login will (hopefully) work.
$ /scratchbox/login ERROR: Scratchbox is not properly set up! $ $ sudo /scratchbox/sbin/sbox_ctl start Password: Starting Scratchbox: binfmt_misc, mount. $ $ /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-: ~] > exit logout sbrsh-conf: No current target $
VDSO problem
Assertion `(void *) ph->p_vaddr == _rtld_local._dl_sysinfo_dso' failed!
or
Host kernel has vdso support (which is uncompatible with SB) You can fix this with either: echo 0 > /proc/sys/vm/vdso_enabled or add 'vdso=0' to the kernel parameters
both indicate that VDSO is enabled when it should not be.
See DisablingVdso for more information. In particular, note that the instructions given in the error message above will not work for 64-bit kernels: for 64-bit kernels it is necessary to add 'vdso32=0' to the kernel parameters.