summaryrefslogtreecommitdiff
path: root/testing/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'testing/scripts')
-rwxr-xr-xtesting/scripts/build-strongswan28
-rw-r--r--testing/scripts/recipes/011_botan.mk30
-rw-r--r--testing/scripts/recipes/013_strongswan.mk3
3 files changed, 51 insertions, 10 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
diff --git a/testing/scripts/recipes/011_botan.mk b/testing/scripts/recipes/011_botan.mk
new file mode 100644
index 000000000..ef0f6d066
--- /dev/null
+++ b/testing/scripts/recipes/011_botan.mk
@@ -0,0 +1,30 @@
+#!/usr/bin/make
+
+PKG = botan
+SRC = https://github.com/randombit/$(PKG).git
+# will have to be changed to the 2.8.0 tag later
+REV = 1872f899716854927ecc68022fac318735be8824
+
+NUM_CPUS := $(shell getconf _NPROCESSORS_ONLN)
+
+# the first two are necessary due to LD, the others to reduce the build time
+CONFIG_OPTS = \
+ --without-os-features=threads \
+ --disable-modules=locking_allocator \
+ --disable-modules=pkcs11,tls,x509,xmss \
+
+all: install
+
+$(PKG):
+ git clone $(SRC) $(PKG)
+
+.$(PKG)-cloned-$(REV): $(PKG)
+ cd $(PKG) && git fetch && git checkout $(REV)
+ @touch $@
+
+.$(PKG)-built-$(REV): .$(PKG)-cloned-$(REV)
+ cd $(PKG) && python ./configure.py $(CONFIG_OPTS) && make -j $(NUM_CPUS)
+ @touch $@
+
+install: .$(PKG)-built-$(REV)
+ cd $(PKG) && make install && ldconfig
diff --git a/testing/scripts/recipes/013_strongswan.mk b/testing/scripts/recipes/013_strongswan.mk
index 52462d077..13a1b23c8 100644
--- a/testing/scripts/recipes/013_strongswan.mk
+++ b/testing/scripts/recipes/013_strongswan.mk
@@ -54,8 +54,6 @@ CONFIG_OPTS = \
--enable-imv-os \
--enable-imc-attestation \
--enable-imv-attestation \
- --enable-imc-swid \
- --enable-imv-swid \
--enable-imc-swima \
--enable-imv-swima \
--enable-imc-hcd \
@@ -64,6 +62,7 @@ CONFIG_OPTS = \
--enable-sqlite \
--enable-attr-sql \
--enable-mediation \
+ --enable-botan \
--enable-openssl \
--enable-blowfish \
--enable-kernel-pfkey \