From: Reto Buerki Date: Mon, 17 Dec 2012 18:00:31 +0000 (+0100) Subject: Export compile directory to guests X-Git-Tag: 5.0.2rc1~1^2~38 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0593b6c975684d61a7432c6593ef5a5a6bc7b21d;p=thirdparty%2Fstrongswan.git Export compile directory to guests Use 9p over virtio to share files on the host with the guest domains. The files are accessible in the guests /hostfs directory. --- diff --git a/testing/config/kernel/config-3.5 b/testing/config/kernel/config-3.5 index e92d0b05b8..9494331eb7 100644 --- a/testing/config/kernel/config-3.5 +++ b/testing/config/kernel/config-3.5 @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/x86_64 3.5.0 Kernel Configuration +# Linux/x86_64 3.5.3 Kernel Configuration # CONFIG_64BIT=y # CONFIG_X86_32 is not set @@ -741,7 +741,9 @@ CONFIG_WIRELESS=y # # CONFIG_WIMAX is not set # CONFIG_RFKILL is not set -# CONFIG_NET_9P is not set +CONFIG_NET_9P=y +CONFIG_NET_9P_VIRTIO=y +# CONFIG_NET_9P_DEBUG is not set # CONFIG_CAIF is not set # CONFIG_CEPH_LIB is not set # CONFIG_NFC is not set @@ -1385,7 +1387,7 @@ CONFIG_REISERFS_FS=y # CONFIG_GFS2_FS is not set # CONFIG_BTRFS_FS is not set # CONFIG_NILFS2_FS is not set -# CONFIG_FS_POSIX_ACL is not set +CONFIG_FS_POSIX_ACL=y CONFIG_FILE_LOCKING=y CONFIG_FSNOTIFY=y CONFIG_DNOTIFY=y @@ -1464,6 +1466,8 @@ CONFIG_NETWORK_FILESYSTEMS=y # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set +CONFIG_9P_FS=y +CONFIG_9P_FS_POSIX_ACL=y CONFIG_NLS=y CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_CODEPAGE_437 is not set diff --git a/testing/config/kvm/alice.xml b/testing/config/kvm/alice.xml index 325e054407..21683b878b 100644 --- a/testing/config/kvm/alice.xml +++ b/testing/config/kvm/alice.xml @@ -30,6 +30,11 @@
+ + + +
+ diff --git a/testing/config/kvm/bob.xml b/testing/config/kvm/bob.xml index 723825bbbb..e112008025 100644 --- a/testing/config/kvm/bob.xml +++ b/testing/config/kvm/bob.xml @@ -30,9 +30,11 @@
- -
- + + + +
+ diff --git a/testing/config/kvm/carol.xml b/testing/config/kvm/carol.xml index ec018611d7..3bd66f1410 100644 --- a/testing/config/kvm/carol.xml +++ b/testing/config/kvm/carol.xml @@ -30,9 +30,11 @@
- -
- + + + +
+ diff --git a/testing/config/kvm/dave.xml b/testing/config/kvm/dave.xml index 019191842f..526df285a9 100644 --- a/testing/config/kvm/dave.xml +++ b/testing/config/kvm/dave.xml @@ -30,9 +30,11 @@
- -
- + + + +
+ diff --git a/testing/config/kvm/moon.xml b/testing/config/kvm/moon.xml index 8e5769de2b..0492993121 100644 --- a/testing/config/kvm/moon.xml +++ b/testing/config/kvm/moon.xml @@ -25,11 +25,16 @@ -
+
+ + + +
+ diff --git a/testing/config/kvm/sun.xml b/testing/config/kvm/sun.xml index 01fed44c68..e60129819d 100644 --- a/testing/config/kvm/sun.xml +++ b/testing/config/kvm/sun.xml @@ -25,11 +25,16 @@ -
+
+ + + +
+ diff --git a/testing/config/kvm/venus.xml b/testing/config/kvm/venus.xml index 3002e23c86..bd00aa5630 100644 --- a/testing/config/kvm/venus.xml +++ b/testing/config/kvm/venus.xml @@ -30,6 +30,11 @@
+ + + +
+ diff --git a/testing/config/kvm/winnetou.xml b/testing/config/kvm/winnetou.xml index 3f018f1a8c..a23b2489c0 100644 --- a/testing/config/kvm/winnetou.xml +++ b/testing/config/kvm/winnetou.xml @@ -30,6 +30,11 @@
+ + + +
+ diff --git a/testing/hosts/default/etc/fstab b/testing/hosts/default/etc/fstab new file mode 100644 index 0000000000..1fb00f42ea --- /dev/null +++ b/testing/hosts/default/etc/fstab @@ -0,0 +1 @@ +/hostshare /hostfs 9p trans=virtio,version=9p2000.L 0 0 diff --git a/testing/scripts/build-rootimage b/testing/scripts/build-rootimage index b575ebb50e..ac9ee8bbc0 100755 --- a/testing/scripts/build-rootimage +++ b/testing/scripts/build-rootimage @@ -48,6 +48,7 @@ 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 echo "Installing software from source" @@ -63,3 +64,5 @@ done log_action "Removing /etc/resolv.conf" execute "rm -f $LOOPDIR/etc/resolv.conf" + +mkdir -p $LOOPDIR/hostfs diff --git a/testing/start-testing b/testing/start-testing index dce089ad2a..e2944bc77a 100755 --- a/testing/start-testing +++ b/testing/start-testing @@ -6,6 +6,7 @@ NETWORKS="vnet1 vnet2 vnet3" CONFDIR=$PWD/config/kvm KNLSRC=$BUILDDIR/$KERNEL/arch/x86/boot/bzImage KNLTARGET=/var/run/kvm-swan-kernel +HOSTFSTARGET=/var/run/kvm-swan-hostfs echo "Starting test environment" @@ -16,6 +17,9 @@ check_commands virsh log_action "Deploying kernel $KERNEL" execute "ln -fs $KNLSRC $KNLTARGET" +log_action "Deploying $ROOTIMGCOMPILEDIR as hostfs" +execute "ln -Tfs $ROOTIMGCOMPILEDIR $HOSTFSTARGET" + for net in $NETWORKS do log_action "Network $net" diff --git a/testing/stop-testing b/testing/stop-testing index 852e2ec9e5..5695d620ad 100755 --- a/testing/stop-testing +++ b/testing/stop-testing @@ -6,6 +6,7 @@ echo "Stopping test environment" NETWORKS="vnet1 vnet2 vnet3" KNLTARGET=/var/run/kvm-swan-kernel +HOSTFSTARGET=/var/run/kvm-swan-hostfs [ `id -u` -eq 0 ] || die "You must be root to run $0" @@ -26,3 +27,6 @@ done log_action "Removing kernel $KERNEL" execute "rm $KNLTARGET" + +log_action "Removing link to hostfs" +execute "rm $HOSTFSTARGET"