OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 |
| 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. |
| 6 # |
| 7 # Simple wrapper scipt to start a vm using the vm lib. |
| 8 |
| 9 . "$(dirname $0)/../common.sh" |
| 10 . "$(dirname $0)/../lib/cros_vm_lib.sh" |
| 11 . "$(dirname "$0")/../lib/cros_vm_constants.sh" |
| 12 |
| 13 DEFINE_string image_path "" "Full path of the VM image" |
| 14 |
| 15 set -e |
| 16 |
| 17 # Parse command line. |
| 18 FLAGS "$@" || exit 1 |
| 19 eval set -- "${FLAGS_ARGV}" |
| 20 |
| 21 # Use latest if not specified. |
| 22 if [ -z "${FLAGS_image_path}" ]; then |
| 23 LATEST_IMAGE="$(${SCRIPTS_DIR}/get_latest_image.sh)/${DEFAULT_QEMU_IMAGE}" |
| 24 info "Using latest vm image ${LATEST_IMAGE}" |
| 25 FLAGS_image_path=${LATEST_IMAGE} |
| 26 fi |
| 27 |
| 28 [ -e "${FLAGS_image_path}" ] || die "Image ${FLAGS_image_path} does not exist." |
| 29 |
| 30 start_kvm "${FLAGS_image_path}" |
| 31 |
| 32 echo "ssh root@${HOSTNAME} -p ${FLAGS_ssh_port} -o StrictHostKeyChecking=no" |
OLD | NEW |