]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
testing: Optionally replace root image when building strongSwan
authorTobias Brunner <tobias@strongswan.org>
Mon, 9 Nov 2020 13:55:46 +0000 (14:55 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 27 Nov 2020 11:05:22 +0000 (12:05 +0100)
testing/scripts/build-strongswan

index 3b576691470d9902c34aa67fa84114747a0cb5f1..2efd4329b89e45619d68d093c67a112cb938dea7 100755 (executable)
@@ -20,17 +20,19 @@ mkdir -p $IMGDIR
 
 usage() {
 cat << EOF
-Usage: ${0##*/} [--all] [--clean] [--guest NAME] [SRCDIR]
+Usage: ${0##*/} [--all] [--clean] [--guest NAME] [--replace] [SRCDIR]
     --help            (-h)  show usage information
     --all             (-a)  build/install all software, not only strongSwan
     --clean           (-c)  use a new strongSwan build directory
     --guest NAME      (-g)  only install in a specific guest image
+    --replace         (-r)  replace the root image (implies --all)
 EOF
 }
 
 ALL_RECIPES=
 CLEAN=
 GUEST=
+REPLACE=
 
 while :; do
        case $1 in
@@ -52,6 +54,9 @@ while :; do
                        die "Guest name missing"
                fi
                ;;
+       -r|--replace)
+               REPLACE=1
+               ;;
        *)
                break
        esac
@@ -66,7 +71,7 @@ SWANDIR=${1:+$(readlink -f $1)}
 
 case "$GUEST" in
 "")
-       if [ ! -f "$ROOTIMG" ]; then
+       if [ ! -f "$ROOTIMG" -o "$REPLACE" ]; then
                log_action "Creating root image $ROOTIMG"
                execute "qemu-img create -b $BASEIMG -f $IMGEXT $ROOTIMG"
                ALL_RECIPES=1