Commit a0b5a7ddfb for strongswan.org
commit a0b5a7ddfb974e1ab0d56823a91fd320d62f394f
Author: Tobias Brunner <tobias@strongswan.org>
Date: Fri Nov 6 17:59:41 2026 +0100
testing: Add proper option to skip building guest images after generating certificates
The previous non-empty second argument hack seemed accidental (looks
like it was just copy-pasted from the build-strongswan script at the
time).
Fixes: 287149cbf952 ("testing: Automatically build guest images after generating certificates")
diff --git a/testing/scripts/build-certs b/testing/scripts/build-certs
index 04f4fc703a..1ddb3b7066 100755
--- a/testing/scripts/build-certs
+++ b/testing/scripts/build-certs
@@ -19,6 +19,33 @@ load_qemu_nbd
mkdir -p $LOOPDIR
mkdir -p $IMGDIR
+usage() {
+cat << EOF
+Usage:
+ ${0##*/} [--no-guests]
+ --help (-h) show usage information
+ --no-guests (-n) don't build guest images after generating certificates
+EOF
+}
+
+NO_GUESTS=
+
+while :; do
+ case $1 in
+ -h|--help)
+ usage
+ exit
+ ;;
+ -n|--no-guests)
+ NO_GUESTS=1
+ ;;
+ *)
+ break
+ esac
+
+ shift
+done
+
log_action "Connecting root image to NBD device $NBDEV"
execute "qemu-nbd -c $NBDEV $ROOTIMG"
do_on_exit qemu-nbd -d $NBDEV
@@ -43,7 +70,7 @@ log_action "Building certificates"
execute_chroot "/root/testing/scripts/build-certs-chroot"
# rebuild the guest images to generate the CRLs on winnetou
-if [ -z "$2" ]; then
+if [ -z "$NO_GUESTS" ]; then
# cleanup before mounting guest images
on_exit
$DIR/scripts/build-guestimages