initramfs fix

This commit is contained in:
David Young
2026-10-28 16:41:02 -06:00
parent 842225fd40
commit 7bbc6d0e2c
+8 -1
View File
@@ -104,7 +104,14 @@ PACMAN_UPDATE_LOG="$HOME/.local/state/miniserver/pacman-update.log"
initramfs_build_failed() { initramfs_build_failed() {
[ -f "$PACMAN_UPDATE_LOG" ] || return 1 [ -f "$PACMAN_UPDATE_LOG" ] || return 1
grep -q "Updating linux initcpios" "$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) # Install a script atomically (copy to a temp file, then rename over the target)