aboutsummaryrefslogtreecommitdiffstats
path: root/testing/scripts/build-umlrootfs
diff options
context:
space:
mode:
authorReto Buerki <reet@codelabs.ch>2012-12-07 17:54:19 +0100
committerTobias Brunner <tobias@strongswan.org>2013-01-17 16:54:54 +0100
commit8ed98c137321c3f92fb06b58e69aaecf4e531cdc (patch)
tree0dca4366a75f5b44dd55d9026a97312005fe3f8c /testing/scripts/build-umlrootfs
parent7fa27191855eaf828ec3dcf90385e0782f74d2e2 (diff)
downloadstrongswan-8ed98c137321c3f92fb06b58e69aaecf4e531cdc.tar.bz2
strongswan-8ed98c137321c3f92fb06b58e69aaecf4e531cdc.tar.xz
Switch from raw images to qcow2 format
This allows to use minimal copy-on-write clones of the base image as guest images, which in turn saves a lot of disk space.
Diffstat (limited to 'testing/scripts/build-umlrootfs')
-rwxr-xr-xtesting/scripts/build-umlrootfs16
1 files changed, 12 insertions, 4 deletions
diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs
index cf11844ce..c67e4d557 100755
--- a/testing/scripts/build-umlrootfs
+++ b/testing/scripts/build-umlrootfs
@@ -1,5 +1,5 @@
#!/bin/bash
-# Create UML root filesystem
+# Create guest root image
#
# Copyright (C) 2004 Eric Marchionni, Patrik Rayo
# Zuercher Hochschule Winterthur
@@ -22,17 +22,24 @@ echo "Building root image"
[ -f "$ROOTFS" ] || die "Root image $ROOTFS not found"
+load_qemu_nbd
+
mkdir -p $ROOTFSDIR
mkdir -p $LOOPDIR
mkdir -p $ROOTFSCOMPILEDIR
cd $ROOTFSDIR
-BASE=$BUILDDIR/base.img
+BASE=$BUILDDIR/base.qcow2
log_action "Creating $BASE"
execute "cp $ROOTFS $BASE"
-log_action "Mounting base image $BASE"
-execute "mount -o loop $BASE $LOOPDIR"
+log_action "Connecting base image to NBD device $NBDEV"
+execute "qemu-nbd -c $NBDEV $BASE"
+sync
+
+log_action "Mounting $NBDPARTITION to $LOOPDIR"
+execute "mount $NBDPARTITION $LOOPDIR"
+
log_action "Mounting proc filesystem to $LOOPDIR/proc"
execute "mount -t proc none $LOOPDIR/proc"
@@ -43,6 +50,7 @@ execute "mount -o bind $ROOTFSCOMPILEDIR $LOOPDIR/root/compile"
do_on_exit umount $LOOPDIR/root/compile
do_on_exit umount $LOOPDIR/proc
do_on_exit umount $LOOPDIR
+do_on_exit qemu-nbd -d $NBDEV
echo "Installing software from source"
RECPDIR=$TESTDIR/testing/scripts/recipes