From 836d775d3d7eafa386e559a5461a23ef6ad50a3a Mon Sep 17 00:00:00 2001 From: Levi Woodard Date: Wed, 20 May 2026 12:58:02 -0600 Subject: [PATCH] Adding in AMD fixes after framework install --- .gitignore | 2 ++ install.sh | 29 +++++++++++++++++++++++++++++ lib/common.sh | 2 +- lib/packages.sh | 6 +++++- 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5818083..c0fa6c8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ .idea/ .vscode/ .claude/settings.local.json +install.log +install.log.* diff --git a/install.sh b/install.sh index b11805d..b89193f 100755 --- a/install.sh +++ b/install.sh @@ -69,6 +69,10 @@ DOCTOR_ONLY=0 MODE_OVERRIDE="" INSTALL_CERTS=1 +# Capture args verbatim before the parse loop consumes them, so the install +# log can record what flags this invocation actually ran with. +ARGV_FOR_LOG="$*" + while [[ $# -gt 0 ]]; do case "$1" in --no-autostart) AUTOSTART=0 ;; @@ -111,7 +115,32 @@ compute_stream_mode() { STREAM_MODE="mirror" } +# Tee stdout+stderr to install.log (in the repo root) while still printing to +# the terminal. The log file gets ANSI escapes stripped so it stays readable +# with `less` / `grep`. Each run appends a header with timestamp + args, and +# an exit-status footer via the EXIT trap. Old logs auto-rotate at >5 MiB. +setup_install_log() { + local log="$SCRIPT_DIR/install.log" + if [[ -f "$log" ]] && [[ $(stat -c %s "$log" 2>/dev/null || echo 0) -gt 5242880 ]]; then + mv -f "$log" "$log.1" + fi + { + echo + echo "=== $(date -Iseconds) host=$(hostname) user=$(id -un) ===" + echo " args: ${ARGV_FOR_LOG:-(none)}" + } >> "$log" + + # stdout is about to become a pipe, so [[ -t 1 ]] in lib/common.sh would + # disable colors. FORCE_COLOR keeps the terminal output colored; sed strips + # ANSI from the log copy. + export FORCE_COLOR=1 + exec > >(tee >(sed -u 's/\x1b\[[0-9;]*m//g' >> "$log")) 2>&1 + + trap 'rc=$?; printf "=== exit=%s @ %s ===\n" "$rc" "$(date -Iseconds)" >> "'"$log"'"' EXIT +} + main() { + setup_install_log require_not_root require_arch require_yay diff --git a/lib/common.sh b/lib/common.sh index b280b95..80c1fd1 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Shared helpers: logging, sudo, preflight checks, idempotency primitives. -if [[ -t 1 ]]; then +if [[ -t 1 ]] || [[ "${FORCE_COLOR:-0}" == "1" ]]; then BOLD=$'\033[1m' DIM=$'\033[2m' RED=$'\033[31m' diff --git a/lib/packages.sh b/lib/packages.sh index 35181cc..5e2bcb6 100644 --- a/lib/packages.sh +++ b/lib/packages.sh @@ -80,7 +80,11 @@ install_gpu_encoder_packages() { ;; amd) # VAAPI (mesa) + Vulkan for AMD hardware encode paths. - yay_install libva-mesa-driver mesa-vdpau vulkan-radeon + # libva-mesa-driver is now provided by mesa (merged upstream); mesa-vdpau + # was removed from official repos. Naming them here makes yay fall back to + # AUR and pull in random forks like mesa-rk35xx-git that advertise + # `provides=(libva-mesa-driver mesa-vdpau)`. + yay_install mesa vulkan-radeon ;; intel) yay_install intel-media-driver vulkan-intel