2023-04-07 07:21:06 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
BINARIES_DIR="${0%/*}/"
|
|
|
|
# shellcheck disable=SC2164
|
|
|
|
cd "${BINARIES_DIR}"
|
|
|
|
|
2023-04-07 07:21:07 +02:00
|
|
|
mode_serial=false
|
2023-04-07 07:21:08 +02:00
|
|
|
mode_sys_qemu=false
|
2023-04-07 07:21:07 +02:00
|
|
|
while [ "$1" ]; do
|
|
|
|
case "$1" in
|
|
|
|
--serial-only|serial-only) mode_serial=true; shift;;
|
2023-04-07 07:21:08 +02:00
|
|
|
--use-system-qemu) mode_sys_qemu=true; shift;;
|
2023-04-07 07:21:07 +02:00
|
|
|
--) shift; break;;
|
|
|
|
*) echo "unknown option: $1" >&2; exit 1;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if ${mode_serial}; then
|
2023-04-07 07:21:06 +02:00
|
|
|
EXTRA_ARGS='@SERIAL_ARGS@'
|
|
|
|
else
|
|
|
|
EXTRA_ARGS='@DEFAULT_ARGS@'
|
|
|
|
fi
|
|
|
|
|
2023-04-07 07:21:08 +02:00
|
|
|
if ! ${mode_sys_qemu}; then
|
|
|
|
export PATH="@HOST_DIR@/bin:${PATH}"
|
|
|
|
fi
|
|
|
|
|
2023-04-07 07:21:07 +02:00
|
|
|
exec @QEMU_CMD_LINE@ ${EXTRA_ARGS} "$@"
|