[maemo-developers] New developer - lots of questions
From: Igor Stoppa igor.stoppa at nokia.comDate: Sat Nov 17 00:13:34 EET 2007
- Previous message: New developer - lots of questions
- Next message: New developer - lots of questions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, 2007-11-16 at 15:11 -0500, ext maemo at bitblit.net wrote: > On Fri, 16 Nov 2007, Igor Stoppa wrote: > > > If disk space is not an issue for you > > Nope, it isn't... > > > , 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. > > My development is also pure 64bit :-) > > So, do you install a 32bit distro + scratchbox inside the chroot or just > scratchbox? I already have a 32bit chroot installed already (mainly to run > 32bit plugins and codecs). > > > 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. > > Could you explain this a bit more? ok, *I have the chroot environment in /var/chroot/maemo : you can follow the instructions from the official debian howto; i use sid *I have inside the main directory of my user, a directory for the same user to be bindmounted in the chrooted environment: /home/igor/maemo_home_igor *Inside that I have also a directory that is used as home for the scratchbox user: /home/igor/maemo_home_igor/sbox_home here is the relevant part of my fstab: # maemo chroot /sys /var/chroot/maemo/sys none bind 0 0 /tmp /var/chroot/maemo/tmp none bind 0 0 /dev /var/chroot/maemo/dev none bind 0 0 0 0 /dev/pts /var/chroot/maemo/dev/pts none bind 0 0 /dev/shm /var/chroot/maemo/dev/shm none bind 0 0 /proc /var/chroot/maemo/proc none bind 0 0 /proc/sys/fs/binfmt_misc /var/chroot/maemo/proc/sys/fs/binfmt_misc none bind 0 0 /home/igor/maemo_home_igor /var/chroot/maemo/home/igor none bind 0 0 /home/igor/maemo_home_igor/sbox_home /var/chroot/maemo/scratchbox/users/igor/home/igor none bind 0 0 /var/chroot/maemo/scratchbox /var/chroot/maemo/scratchbox/users/igor/scratchbox none bind 0 0 /tmp /var/chroot/maemo/scratchbox/users/igor/tmp none bind 0 0 /proc /var/chroot/maemo/scratchbox/users/igor/proc none bind 0 0 /proc/sys/fs/binfmt_misc /var/chroot/maemo/scratchbox/users/igor/proc/sys/fs/binfmt_misc none bind 0 0 /dev /var/chroot/maemo/scratchbox/users/igor/dev none bind 0 0 /dev/pts /var/chroot/maemo/scratchbox/users/igor/dev/pts none bind 0 0 /dev/shm /var/chroot/maemo/scratchbox/users/igor/dev/shm none bind 0 0 /sys /var/chroot/maemo/scratchbox/users/igor/sys none bind 0 0 I use this script to start everything: #!/bin/bash mount /var/chroot/maemo/sys mount /var/chroot/maemo/tmp mount /var/chroot/maemo/dev mount /var/chroot/maemo/dev/pts mount /var/chroot/maemo/dev/shm mount /var/chroot/maemo/proc mount /var/chroot/maemo/proc/sys/fs/binfmt_misc mount /var/chroot/maemo/home/igor mount /var/chroot/maemo/scratchbox/users/igor/home/igor mount /var/chroot/maemo/scratchbox/users/igor/scratchbox mount /var/chroot/maemo/scratchbox/users/igor/tmp mount /var/chroot/maemo/scratchbox/users/igor/proc mount /var/chroot/maemo/scratchbox/users/igor/proc/sys/fs/binfmt_misc mount /var/chroot/maemo/scratchbox/users/igor/dev mount /var/chroot/maemo/scratchbox/users/igor/dev/pts mount /var/chroot/maemo/scratchbox/users/igor/dev/shm mount /var/chroot/maemo/scratchbox/users/igor/sys chroot /var/chroot/maemo /sb_run umount /var/chroot/maemo/scratchbox/users/igor/sys umount /var/chroot/maemo/scratchbox/users/igor/dev/shm umount /var/chroot/maemo/scratchbox/users/igor/dev/pts umount /var/chroot/maemo/scratchbox/users/igor/dev umount /var/chroot/maemo/scratchbox/users/igor/proc/sys/fs/binfmt_misc umount /var/chroot/maemo/scratchbox/users/igor/proc umount /var/chroot/maemo/scratchbox/users/igor/tmp umount /var/chroot/maemo/scratchbox/users/igor/scratchbox umount /var/chroot/maemo/scratchbox/users/igor/home/igor umount /var/chroot/maemo/home/igor umount /var/chroot/maemo/proc/sys/fs/binfmt_misc umount /var/chroot/maemo/proc umount /var/chroot/maemo/dev/shm umount /var/chroot/maemo/dev/pts umount /var/chroot/maemo/dev umount /var/chroot/maemo/tmp umount /var/chroot/maemo/sys *the sb_run script that is executed in the previous script lives in /var/chroot/maemo and is the following: #!/bin/bash /scratchbox/sbin/register_misc_runner sux - igor scratchbox /scratchbox/sbin/register_misc_runner -d Not exactly straightforward, but as I said I had some problem with cascaded bindmounting and this in the end works for me; furthermore it keeps the user data safe by removing all the bindomounts as soon as you log out from scratchbox. As a nice sideeffect, the sbox daemon gets killed as soon as you log out from the chroot. The combined effect of these 2 features makes it safe to discard your scratchbox installation without having to worry about wiping out data from your main user directory. However it was my first attempt at using scratchbox so maybe there are simpler ways to achieve what i wanted. -- Cheers, Igor Igor Stoppa <igor.stoppa at nokia.com> (Nokia Multimedia - CP - OSSO / Helsinki, Finland)
- Previous message: New developer - lots of questions
- Next message: New developer - lots of questions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]