testing: Optionally replace root image when building strongSwan
This commit is contained in:
@@ -20,17 +20,19 @@ mkdir -p $IMGDIR
|
|||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
Usage: ${0##*/} [--all] [--clean] [--guest NAME] [SRCDIR]
|
Usage: ${0##*/} [--all] [--clean] [--guest NAME] [--replace] [SRCDIR]
|
||||||
--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
|
||||||
--guest NAME (-g) only install in a specific guest image
|
--guest NAME (-g) only install in a specific guest image
|
||||||
|
--replace (-r) replace the root image (implies --all)
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
ALL_RECIPES=
|
ALL_RECIPES=
|
||||||
CLEAN=
|
CLEAN=
|
||||||
GUEST=
|
GUEST=
|
||||||
|
REPLACE=
|
||||||
|
|
||||||
while :; do
|
while :; do
|
||||||
case $1 in
|
case $1 in
|
||||||
@@ -52,6 +54,9 @@ while :; do
|
|||||||
die "Guest name missing"
|
die "Guest name missing"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
-r|--replace)
|
||||||
|
REPLACE=1
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
break
|
break
|
||||||
esac
|
esac
|
||||||
@@ -66,7 +71,7 @@ SWANDIR=${1:+$(readlink -f $1)}
|
|||||||
|
|
||||||
case "$GUEST" in
|
case "$GUEST" in
|
||||||
"")
|
"")
|
||||||
if [ ! -f "$ROOTIMG" ]; then
|
if [ ! -f "$ROOTIMG" -o "$REPLACE" ]; then
|
||||||
log_action "Creating root image $ROOTIMG"
|
log_action "Creating root image $ROOTIMG"
|
||||||
execute "qemu-img create -b $BASEIMG -f $IMGEXT $ROOTIMG"
|
execute "qemu-img create -b $BASEIMG -f $IMGEXT $ROOTIMG"
|
||||||
ALL_RECIPES=1
|
ALL_RECIPES=1
|
||||||
|
|||||||
Reference in New Issue
Block a user