feat(installer): 10s reboot countdown with per-tick redraw
v0.5 used `sleep 5` after a static "System will reboot in 5 seconds." box, which left the operator guessing how much time was left to grab the USB stick. The new loop runs 10 → 1, clearing + redrawing the gum-style success box each tick with the remaining-seconds figure, giving the operator a visible window to act. 10 seconds (vs 5) because real hardware operators were missing the window — laptops with the USB on the far side of the dock take 4-5 seconds to physically reach. 10 is comfortable, not annoying.
This commit is contained in:
parent
767fe71a3a
commit
138a04702c
1 changed files with 17 additions and 6 deletions
|
|
@ -1037,12 +1037,23 @@ run_install() {
|
||||||
--show-output \
|
--show-output \
|
||||||
-- bash -c 'anaconda --cmdline --kickstart=/run/install/veilor-generated.ks 2>&1 | tee /tmp/anaconda-cmdline.log' || rc=$?
|
-- bash -c 'anaconda --cmdline --kickstart=/run/install/veilor-generated.ks 2>&1 | tee /tmp/anaconda-cmdline.log' || rc=$?
|
||||||
if [[ $rc -eq 0 ]]; then
|
if [[ $rc -eq 0 ]]; then
|
||||||
gum style --foreground 2 --border rounded --margin "1 2" --padding "1 3" \
|
# v0.6: 10-second redraw countdown so the operator knows
|
||||||
"✓ Install complete" \
|
# exactly when the reboot will fire (and has time to grab
|
||||||
"" \
|
# the USB stick before it boots back into the live ISO).
|
||||||
"System will reboot in 5 seconds." \
|
# Each tick clears + redraws the styled box with the new
|
||||||
"Remove the install media."
|
# remaining-seconds figure — no fancy in-place repaint, just
|
||||||
sleep 5
|
# a clean re-render via clear+gum-style which the linux
|
||||||
|
# fbcon handles without flicker.
|
||||||
|
local secs
|
||||||
|
for secs in 10 9 8 7 6 5 4 3 2 1; do
|
||||||
|
clear
|
||||||
|
gum style --foreground 2 --border rounded --margin "1 2" --padding "1 3" \
|
||||||
|
"✓ Install complete" \
|
||||||
|
"" \
|
||||||
|
"Rebooting in ${secs}s..." \
|
||||||
|
"Remove the install media."
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
systemctl reboot
|
systemctl reboot
|
||||||
else
|
else
|
||||||
prompt_error "Anaconda exited non-zero (status $rc).
|
prompt_error "Anaconda exited non-zero (status $rc).
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue