From affac5799d26cc01c95e02d63c54a6e8548f8b74 Mon Sep 17 00:00:00 2001 From: veilor-org Date: Mon, 4 May 2026 14:20:26 +0100 Subject: [PATCH] v0.5.26: log to /run, tolerate tee failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User hit `/usr/local/bin/veilor-installer: line 33: /usr/bin/tee: input/output error` on real-hardware install. Cause: LOG was `/var/log/veilor-installer.log`, which on the live ISO is backed by an overlay over squashfs. A bad sector / flaky USB → tee write fails → process substitution dies → installer aborts before the menu renders. Two changes: 1. Move LOG to /run/veilor-installer.log — pure tmpfs, never touches the live medium. Same path also unaffected by /var fill or overlay weirdness. 2. Wrap the `exec > >(tee -a $LOG) 2>&1` redirect in a writability probe. If the log can't be appended to (tmpfs OOM, fd exhaustion, anything), skip the tee and run the installer without on-disk persistence rather than crashing. Persistence is a nice-to-have for post-mortem debugging; the installer running is the must-have. This inverts the priority correctly. --- overlay/usr/local/bin/veilor-installer | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/overlay/usr/local/bin/veilor-installer b/overlay/usr/local/bin/veilor-installer index b957312..4f00fc2 100644 --- a/overlay/usr/local/bin/veilor-installer +++ b/overlay/usr/local/bin/veilor-installer @@ -17,7 +17,10 @@ set -uo pipefail export TERM="${TERM:-linux}" -LOG=/var/log/veilor-installer.log +# Log to /run (pure tmpfs) — /var/log overlays squashfs on the live ISO, so a +# bad sector on the USB medium turns `tee -a` into "input/output error" and +# kills the installer before the menu can render. +LOG=/run/veilor-installer.log # require_tty MUST run before the tee redirect — process substitution # replaces fd1 with a pipe, breaking `[[ -t 1 ]]`. @@ -29,8 +32,12 @@ require_tty() { } require_tty -# Now safe to tee output for log persistence — tty detection already passed. -exec > >(tee -a "$LOG") 2>&1 +# Tee output for log persistence, but only if LOG is writable. On a flaky USB +# the squashfs/overlay can throw I/O errors mid-write — tolerate that and +# keep the installer running without persistence rather than aborting. +if : >> "$LOG" 2>/dev/null; then + exec > >(tee -a "$LOG") 2>&1 +fi # ── Branded styling for gum ───────────────────────────────────────────── # colors.gum sets GUM_* env vars — pure-black palette from veilor-black KDE.