aboutsummaryrefslogtreecommitdiff
path: root/release/amd64
diff options
context:
space:
mode:
authorGlen Barber <gjb@FreeBSD.org>2014-10-09 03:50:38 +0000
committerGlen Barber <gjb@FreeBSD.org>2014-10-09 03:50:38 +0000
commit4ac2ee7f8cd558a55cb042114d5a0e168ac86d23 (patch)
tree2a2e1f0b02d750978ad0f956ce1e7adcb0666930 /release/amd64
parented79fb4ea9f41c41da98ff469f5aac5dfa435320 (diff)
downloadsrc-4ac2ee7f8cd558a55cb042114d5a0e168ac86d23.tar.gz
src-4ac2ee7f8cd558a55cb042114d5a0e168ac86d23.zip
Allow mk-vmimage.sh to accept a configuration file as
an argument to '-c'. Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/projects/release-vmimage/; revision=272794
Diffstat (limited to 'release/amd64')
-rwxr-xr-xrelease/amd64/mk-vmimage.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/release/amd64/mk-vmimage.sh b/release/amd64/mk-vmimage.sh
index 657fa52d37fa..05c103a1f4a7 100755
--- a/release/amd64/mk-vmimage.sh
+++ b/release/amd64/mk-vmimage.sh
@@ -188,9 +188,28 @@ vm_create_vmdisk() {
}
main() {
+ vm_config=
+ while getopts "c:" arg; do
+ case ${arg} in
+ c)
+ vm_config="${OPTARG}"
+ ;;
+ *)
+ ;;
+ esac
+ done
+ shift $(( ${OPTIND} - 1 ))
+
cmd="${1}"
shift 1
+ if [ ! -z "${vm_config}" ]; then
+ if [ ! -e "${vm_config}" ]; then
+ panic "Configuration file ${vm_config} not found."
+ fi
+ . ${vm_config}
+ fi
+
case ${cmd} in
vm-base)
eval vm_create_baseimage "$@" || return 0