From b94399bd48eaa7b022bf031279c9543c10487bcd Mon Sep 17 00:00:00 2001
From: Ralph Ronnquist <rrq@rrq.au>
Date: Sun, 5 Nov 2023 22:31:51 +1100
Subject: [PATCH] Minor generalisation to allow testing ventoy use cases.

---
 vm.sh | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/vm.sh b/vm.sh
index 5d8b79c..452b475 100755
--- a/vm.sh
+++ b/vm.sh
@@ -2,6 +2,8 @@
 #
 # QEMU setup for trial VM
 
+ISO=${ISO:-tiniest.iso}
+
 N="12345678"
 if [ ${#1} = 1 ] && [ "${N#*$1}" != "$N" ] ; then
     REPLY=$1
@@ -9,12 +11,12 @@ else
     VARIANT=(
 	"use bootimage.raw as harddisk with legacy boot (and boot menu)"
 	"use bootimage.raw as harddisk with UEFI boot"
-	"use tiniest.iso as harddisk with legacy boot (and boot menu)"
-	"use tiniest.iso as harddisk with UEFI boot"
-	"use tiniest.iso as cdrom with legacy boot (and boot menu)"
-	"use tiniest.iso as cdrom with UEFI boot"
-	"use tiniest.iso as USB disk with legacy boot (and boot menu)"
-	"use tiniest.iso as USB disk with UEFI boot"
+	"use ${ISO} as harddisk with legacy boot (and boot menu)"
+	"use ${ISO} as harddisk with UEFI boot"
+	"use ${ISO} as cdrom with legacy boot (and boot menu)"
+	"use ${ISO} as cdrom with UEFI boot"
+	"use ${ISO} as USB disk with legacy boot (and boot menu)"
+	"use ${ISO} as USB disk with UEFI boot"
     )
 
     select V in "${VARIANT[@]}" ; do
@@ -24,7 +26,7 @@ fi
 [ -z "$REPLY" ] && exit 0
 
 FILE=bootimage.raw
-[ $REPLY -ge 3 ] && FILE=tiniest.iso
+[ $REPLY -ge 3 ] && FILE=${ISO}
 MEDIA=disk
 [ $REPLY -ge 5 ] && MEDIA=cdrom
 [ $REPLY -ge 7 ] && MEDIA=usb
@@ -70,4 +72,6 @@ ARGS=(
 )
 echo "${ARGS[*]}" | sed "s/ -/\n -/g"
 
-exec qemu-system-x86_64 ${ARGS[@]}
+qemu-system-x86_64 ${ARGS[@]}
+tput reset # EFI boot messes up the terminal
+
-- 
2.39.5