mirror of
https://github.com/dockur/windows.git
synced 2026-08-03 12:37:20 +01: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/failed to load Boot/skipped Boot/g' \
|
||||||
-e 's/0): Not Found/0)/g' &
|
-e 's/0): Not Found/0)/g' &
|
||||||
|
|
||||||
|
output=$!
|
||||||
|
|
||||||
if ! enabled "$SHUTDOWN"; then
|
if ! enabled "$SHUTDOWN"; then
|
||||||
exec "${cmd[@]}" ${ARGS:+ $ARGS} >"$pipe"
|
exec "${cmd[@]}" ${ARGS:+ $ARGS} >"$pipe" 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"${cmd[@]}" ${ARGS:+ $ARGS} >"$pipe" &
|
"${cmd[@]}" ${ARGS:+ $ARGS} >"$pipe" 2>&1 &
|
||||||
|
|
||||||
pid=$!
|
pid=$!
|
||||||
( sleep 30; boot ) &
|
( sleep 30; boot ) &
|
||||||
|
|
||||||
rc=0
|
rc=0
|
||||||
wait "$pid" || rc=$?
|
wait "$pid" || rc=$?
|
||||||
|
wait "$output" || :
|
||||||
|
|
||||||
[ -f "$QEMU_END" ] && exit "$rc"
|
[ -f "$QEMU_END" ] && exit "$rc"
|
||||||
|
|
||||||
sleep 1 & wait $!
|
sleep 1 & wait $!
|
||||||
|
|||||||
+13
-1
@@ -186,6 +186,12 @@ cleanupHelpers() {
|
|||||||
finish() {
|
finish() {
|
||||||
|
|
||||||
local reason=$1
|
local reason=$1
|
||||||
|
local failed=0
|
||||||
|
|
||||||
|
if [ ! -f "$QEMU_END" ] && (( reason != 0 )); then
|
||||||
|
failed=1
|
||||||
|
fi
|
||||||
|
|
||||||
touch "$QEMU_END"
|
touch "$QEMU_END"
|
||||||
|
|
||||||
forceKillQemu "$reason"
|
forceKillQemu "$reason"
|
||||||
@@ -200,7 +206,13 @@ finish() {
|
|||||||
warn "Timed out while waiting for $(app) to exit!"
|
warn "Timed out while waiting for $(app) to exit!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
(( reason != 1 )) && echo && echo "❯ Shutdown completed!"
|
echo
|
||||||
|
|
||||||
|
if (( failed == 0 )); then
|
||||||
|
echo "❯ Shutdown completed!"
|
||||||
|
else
|
||||||
|
error "QEMU exited unexpectedly!"
|
||||||
|
fi
|
||||||
|
|
||||||
exit "$reason"
|
exit "$reason"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user