fix: Check for ACPI support before shutdown (#2135)

This commit is contained in:
Kroese
2026-08-13 23:15:11 +02:00
committed by GitHub
parent e832e705f9
commit ffec37e758
+20 -15
View File
@@ -259,9 +259,10 @@ legacyBootReady() {
ready() { ready() {
# The marker means installation completed previously, so shutdown no longer # The marker means installation completed previously, so shutdown
# needs to infer guest readiness from firmware output. # no longer needs to infer guest readiness from firmware output.
[ -f "$STORAGE/windows.boot" ] && return 0 [ -f "$STORAGE/windows.boot" ] && return 0
[ ! -s "$QEMU_PTY" ] && return 1 [ ! -s "$QEMU_PTY" ] && return 1
if [[ "${BOOT_MODE,,}" == "windows_legacy" ]]; then if [[ "${BOOT_MODE,,}" == "windows_legacy" ]]; then
@@ -346,11 +347,11 @@ sendKey() {
needsBootKey() { needsBootKey() {
[ ! -s "$BOOT" ] && return 1 [ ! -s "$BOOT" ] && return 1
[ -f "$STORAGE/windows.boot" ] && return 1
supportsBootKey "$DETECTED" hasCompletedInstall && return 1
supportsBootKey "$DETECTED" || return 1
return $? return 0
} }
bootKeyReady() { bootKeyReady() {
@@ -405,7 +406,10 @@ markWindowsBooted() {
fi fi
if ! disabled "$REMOVE"; then if ! disabled "$REMOVE"; then
removeImage "$BOOT" || : case "${BOOT,,}" in
*.img | *.raw | *.qcow2 ) ;;
* ) removeImage "$BOOT" || : ;;
esac
fi fi
rm -f "$STORAGE/setup.img" 2>/dev/null || : rm -f "$STORAGE/setup.img" 2>/dev/null || :
@@ -430,10 +434,7 @@ finish() {
markWindowsBooted markWindowsBooted
fi fi
cleanupHelpers \ cleanupHelpers "${SMB_PID:-}" "${NMB_PID:-}" "${DDN_PID:-}"
"${SMB_PID:-}" \
"${NMB_PID:-}" \
"${DDN_PID:-}"
if ! waitQemuExit 10; then if ! waitQemuExit 10; then
warn "Timed out while waiting for $(app) to exit!" warn "Timed out while waiting for $(app) to exit!"
@@ -455,14 +456,14 @@ abortDuringSetup() {
local code="$1" local code="$1"
# Before Windows boots from disk, ACPI may be ignored or interpreted by setup if [[ "${DETECTED,,}" == "reactos" ]] && hasSystemImage; then
# itself. Terminate QEMU directly instead of waiting for a graceful shutdown.
if [[ "${DETECTED,,}" != "reactos" ]] || [ -n "${CUSTOM:-}" ]; then
info "Cannot send ACPI signal during $(app) setup, terminating..."
else
info "ReactOS LiveCD does not support ACPI shutdown, terminating..." info "ReactOS LiveCD does not support ACPI shutdown, terminating..."
else
info "Cannot send ACPI signal during $(app) setup, terminating..."
fi fi
# Before Windows boots from disk, ACPI may be ignored or interpreted by setup
# itself. Terminate QEMU directly instead of waiting for a graceful shutdown.
terminateQemu terminateQemu
if ! waitQemuExit 10; then if ! waitQemuExit 10; then
@@ -520,6 +521,10 @@ gracefulShutdown() {
finish "$code" finish "$code"
fi fi
if ! supportsACPI "$DETECTED"; then
abortDuringSetup "$code"
fi
if ! ready; then if ! ready; then
abortDuringSetup "$code" abortDuringSetup "$code"
fi fi