From b3e418c6a795293b81585118fcefd89252bd73d3 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 23 Jan 2024 09:43:11 +0100 Subject: [PATCH] board/common: let qemu.sh take kernel/init args on command line Signed-off-by: Joachim Wiberg --- board/common/qemu/qemu.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/board/common/qemu/qemu.sh b/board/common/qemu/qemu.sh index ae2dcd66..d382b74c 100755 --- a/board/common/qemu/qemu.sh +++ b/board/common/qemu/qemu.sh @@ -24,11 +24,22 @@ prognm=$(basename "$0") usage() { - echo "usage: $prognm [opts]" + echo "Usage:" + echo " $prognm [opts] [ARGS]" echo - echo " -c Run menuconfig to change Qemu settings" - echo " -h This help text" + echo "Options:" + echo " -c Run menuconfig to change Qemu settings" + echo " -h This help text" echo + echo "Arguments:" + echo " ARGS1 Args before the '--' separator are for kernel space" + echo " -- Separator" + echo " ARGS2 Args after the '--' separator are for the init process" + echo " Also, qemu.cfg has QEMU_APPEND which can affect this." + echo + echo "Example:" + echo " qemu.sh -- finit.debug" + echo "___________________________________________________________________" echo "Note: 'kconfig-frontends' package (Debian/Ubuntu) must be installed" echo " for -c to work: sudo apt install kconfig-frontents" @@ -359,6 +370,10 @@ else load_qemucfg qemu.cfg fi +if [ -z "$QEMU_EXTRA_APPEND" ]; then + QEMU_EXTRA_APPEND="$*" +fi + generate_dot echo "Starting Qemu :: Ctrl-a x -- exit | Ctrl-a c -- toggle console/monitor"