diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2018-08-16 17:20:19 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2018-08-16 17:20:19 -0400 |
commit | 6fc3d798272213ffbfaa526af748ffd0c94f5e62 (patch) | |
tree | 0b63d50282485f2c327e3e32c2fb34f8efa24382 | |
parent | 814fb5a60da22cca6f80e9efc53477609ab1b054 (diff) |
osi-shell: Allow setting qemu args
-rwxr-xr-x | osi-shell | 15 | ||||
-rwxr-xr-x | runtests | 2 |
2 files changed, 9 insertions, 8 deletions
@@ -8,6 +8,8 @@ source ./lib/osi.sh main() { local arg_mode=main + local arg_image= + local arg_qemu=() local args if ! args="$(getopt -n "${0##*/}" -o hV -l help,version -- "$@")"; then arg_mode=error @@ -23,15 +25,12 @@ main() { done case "$arg_mode" in main) - if (( $# != 1 )); then - if (( $# == 0 )); then - error 0 "Expected 1 positional argument, got none" - else - error 0 "Expected 1 positional argument, got %d: %s" "$#" "${*@Q}" - fi + if (( $# < 1 )); then + error 0 "Expected at least 1 positional argument, got none" arg_mode=error else arg_image=$1 + arg_qemu=("${@:2}") fi ;; esac @@ -43,7 +42,8 @@ main() { return 0 ;; usage) - print 'Usage: %s [OPTIONS] FILENAME.img [< SCRIPT.sh]' "${0##*/}" + print 'Usage: %s [OPTIONS] FILENAME.img [-- QEMU_ARGS...] [< SCRIPT.sh]' "${0##*/}" + print ' or: %s [OPTIONS] -- FILENAME.img [QEMU_ARGS...] [< SCRIPT.sh]' "${0##*/}" print 'Operating System Image: Interactive Shell' echo print 'OPTIONS:' @@ -65,6 +65,7 @@ main() { -drive media=disk,format=raw,if=virtio,file="$arg_image" \ -serial stdio \ -serial file:"$tmp/exit" \ + "${arg_qemu[@]}" \ < <(cat <"$tmp/sync" >/dev/null; cat; while sleep 0.1; do printf '\x04'; done) \ > >(read -r -N1 c; printf '%s' "$c"; :>"$tmp/sync"; exec cat) @@ -154,7 +154,7 @@ ${WORKDIR}/build-$(COMMIT)/build.log: %/build.log: %/build.raw EOF mv -T -- '$@.tmp' '$@' %/integration-tests.log: %/integration-tests.raw - ./osi-shell '$<' <<-'EOF' |& tee '$@.tmp' + ./osi-shell -- '$<' -m 1024 <<-'EOF' |& tee '$@.tmp' set -e mkdir -p /build mount --bind /var/lib/archbuild/default/testuser/build /build |