diff --git a/bin/omarchy-upload-log b/bin/omarchy-upload-log index c4aa8cf4..975e6a6e 100755 --- a/bin/omarchy-upload-log +++ b/bin/omarchy-upload-log @@ -47,19 +47,24 @@ install) # exists, with /mnt taking precedence (only present in the ISO context, and # there it's the right one). ARCHINSTALL_LOG="/var/log/archinstall/install.log" - if [[ -s /mnt/var/log/omarchy-install.log ]]; then - OMARCHY_LOG="/mnt/var/log/omarchy-install.log" - else - OMARCHY_LOG="/var/log/omarchy-install.log" - fi + LIVE_OMARCHY_LOG="/var/log/omarchy-install.log" + TARGET_OMARCHY_LOG="/mnt/var/log/omarchy-install.log" cat "$SYSTEM_INFO" >"$TEMP_LOG" [[ -s $ARCHINSTALL_LOG ]] && cat "$ARCHINSTALL_LOG" >>"$TEMP_LOG" - if [[ -s $OMARCHY_LOG ]]; then - printf '\n========================================\nOMARCHY INSTALL LOG (%s)\n========================================\n\n' "$OMARCHY_LOG" >>"$TEMP_LOG" - cat "$OMARCHY_LOG" >>"$TEMP_LOG" - else - echo "Warning: omarchy install log not found (looked at /mnt/var/log/ and /var/log/)" >&2 + + if [[ -s $LIVE_OMARCHY_LOG ]]; then + printf '\n========================================\nOMARCHY INSTALL LOG (%s)\n========================================\n\n' "$LIVE_OMARCHY_LOG" >>"$TEMP_LOG" + cat "$LIVE_OMARCHY_LOG" >>"$TEMP_LOG" + fi + + if [[ -s $TARGET_OMARCHY_LOG ]] && ! cmp -s "$LIVE_OMARCHY_LOG" "$TARGET_OMARCHY_LOG" 2>/dev/null; then + printf '\n========================================\nTARGET OMARCHY INSTALL LOG (%s)\n========================================\n\n' "$TARGET_OMARCHY_LOG" >>"$TEMP_LOG" + cat "$TARGET_OMARCHY_LOG" >>"$TEMP_LOG" + fi + + if [[ ! -s $LIVE_OMARCHY_LOG && ! -s $TARGET_OMARCHY_LOG ]]; then + echo "Warning: omarchy install log not found (looked at /var/log and /mnt/var/log)" >&2 fi if [[ ! -s $TEMP_LOG ]]; then diff --git a/install/helpers/errors.sh b/install/helpers/errors.sh index 4a3d6945..996c785a 100644 --- a/install/helpers/errors.sh +++ b/install/helpers/errors.sh @@ -89,7 +89,6 @@ catch_errors() { 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:" @@ -168,7 +167,7 @@ exit_handler() { catch_errors "$exit_code" else stop_log_output - show_cursor + [[ -n ${OMARCHY_CHROOT_FINALIZER:-} ]] || show_cursor fi } diff --git a/install/helpers/presentation.sh b/install/helpers/presentation.sh index 3f4c0656..b6b27df0 100644 --- a/install/helpers/presentation.sh +++ b/install/helpers/presentation.sh @@ -5,7 +5,7 @@ fi # Get terminal size from /dev/tty (works in all scenarios: direct, sourced, or piped) if [[ -e /dev/tty ]]; then - TERM_SIZE=$(stty size 2>/dev/null /dev/null &1)" + +printf '%s\n' "$output" + +if [[ $output != *helpers-loaded* ]]; then + echo "expected helpers-loaded marker" >&2 + exit 1 +fi + +if [[ $output == *$'\033[?25h'* ]]; then + echo "offline finalizer helper bootstrap leaked cursor escape" >&2 + exit 1 +fi + +echo "offline finalizer bootstrap test passed"