Add support for "extra_args" in commandline

This commit is contained in:
Radomir Ochtyra 2022-04-21 13:49:18 +02:00 committed by Martin Wimpress
parent 1174282660
commit 9e368b64bc

View File

@ -1126,8 +1126,12 @@ function vm_boot() {
exit 1 exit 1
fi fi
if [ -n "${extra_args}" ]; then
args+=(${extra_args}) if [ -z "${EXTRA_ARGS}" ]; then
EXTRA_ARGS="${extra_args}"
fi
if [ -n "${EXTRA_ARGS}" ]; then
args+=(${EXTRA_ARGS})
fi fi
# The OSK parameter contains parenthesis, they need to be escaped in the shell # The OSK parameter contains parenthesis, they need to be escaped in the shell
@ -1241,6 +1245,7 @@ function usage() {
echo " --keyboard_layout <layout> : Set keyboard layout." echo " --keyboard_layout <layout> : Set keyboard layout."
echo " --mouse <type> : Set mouse. @Options: 'tablet' (default), 'ps2', 'usb', 'virtio'" echo " --mouse <type> : Set mouse. @Options: 'tablet' (default), 'ps2', 'usb', 'virtio'"
echo " --usb-controller <type> : Set usb-controller. @Options: 'ehci' (default), 'xhci', 'none'" echo " --usb-controller <type> : Set usb-controller. @Options: 'ehci' (default), 'xhci', 'none'"
echo " --extra_args <arguments> : Pass additional arguments to qemu"
echo " --version : Print version" echo " --version : Print version"
exit 1 exit 1
} }
@ -1410,6 +1415,7 @@ KEYBOARD=""
KEYBOARD_LAYOUT="" KEYBOARD_LAYOUT=""
MOUSE="" MOUSE=""
USB_CONTROLLER="" USB_CONTROLLER=""
EXTRA_ARGS=""
# shellcheck disable=SC2155 # shellcheck disable=SC2155
readonly LAUNCHER=$(basename "${0}") readonly LAUNCHER=$(basename "${0}")
@ -1543,6 +1549,10 @@ else
USB_CONTROLLER="${2}" USB_CONTROLLER="${2}"
shift; shift;
shift;; shift;;
-extra_args|--extra_args)
EXTRA_ARGS="${2}"
shift;
shift;;
-version|--version) -version|--version)
echo "${VERSION}" echo "${VERSION}"
exit;; exit;;