Scratchbox2 with Ubuntu Oneiric and Linaro tools

Officially scratchbox2 is not on linaro roadmap, but it is possible to use nevertheless.

Setup

In a oneiric system or chroot, install needed tools

apt-get install --no-install-recommends scratchbox2 build-essential g++-arm-linux-gnueabi wget qemu-user debootstrap

Prepare and oneiric armel target:

debootstrap --arch=armel --variant=buildd --foreign oneiric ubuntu-oneiric
mkdir -p  ubuntu-oneiric/var/run
cd ubuntu-oneiric; sb2-init -c /usr/bin/qemu-arm ARM arm-linux-gnueabi-gcc

Where you run sb2-init is important That directory becomes the sb2 target directory.

Test

Create a standard hello world application and:

$ sb2
[SB2 simple ARM] $ gcc -o hello ./hello.c
[SB2 simple ARM] $ file hello
hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
[SB2 simple ARM] $ ./hello 
hello, world
[SB2 simple ARM] $ 

Notes

  • second stage of debootstrap would fail in sb2, so target managment with dpkg/apt needs hackery
  • The mkdir -p is needed as unless you want to bindmount /run. Otoh sb2 should deal with it possibly missing
  • qemu-arm needed the full path while help didn't specify so.

RikuVoipio/Scratchbox2 (last modified 2011-07-11 10:06:36)