diff --git a/board/qemu/start-qemu.sh.in b/board/qemu/start-qemu.sh.in index 4dc9bfbb0d..cbc33a76d1 100644 --- a/board/qemu/start-qemu.sh.in +++ b/board/qemu/start-qemu.sh.in @@ -4,11 +4,20 @@ BINARIES_DIR="${0%/*}/" # shellcheck disable=SC2164 cd "${BINARIES_DIR}" -if [ "${1}" = "serial-only" ]; then +mode_serial=false +while [ "$1" ]; do + case "$1" in + --serial-only|serial-only) mode_serial=true; shift;; + --) shift; break;; + *) echo "unknown option: $1" >&2; exit 1;; + esac +done + +if ${mode_serial}; then EXTRA_ARGS='@SERIAL_ARGS@' else EXTRA_ARGS='@DEFAULT_ARGS@' fi export PATH="@HOST_DIR@/bin:${PATH}" -exec @QEMU_CMD_LINE@ ${EXTRA_ARGS} +exec @QEMU_CMD_LINE@ ${EXTRA_ARGS} "$@"