testing: Optionally build/install strongSwan only on a specific guest
This may be used to test different strongSwan versions against each other.
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "Preparing root image"
|
|
||||||
|
|
||||||
DIR=$(dirname `readlink -f $0`)
|
DIR=$(dirname `readlink -f $0`)
|
||||||
. $DIR/../testing.conf
|
. $DIR/../testing.conf
|
||||||
. $DIR/function.sh
|
. $DIR/function.sh
|
||||||
@@ -26,8 +24,20 @@ load_qemu_nbd
|
|||||||
mkdir -p $LOOPDIR
|
mkdir -p $LOOPDIR
|
||||||
mkdir -p $IMGDIR
|
mkdir -p $IMGDIR
|
||||||
|
|
||||||
log_action "Connecting root image to NBD device $NBDEV"
|
case "$2" in
|
||||||
execute "qemu-nbd -c $NBDEV $ROOTIMG"
|
"")
|
||||||
|
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
|
do_on_exit qemu-nbd -d $NBDEV
|
||||||
partprobe $NBDEV
|
partprobe $NBDEV
|
||||||
|
|
||||||
@@ -74,7 +84,9 @@ cp $RECPDIR/$RECIPE $SHAREDDIR/build-strongswan
|
|||||||
log_action "Installing from recipe $RECIPE"
|
log_action "Installing from recipe $RECIPE"
|
||||||
execute_chroot "make SRCDIR=/root/strongswan BUILDDIR=/root/shared/build-strongswan -f /root/shared/build-strongswan/$RECIPE"
|
execute_chroot "make SRCDIR=/root/strongswan BUILDDIR=/root/shared/build-strongswan -f /root/shared/build-strongswan/$RECIPE"
|
||||||
|
|
||||||
# cleanup before mounting guest images
|
# requild the guest images if we modified the root image
|
||||||
on_exit
|
if [ -z "$2" ]; then
|
||||||
|
# cleanup before mounting guest images
|
||||||
$DIR/build-guestimages
|
on_exit
|
||||||
|
$DIR/build-guestimages
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user