[maemo-developers] New developer - lots of questions

From: Graham Cobb g+770 at cobb.uk.net
Date: Sat Nov 17 00:39:03 EET 2007
On Friday 16 November 2007 19:49:57 Igor Stoppa wrote:
> If disk space is not an issue for you, maybe you can do like me and use
> a chrooted environment for each sdk (i use it because I have a full
> 64bit system, but scratchbox is only 32 bit). I prefer this solution
> since it makes it quite easy to experiment: install your chrooted
> system, make a copy of it and feel free to trash it after experimenting.

I am investigating doing this to move away from my current user-mode-linux 
setup.  The big disadvantage is that it has to run as root but, in my case, 
the increased speed from being able to run it on my 64-bit system may make it 

> The gotcha is that I have to do all the bindmounting that scratchbox
> would do from the outside. Apparently doing a double bindmount from
> chroot to sbox of a /dev or /proc directory doesn't work and at the
> second step you end up with an empty directory.

It works for me!  What I do is to mount proc from outside and then run the 
scratchbox startup from inside.  Here is my shell script which does the work 
(ignore the stuff about the "v" directory and qemu-build -- that is for my 
build system).  Kmail has messed up the formatting but I think you will get 
the idea...

# Build maemo packages using chroot
# Has to be run as root.  But the work is done in the chroot using qemu-build


# mount proc
[ -d $prefix/home/dbtest/proc/1 ] || \
 mount proc -t proc $prefix/home/dbtest/proc
# create scratchbox v directory
[ -d $prefix/home/dbtest/scratchbox/users/scratchbox/home/scratchbox/v ] || \
 mkdir $prefix/home/dbtest/scratchbox/users/scratchbox/home/scratchbox/v
# bind mount scratchbox v directory
[ -f 
$prefix/home/dbtest/scratchbox/users/scratchbox/home/scratchbox/v/qemu-build ] || 
 mount -o bind $prefix/home/scratchbox-apophis/users/cobb/home/cobb \

# Start scratchbox
chroot $prefix/home/dbtest/ /scratchbox/sbin/sbox_ctl start

# Run build
chroot $prefix/home/dbtest/ su - scratchbox -c "scratchbox v/qemu-build $*"

# Stop scratchbox
chroot $prefix/home/dbtest/ /scratchbox/sbin/sbox_ctl stop

More information about the maemo-developers mailing list