From 988f8f5394a1cac9f3f93621b11a002871e9f449 Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Wed, 19 Nov 2025 15:12:26 -0700 Subject: [PATCH] launch-qemu: add an option to set qemu exe path For the purposes of experimentation, I built my own qemu, so I want to run that one. Signed-off-by: Tycho Andersen --- launch-qemu.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/launch-qemu.sh b/launch-qemu.sh index e4876d4acf32..21574e251ce4 100755 --- a/launch-qemu.sh +++ b/launch-qemu.sh @@ -24,6 +24,7 @@ DRY= EXEC_PATH="./usr/local" UEFI_PATH="$EXEC_PATH/share/qemu" +QEMU_EXE= usage() { echo "$0 [options]" @@ -46,6 +47,7 @@ usage() { echo " (Requires that QEMU is built on a host that supports libslirp-dev 4.7 or newer)" echo " -monitor PATH Path to QEMU monitor socket (default: $MONITOR_PATH)" echo " -log PATH Path to QEMU console log (default: $QEMU_CONSOLE_LOG)" + echo " -qemu-exe PATH Path to QEMU executable (default: $EXEC_PATH/bin/qemu-system-x86_64)" echo " -dry Print generated command-line but don't launch the guest" exit 1 } @@ -144,6 +146,9 @@ while [ -n "$1" ]; do -log) QEMU_CONSOLE_LOG="$2" shift ;; + -qemu-exe) QEMU_EXE="$2" + shift + ;; -dry) DRY="1" shift ;; @@ -154,8 +159,10 @@ while [ -n "$1" ]; do shift done -TMP="$EXEC_PATH/bin/qemu-system-x86_64" -QEMU_EXE="$(readlink -e $TMP)" +if [ -z "$QEMU_EXE" ]; then + TMP="$EXEC_PATH/bin/qemu-system-x86_64" + QEMU_EXE="$(readlink -e $TMP)" +fi [ -z "$QEMU_EXE" ] && { echo "Can't locate qemu executable [$TMP]" usage