diff --git a/README.md b/README.md index 849c041..ca58575 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,13 @@ QEMU NVMe Testing Galore! running. -## Getting Started (Manual Mode) +## Getting Started 1. Clone the `vmctl` repository. 2. Bootstrap a config directory with the following command: - $ ./vmctl env --bootstrap $HOME/vms --verbose + $ ./vmctl env --bootstrap $HOME/vms --verbose **Note** This will: * Check that `ssh` and `socat` are installed @@ -25,16 +25,17 @@ running. 3. There are two ways of executing `vmctl`: 1. Symlink in your path to always have it available "natively" - + ``` $ ln -s /path/to/vmctl/vmctl $HOME/bin/vmctl $ vmctl --help $ vmctl -c CONFIG - + ``` 2. Activate `vmctl` with `env` for your current shell - + ``` $ ./vmctl env --confdir $HOME/vms $ vmctl --help $ vmctl -c CONFIG + ``` 4. Prepare a boot image. The base configruation `*-base.conf` will look for a base image in `img/base.qcow2`. You can use [archbase][archbase] to build a diff --git a/cmd/run b/cmd/run index 7d05554..97241fd 100644 --- a/cmd/run +++ b/cmd/run @@ -196,6 +196,15 @@ _run() { params=("${QEMU_PARAMS[@]}") if [[ -v do_print ]]; then + if [[ -v VMPRE ]]; then + echo "Before QEMU:" + for cmd in "${VMPRE[@]}"; do + echo -n " $cmd" + echo + done + fi + echo + local nargs="${#params[@]}" echo "$QEMU_SYSTEM_BINARY \\" diff --git a/examples/vm/common.conf b/examples/vm/common.conf index 90e257e..5d4058c 100644 --- a/examples/vm/common.conf +++ b/examples/vm/common.conf @@ -1,10 +1,10 @@ #!/usr/bin/env bash # vmctl run parameters -QEMU_IMG=$(/usr/bin/which qemu-img) -QEMU_EDK2_AARCH64="/usr/share/edk2-armvirt/aarch64/QEMU_EFI.fd" -GUEST_KERNEL_APPEND_EXTRA="audit=0" -GUEST_KERNEL_BOOTDEV="/dev/vda1" +: "${QEMU_IMG:=$(which qemu-img)}" +: "${QEMU_EDK2_AARCH64:="/usr/share/edk2-armvirt/aarch64/QEMU_EFI.fd"}" +: "${GUEST_KERNEL_APPEND_EXTRA:="audit=0"}" +: "${GUEST_KERNEL_BOOTDEV:="/dev/vda1"}" # nvme-specific local parameters -default_nvme_ns_extra="logical_block_size=4096,physical_block_size=4096" +: "${default_nvme_ns_extra:="logical_block_size=4096,physical_block_size=4096"}"