diff --git a/bin/omarchy-update-analyze-logs b/bin/omarchy-update-analyze-logs new file mode 100755 index 00000000..349506c5 --- /dev/null +++ b/bin/omarchy-update-analyze-logs @@ -0,0 +1,18 @@ +#!/bin/bash + +update_log="/tmp/omarchy-update.log" + +# Check for errors +if grep -qi "error" "$update_log"; then + echo -e "\e[31mNon-stopping errors detected during update:\e[0m" + grep -i "error" "$update_log" + echo +fi + +# Check for initramfs generation failure +if grep -q "Updating linux initcpios" "$update_log"; then + if ! grep -q "Initcpio image generation successful" "$update_log"; then + echo -e '\e[31mError: Initramfs generation may have failed. Review logs before restart.\e[0m' + echo + fi +fi diff --git a/bin/omarchy-update-perform b/bin/omarchy-update-perform index 82946cfd..c4fcc2cb 100755 --- a/bin/omarchy-update-perform +++ b/bin/omarchy-update-perform @@ -5,6 +5,9 @@ set -e # Ensure screensaver/sleep doesn't set in during updates hyprctl dispatch tagwindow +noidle &> /dev/null || true +# Capture update logs +exec > >(tee "/tmp/omarchy-update.log") 2>&1 + # Perform all update steps omarchy-update-time omarchy-update-keyring @@ -12,6 +15,9 @@ omarchy-update-available-reset omarchy-update-system-pkgs omarchy-migrate omarchy-hook post-update + +omarchy-update-analyze-logs + omarchy-update-restart # Re-enable screensaver/sleep after updates diff --git a/install/config/hardware/nvidia.sh b/install/config/hardware/nvidia.sh index 543174e2..125addf6 100644 --- a/install/config/hardware/nvidia.sh +++ b/install/config/hardware/nvidia.sh @@ -17,7 +17,7 @@ if [ -n "$NVIDIA" ]; then exit 0 fi - pacman -S --needed --noconfirm "$KERNEL_HEADERS" "${PACKAGES[@]}" + omarchy-pkg-add "$KERNEL_HEADERS" "${PACKAGES[@]}" # Configure modprobe for early KMS sudo tee /etc/modprobe.d/nvidia.conf </dev/null diff --git a/migrations/1766942230.sh b/migrations/1766942230.sh index cb780f32..7e51c021 100644 --- a/migrations/1766942230.sh +++ b/migrations/1766942230.sh @@ -3,6 +3,17 @@ echo "Migrate legacy NVIDIA GPUs to nvidia-580xx driver (if needed)" # Only migrate GTX 9xx or 10xx (Pascal/Maxwell) NVIDIA="$(lspci | grep -i 'nvidia')" if echo "$NVIDIA" | grep -qE "GTX 9|GTX 10"; then + if ! pacman -Qq | grep -qE '^linux(-[a-z0-9]+)?-headers$'; then + echo "Error: no linux headers package installed (required for DKMS drivers). Please install the appropriate headers and re-run this migration." + exit 1 + fi + # Piping yes to override existing packages yes | sudo pacman -S nvidia-580xx-dkms nvidia-580xx-utils lib32-nvidia-580xx-utils + + # Verify packages were installed + if ! pacman -Qq nvidia-580xx-dkms nvidia-580xx-utils lib32-nvidia-580xx-utils &>/dev/null; then + echo "Error: NVIDIA 580xx driver packages failed to install" + exit 1 + fi fi