From 4d5e46432a3c4d4247a4eb7a81e7db86819c1b65 Mon Sep 17 00:00:00 2001 From: Kai Lueke Date: Wed, 3 Apr 2024 20:03:02 +0900 Subject: [PATCH] qemu_template.sh: Allow parameters for VM image and memory When testing multiple images one always has to copy them to the expected file name, and when trying to run two VMs this means one needs to either use separate directories or modify the qemu script. One also needs to modify the qemu script to bump the memory for K8s or for LUKS. Support parameters for the VM image name and the VM memory. --- build_library/qemu_template.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build_library/qemu_template.sh b/build_library/qemu_template.sh index 50c254fd46..86697ff887 100755 --- a/build_library/qemu_template.sh +++ b/build_library/qemu_template.sh @@ -26,6 +26,8 @@ Options: -c FILE Config drive as an iso or fat filesystem image. -a FILE SSH public keys for login access. [~/.ssh/id_{dsa,rsa}.pub] -p PORT The port on localhost to map to the VM's sshd. [2222] + -I FILE Set a custom image file. + -M MB Set VM memory in MBs. -s Safe settings: single simple cpu and no KVM. -h this ;-) @@ -76,6 +78,12 @@ while [ $# -ge 1 ]; do -s|-safe) SAFE_ARGS=1 shift ;; + -I|-image-file) + VM_IMAGE="$2" + shift 2 ;; + -M|-memory) + VM_MEMORY="$2" + shift 2 ;; -v|-verbose) set -x shift ;;