From 7bbc6d0e2cc46556374bb87745790055cbf9f5bf Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 28 Oct 2026 16:41:02 -0600 Subject: [PATCH] initramfs fix --- utils.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utils.sh b/utils.sh index 6fe60a0..d9e8595 100755 --- a/utils.sh +++ b/utils.sh @@ -104,7 +104,14 @@ PACMAN_UPDATE_LOG="$HOME/.local/state/miniserver/pacman-update.log" initramfs_build_failed() { [ -f "$PACMAN_UPDATE_LOG" ] || return 1 grep -q "Updating linux initcpios" "$PACMAN_UPDATE_LOG" || return 1 - grep -q "==> ERROR" "$PACMAN_UPDATE_LOG" || ! grep -q "Image generation successful" "$PACMAN_UPDATE_LOG" + grep -q "==> ERROR" "$PACMAN_UPDATE_LOG" && return 0 + + # Every image built must report success. Older mkinitcpio says "==> Image + # generation successful", newer says "==> Initcpio image generation successful". + local built succeeded + built="$(grep -c "==> Building image from preset" "$PACMAN_UPDATE_LOG")" + succeeded="$(grep -cE "==> (Initcpio i|I)mage generation successful" "$PACMAN_UPDATE_LOG")" + (( succeeded == 0 || succeeded < built )) } # Install a script atomically (copy to a temp file, then rename over the target)