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 diff --git a/release/i386/mk-vmimage.sh b/release/i386/mk-vmimage.sh index 657fa52d37fa..05c103a1f4a7 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