summaryrefslogtreecommitdiffstats
path: root/kvm-wrapper.sh
diff options
context:
space:
mode:
authorbencoh <bencoh@19625182-23af-4830-9084-f181c60b83b7>2010-07-18 12:51:41 +0000
committerbencoh <bencoh@19625182-23af-4830-9084-f181c60b83b7>2010-07-18 12:51:41 +0000
commit51378a921d7319dabfe6221ab9fd03e37f2df5a7 (patch)
tree725226fbe8ea3237197caa6ff00815df72c925d6 /kvm-wrapper.sh
parent377cd193d15b8f6f4bf5d08a38f53314082c6d18 (diff)
bootstrap: use debootstrap --make/unpack-tarball instead of homebrew cache.
build_vm: check autoconf before creating descriptor. git-svn-id: https://svn.notk.org/bencoh/kvm-wrapper/@32 19625182-23af-4830-9084-f181c60b83b7
Diffstat (limited to 'kvm-wrapper.sh')
-rwxr-xr-xkvm-wrapper.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/kvm-wrapper.sh b/kvm-wrapper.sh
index b20f9fc..2dc51c8 100755
--- a/kvm-wrapper.sh
+++ b/kvm-wrapper.sh
@@ -290,7 +290,6 @@ function kvm_start_vm ()
check_create_dir "$PID_DIR"
check_create_dir "$MONITOR_DIR"
check_create_dir "$SERIAL_DIR"
- check_create_dir "$BOOT_IMAGES_DIR"
test_file "$VM_DESCRIPTOR" || fail_exit "Couldn't open VM $VM_NAME descriptor :\n$VM_DESCRIPTOR"
source "$VM_DESCRIPTOR"
@@ -547,6 +546,8 @@ function kvm_bootstrap_vm ()
trap cleanup EXIT
require_exec "kpartx"
+ check_create_dir "$BOOT_IMAGES_DIR"
+ check_create_dir "$CACHE_DIR"
VM_NAME="$1"
VM_DESCRIPTOR="$VM_DIR/$VM_NAME-vm"
@@ -620,9 +621,11 @@ function kvm_build_vm ()
if [[ ! "$#" -eq 1 ]]; then print_help; exit 1; fi
VM_NAME="$1"
+
+ test_file "$AUTOCONF_SCRIPT" || fail_exit "Couldn't read autoconfiguration script $AUTOCONF_SCRIPT\n"
+
kvm_create_descriptor "$VM_NAME"
- test_file "$AUTOCONF_SCRIPT" || fail_exit "Couldn't read autoconfiguration script $AUTOCONF_SCRIPT\n"
source "$AUTOCONF_SCRIPT"
if [ ${#USER_OPTIONS[*]} -gt 0 ]; then
@@ -673,9 +676,10 @@ function print_help ()
echo -e " $SCRIPT_NAME status [virtual-machine]"
echo -e " $SCRIPT_NAME list"
echo -e ""
- echo -e " $SCRIPT_NAME edit virtual-machine"
- echo -e " $SCRIPT_NAME create virtual-machine [diskimage] [size]"
+ echo -e " $SCRIPT_NAME create-disk virtual-machine [diskimage [size]]"
+ echo -e " $SCRIPT_NAME bootstrap virtual-machine distribution"
echo -e " $SCRIPT_NAME remove virtual-machine"
+ echo -e " $SCRIPT_NAME edit virtual-machine"
exit 2
}