summaryrefslogtreecommitdiff
path: root/testing/scripts/build-strongswan
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2018-09-24 15:11:25 +0200
committerYves-Alexis Perez <corsac@debian.org>2018-09-24 15:11:25 +0200
commit7152c3439f3decbb6366d94464d3c089674c8c30 (patch)
tree48bfe66e31226d55914868bc0558f479e2a22a36 /testing/scripts/build-strongswan
parentc2ac4e0da62d859085148d8518d558402e1f9a8c (diff)
parente0e280b7669435b991b7e457abd8aa450930b3e8 (diff)
downloadvyos-strongswan-7152c3439f3decbb6366d94464d3c089674c8c30.tar.gz
vyos-strongswan-7152c3439f3decbb6366d94464d3c089674c8c30.zip
Update upstream source from tag 'upstream/5.7.0'
Update to upstream version '5.7.0' with Debian dir b608300a1e1f88db62d14d08a55ca09f3603f054
Diffstat (limited to 'testing/scripts/build-strongswan')
-rwxr-xr-xtesting/scripts/build-strongswan28
1 files changed, 20 insertions, 8 deletions
diff --git a/testing/scripts/build-strongswan b/testing/scripts/build-strongswan
index 150fce30c..13fd1e691 100755
--- a/testing/scripts/build-strongswan
+++ b/testing/scripts/build-strongswan
@@ -1,7 +1,5 @@
#!/bin/bash
-echo "Preparing root image"
-
DIR=$(dirname `readlink -f $0`)
. $DIR/../testing.conf
. $DIR/function.sh
@@ -26,8 +24,20 @@ load_qemu_nbd
mkdir -p $LOOPDIR
mkdir -p $IMGDIR
-log_action "Connecting root image to NBD device $NBDEV"
-execute "qemu-nbd -c $NBDEV $ROOTIMG"
+case "$2" in
+"")
+ log_action "Connecting root image to NBD device $NBDEV"
+ execute "qemu-nbd -c $NBDEV $ROOTIMG"
+ ;;
+*)
+ echo $STRONGSWANHOSTS | grep -q "\b$2\b" || die "Guest $2 not found"
+ GUESTIMG="$IMGDIR/$2.$IMGEXT"
+ [ -f "$GUESTIMG" ] || die "Guest image $GUESTIMG not found"
+ log_action "Connecting guest image to NBD device $NBDEV"
+ execute "qemu-nbd -c $NBDEV $GUESTIMG"
+ ;;
+esac
+
do_on_exit qemu-nbd -d $NBDEV
partprobe $NBDEV
@@ -74,7 +84,9 @@ cp $RECPDIR/$RECIPE $SHAREDDIR/build-strongswan
log_action "Installing from recipe $RECIPE"
execute_chroot "make SRCDIR=/root/strongswan BUILDDIR=/root/shared/build-strongswan -f /root/shared/build-strongswan/$RECIPE"
-# cleanup before mounting guest images
-on_exit
-
-$DIR/build-guestimages
+# requild the guest images if we modified the root image
+if [ -z "$2" ]; then
+ # cleanup before mounting guest images
+ on_exit
+ $DIR/build-guestimages
+fi