installer: stop dashboard before finish prompt
This commit is contained in:
1 file changed
+9
-6
@@ -178,7 +178,7 @@ print(min(100, start + active), end='')
|
|||||||
PY
|
PY
|
||||||
}
|
}
|
||||||
|
|
||||||
install_finished() {
|
dashboard_should_stop() {
|
||||||
[[ -f $STATE_FILE ]] || return 1
|
[[ -f $STATE_FILE ]] || return 1
|
||||||
python - "$STATE_FILE" <<'PY' 2>/dev/null
|
python - "$STATE_FILE" <<'PY' 2>/dev/null
|
||||||
import json, sys
|
import json, sys
|
||||||
@@ -186,7 +186,11 @@ try:
|
|||||||
state = json.load(open(sys.argv[1]))
|
state = json.load(open(sys.argv[1]))
|
||||||
except Exception:
|
except Exception:
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
raise SystemExit(0 if state.get('finished_at') else 1)
|
phase = state.get('current_phase')
|
||||||
|
# The final installed-time/reboot prompt is rendered inside the Finishing
|
||||||
|
# phase. Stop before drawing another dashboard frame so the prompt cannot be
|
||||||
|
# covered while it waits for input.
|
||||||
|
raise SystemExit(0 if state.get('finished_at') or phase in ('Finishing', 'Installation complete') else 1)
|
||||||
PY
|
PY
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,11 +251,10 @@ render_static >"$TTY_PATH"
|
|||||||
frame=0
|
frame=0
|
||||||
while true; do
|
while true; do
|
||||||
[[ -e $STOP_FILE ]] && break
|
[[ -e $STOP_FILE ]] && break
|
||||||
|
dashboard_should_stop && break
|
||||||
render_dynamic "$frame" >"$TTY_PATH"
|
render_dynamic "$frame" >"$TTY_PATH"
|
||||||
if install_finished || [[ -e $STOP_FILE ]]; then
|
[[ -e $STOP_FILE ]] && break
|
||||||
sleep 1
|
dashboard_should_stop && break
|
||||||
break
|
|
||||||
fi
|
|
||||||
frame=$((frame + 1))
|
frame=$((frame + 1))
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
done
|
done
|
||||||
Reference in new issue
Block a user