various fixes

This commit is contained in:
2026-10-26 14:08:47 -06:00
parent a7310f4811
commit b284841f77
3 changed files with 18 additions and 9 deletions
+8 -1
View File
@@ -118,7 +118,14 @@ PACMAN_UPDATE_LOG="$HOME/.local/state/coredesktop/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)