From: Tobias Brunner Date: Wed, 11 Jul 2018 16:38:09 +0000 (+0200) Subject: testing: Optionally build/install strongSwan only on a specific guest X-Git-Tag: 5.7.0dr5~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75214fabd8aea8f391478c1fb93a33045a14fd65;p=thirdparty%2Fstrongswan.git testing: Optionally build/install strongSwan only on a specific guest This may be used to test different strongSwan versions against each other. --- diff --git a/testing/scripts/build-strongswan b/testing/scripts/build-strongswan index 150fce30c6..13fd1e6913 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