testing: Add option for a quick rebuild of strongSwan

This shaves off about 1 minute of build time on my machine.  We also
don't need the separate build step and can just run `make install`.
This commit is contained in:
Tobias Brunner 2025-03-20 09:23:34 +01:00
parent 02c43fa6e4
commit 022f2d5f30
2 changed files with 12 additions and 8 deletions

View File

@ -23,6 +23,7 @@ Usage:
--help (-h) show usage information --help (-h) show usage information
--all (-a) build/install all software, not only strongSwan --all (-a) build/install all software, not only strongSwan
--clean (-c) use a new strongSwan build directory --clean (-c) use a new strongSwan build directory
--quick-rebuild (-q) skip running autoreconf and configure
--guest NAME (-g) only install in a specific guest image --guest NAME (-g) only install in a specific guest image
--no-guests (-n) don't build any guest images after the root image --no-guests (-n) don't build any guest images after the root image
--replace (-r) replace the root image (implies --all) --replace (-r) replace the root image (implies --all)
@ -32,6 +33,7 @@ EOF
ALL_RECIPES= ALL_RECIPES=
CLEAN= CLEAN=
QUICK_REBUILD=
GUEST= GUEST=
NO_GUESTS= NO_GUESTS=
REPLACE= REPLACE=
@ -49,6 +51,9 @@ while :; do
-c|--clean) -c|--clean)
CLEAN=1 CLEAN=1
;; ;;
-q|--quick-rebuild)
QUICK_REBUILD=1
;;
-g|--guest) -g|--guest)
if [ "$2" ]; then if [ "$2" ]; then
GUEST=$2 GUEST=$2
@ -153,8 +158,10 @@ if [ -z "$TARBALL" ]; then
echo "$version" > $SHAREDDIR/.strongswan-version echo "$version" > $SHAREDDIR/.strongswan-version
log_status 0 log_status 0
log_action "Preparing source tree" if [ -z "$QUICK_REBUILD" ]; then
execute_chroot 'autoreconf -i /root/strongswan' log_action "Preparing source tree"
execute_chroot 'autoreconf -i /root/strongswan'
fi
fi fi
RECPDIR=$DIR/recipes RECPDIR=$DIR/recipes
@ -185,7 +192,7 @@ do
log_action "Installing from recipe $r" log_action "Installing from recipe $r"
if [[ $r == *strongswan.mk && -z "$TARBALL" ]]; then if [[ $r == *strongswan.mk && -z "$TARBALL" ]]; then
cp $RECPDIR/$r $SHAREDDIR/build-strongswan cp $RECPDIR/$r $SHAREDDIR/build-strongswan
execute_chroot "make SRCDIR=/root/strongswan BUILDDIR=/root/shared/build-strongswan -f /root/shared/build-strongswan/$r" execute_chroot "make SRCDIR=/root/strongswan BUILDDIR=/root/shared/build-strongswan QUICK_REBUILD=$QUICK_REBUILD -f /root/shared/build-strongswan/$r"
else else
cp $RECPDIR/$r ${LOOPDIR}/root/shared/compile cp $RECPDIR/$r ${LOOPDIR}/root/shared/compile
execute_chroot "make SWANVERSION=$TARBALL -C /root/shared/compile -f $r" execute_chroot "make SWANVERSION=$TARBALL -C /root/shared/compile -f $r"

View File

@ -127,11 +127,8 @@ $(PKG): $(TAR)
echo "$(SWANVERSION)" > /root/shared/.strongswan-version echo "$(SWANVERSION)" > /root/shared/.strongswan-version
configure: $(BUILDDIR) configure: $(BUILDDIR)
cd $(BUILDDIR) && $(DIR)/configure $(CONFIG_OPTS) [ -n "$(QUICK_REBUILD)" ] || (cd $(BUILDDIR) && $(DIR)/configure $(CONFIG_OPTS))
build: configure install: configure
cd $(BUILDDIR) && make -j $(NUM_CPUS)
install: build
cd $(BUILDDIR) && make -j install && \ cd $(BUILDDIR) && make -j install && \
cd $(DIR)/src/libcharon/plugins/vici/python && python3 setup.py install cd $(DIR)/src/libcharon/plugins/vici/python && python3 setup.py install