diff options
author | gjb <gjb@FreeBSD.org> | 2014-10-09 03:50:38 +0000 |
---|---|---|
committer | gjb <gjb@FreeBSD.org> | 2014-10-09 03:50:38 +0000 |
commit | 437ed46f88f6d38a5b582722815b9f015719aceb (patch) | |
tree | 2a2e1f0b02d750978ad0f956ce1e7adcb0666930 /release/i386 | |
parent | c7959ee139df450936383305caeccad4b39d1a7e (diff) | |
download | FreeBSD-src-437ed46f88f6d38a5b582722815b9f015719aceb.zip FreeBSD-src-437ed46f88f6d38a5b582722815b9f015719aceb.tar.gz |
Allow mk-vmimage.sh to accept a configuration file as
an argument to '-c'.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'release/i386')
-rwxr-xr-x | release/i386/mk-vmimage.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/release/i386/mk-vmimage.sh b/release/i386/mk-vmimage.sh index 657fa52..05c103a 100755 --- a/release/i386/mk-vmimage.sh +++ b/release/i386/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 |