aboutsummaryrefslogtreecommitdiffstats
path: root/testing/scripts/build-rootimage
diff options
context:
space:
mode:
authorReto Buerki <reet@codelabs.ch>2013-01-16 11:58:01 +0100
committerTobias Brunner <tobias@strongswan.org>2013-01-17 16:55:04 +0100
commit2c4954ad249a4ae17f5c0b0e768538b212dc412c (patch)
tree12033e9592f7ec30c4b838aca023bbd29d4e1543 /testing/scripts/build-rootimage
parent677795c3e7fe20e1e85138a14854b90e52d7f327 (diff)
downloadstrongswan-2c4954ad249a4ae17f5c0b0e768538b212dc412c.tar.bz2
strongswan-2c4954ad249a4ae17f5c0b0e768538b212dc412c.tar.xz
Switch to 'mapped' access mode for hostfs
Passthrough mode only works as expected when running as root. On Debian/Ubuntu systems qemu runs as user 'libvirt-qemu' and group 'kvm' so all shared files must be chowned to grant access from guests. Symlinks created on the host are still problematic because the Plan 9 filesystem has no direct notion of symbolic links, see [1]. [1] - http://ericvh.github.com/9p-rfc/rfc9p2000.u.html
Diffstat (limited to 'testing/scripts/build-rootimage')
-rwxr-xr-xtesting/scripts/build-rootimage19
1 files changed, 8 insertions, 11 deletions
diff --git a/testing/scripts/build-rootimage b/testing/scripts/build-rootimage
index 8f2b3aa1c..8e10ce5f3 100755
--- a/testing/scripts/build-rootimage
+++ b/testing/scripts/build-rootimage
@@ -28,7 +28,7 @@ check_commands partprobe qemu-img qemu-nbd
load_qemu_nbd
mkdir -p $LOOPDIR
-mkdir -p $ROOTIMGCOMPILEDIR
+mkdir -p $SHAREDDIR/compile
mkdir -p $IMGDIR
log_action "Creating root image $ROOTIMG"
@@ -47,24 +47,21 @@ log_action "Mounting proc filesystem to $LOOPDIR/proc"
execute "mount -t proc none $LOOPDIR/proc"
do_on_exit umount $LOOPDIR/proc
-mkdir -p $LOOPDIR/root/compile
-log_action "Mounting $ROOTIMGCOMPILEDIR as /root/compile"
-execute "mount -o bind $ROOTIMGCOMPILEDIR $LOOPDIR/root/compile"
-do_on_exit rm -r $LOOPDIR/root/compile
-do_on_exit umount $LOOPDIR/root/compile
+mkdir -p $LOOPDIR/root/shared
+log_action "Mounting $SHAREDDIR as /root/shared"
+execute "mount -o bind $SHAREDDIR $LOOPDIR/root/shared"
+do_on_exit umount $LOOPDIR/root/shared
echo "Installing software from source"
RECPDIR=$DIR/recipes
RECIPES=`ls $RECPDIR/*.mk | xargs -n1 basename`
-execute "cp -r $RECPDIR/patches $LOOPDIR/root/compile" 0
+execute "cp -r $RECPDIR/patches $LOOPDIR/root/shared/compile" 0
for r in $RECIPES
do
- cp $RECPDIR/$r ${LOOPDIR}/root/compile
+ cp $RECPDIR/$r ${LOOPDIR}/root/shared/compile
log_action "Installing from recipe $r"
- execute_chroot "make SWANVERSION=$SWANVERSION -C /root/compile -f $r"
+ execute_chroot "make SWANVERSION=$SWANVERSION -C /root/shared/compile -f $r"
done
log_action "Removing /etc/resolv.conf"
execute "rm -f $LOOPDIR/etc/resolv.conf"
-
-mkdir -p $LOOPDIR/hostfs