mirror of
https://github.com/dockur/windows.git
synced 2026-07-27 21:42:36 +07:00
fix: Show QEMU errors on unexpected exit (#1873)
This commit is contained in:
+6
-2
@@ -47,17 +47,21 @@ sed -u \
|
||||
-e 's/failed to load Boot/skipped Boot/g' \
|
||||
-e 's/0): Not Found/0)/g' &
|
||||
|
||||
output=$!
|
||||
|
||||
if ! enabled "$SHUTDOWN"; then
|
||||
exec "${cmd[@]}" ${ARGS:+ $ARGS} >"$pipe"
|
||||
exec "${cmd[@]}" ${ARGS:+ $ARGS} >"$pipe" 2>&1
|
||||
fi
|
||||
|
||||
"${cmd[@]}" ${ARGS:+ $ARGS} >"$pipe" &
|
||||
"${cmd[@]}" ${ARGS:+ $ARGS} >"$pipe" 2>&1 &
|
||||
|
||||
pid=$!
|
||||
( sleep 30; boot ) &
|
||||
|
||||
rc=0
|
||||
wait "$pid" || rc=$?
|
||||
wait "$output" || :
|
||||
|
||||
[ -f "$QEMU_END" ] && exit "$rc"
|
||||
|
||||
sleep 1 & wait $!
|
||||
|
||||
+13
-1
@@ -186,6 +186,12 @@ cleanupHelpers() {
|
||||
finish() {
|
||||
|
||||
local reason=$1
|
||||
local failed=0
|
||||
|
||||
if [ ! -f "$QEMU_END" ] && (( reason != 0 )); then
|
||||
failed=1
|
||||
fi
|
||||
|
||||
touch "$QEMU_END"
|
||||
|
||||
forceKillQemu "$reason"
|
||||
@@ -200,7 +206,13 @@ finish() {
|
||||
warn "Timed out while waiting for $(app) to exit!"
|
||||
fi
|
||||
|
||||
(( reason != 1 )) && echo && echo "❯ Shutdown completed!"
|
||||
echo
|
||||
|
||||
if (( failed == 0 )); then
|
||||
echo "❯ Shutdown completed!"
|
||||
else
|
||||
error "QEMU exited unexpectedly!"
|
||||
fi
|
||||
|
||||
exit "$reason"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user