From e01c2334315828ae265856901946ba550d0a06ec Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Fri, 22 May 2026 19:15:06 -0400 Subject: [PATCH] installer: keep offline finalizer non-interactive --- install/helpers/errors.sh | 16 ++++++++++++++++ install/helpers/logging.sh | 5 +++++ install/post-install/finished.sh | 18 ++++++++++++------ install/preflight/guard.sh | 3 +++ 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/install/helpers/errors.sh b/install/helpers/errors.sh index 9ce8e266..ff5a3393 100644 --- a/install/helpers/errors.sh +++ b/install/helpers/errors.sh @@ -87,6 +87,22 @@ catch_errors() { fi stop_log_output + + if [[ -n ${OMARCHY_CHROOT_FINALIZER:-} ]]; then + show_cursor + { + echo "Omarchy installation stopped inside offline finalizer." + echo "This command halted with exit code $exit_code:" + if [[ -n ${CURRENT_SCRIPT:-} ]]; then + echo "Failed script: $CURRENT_SCRIPT" + else + echo "$BASH_COMMAND" + fi + echo "The live ISO orchestrator will show the visible error screen." + } >&2 + exit "$exit_code" + fi + restore_outputs clear_logo diff --git a/install/helpers/logging.sh b/install/helpers/logging.sh index 9250d785..3030e986 100644 --- a/install/helpers/logging.sh +++ b/install/helpers/logging.sh @@ -1,4 +1,9 @@ start_log_output() { + # Offline ISO installs already have a live dashboard on tty1. The chrooted + # finalizer's stdout/stderr is captured to logs, so this monitor would only + # create noisy feedback in the log and burn CPU. + [[ -n ${OMARCHY_CHROOT_FINALIZER:-} ]] && return 0 + local ANSI_SAVE_CURSOR="\033[s" local ANSI_RESTORE_CURSOR="\033[u" local ANSI_CLEAR_LINE="\033[2K" diff --git a/install/post-install/finished.sh b/install/post-install/finished.sh index c8f930d9..24c0d5e4 100644 --- a/install/post-install/finished.sh +++ b/install/post-install/finished.sh @@ -1,5 +1,16 @@ stop_install_log +# Offline ISO installs run inside arch-chroot while the live ISO orchestrator +# owns the visible UI. Never prompt from here: stdout/stderr may be captured to +# logs, leaving gum waiting invisibly on /dev/tty. The live orchestrator shows +# the final "installed in ... / reboot" screen after validation. +if install_mode_is offline; then + # Never risk an interactive sudo prompt in the chrooted ISO route. The + # orchestrator removes this shim after finalize.sh returns. + touch /var/tmp/omarchy-install-completed + return 0 2>/dev/null || exit 0 +fi + echo_in_style() { echo "$1" | tte --canvas-width 0 --anchor-text c --frame-rate 640 print } @@ -29,10 +40,5 @@ if gum confirm --padding "0 0 0 $((PADDING_LEFT + 32))" --show-help=false --defa # Clear screen to hide any shutdown messages clear - if install_mode_is offline; then - touch /var/tmp/omarchy-install-completed - exit 0 - else - sudo reboot 2>/dev/null - fi + sudo reboot 2>/dev/null fi diff --git a/install/preflight/guard.sh b/install/preflight/guard.sh index 782614fd..9d2551c7 100644 --- a/install/preflight/guard.sh +++ b/install/preflight/guard.sh @@ -1,6 +1,9 @@ abort() { echo -e "\e[31mOmarchy install requires: $1\e[0m" echo + if [[ -n ${OMARCHY_CHROOT_FINALIZER:-} ]]; then + exit 1 + fi gum confirm "Proceed anyway on your own accord and without assistance?" || exit 1 }