Unverified Commit 071c5be7 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

Refactor QEMU execution

parent 59770d97
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -31,12 +31,7 @@ info "Booting image${BOOT_DESC} using QEMU v$version..."

[[ "$SHUTDOWN" != [Yy1]* ]] && exec qemu-system-x86_64 ${ARGS:+ $ARGS}

{ qemu-system-x86_64 ${ARGS:+ $ARGS} >"$QEMU_OUT" 2>"$QEMU_LOG"; rc=$?; } || :
(( rc != 0 )) && error "$(<"$QEMU_LOG")" && exit 15

terminal
tail -fn +0 "$QEMU_LOG" --pid=$$ 2>/dev/null &
socat STDIO,rawer,echo=0 FILE:"$QEMU_TERM",nonblock 2>/dev/null || :
qemu-system-x86_64 ${ARGS:+ $ARGS} </dev/tty >/dev/tty & wait $!

sleep 1 & wait $!
[ ! -f "$QEMU_END" ] && finish 0