1 Commits

Author SHA1 Message Date
462eef9828 initramfs: Refactor alpm hooks to prevent harmless errors on kernel installation
Based on the way kdumpst alpm hooks were coded, we have currently one hook
per initrd system supported (mkinitcpio, mkinitcpio-git, dracut). When a
kernel package is installed/upgraded/removed, all of them are triggered;
but usually users only have one initrd system (enough headaches with just
one, imagine having more heh).

The net effect of this, due to the "verbiage" of alpm, is that harmless
error messages were shown, like the following one:

"error: unable to run hook 99-kdump-dracut.hook: could not satisfy
dependencies"

This one was quite common since the vast majority of Arch users rely
on mkinitcpio. And this message would show at *every* kernel package
operation, leading users to wonder what's wrong (may they pay attention
to error messages, of course).

In order to fix that, we hereby follow a great and simple suggestion from
Antiz at #archlinux-projects/Libera (thanks!): let's use a shell call to
encompass the tests for different initrd systems. With that, was easy also
to remove the redundant mkinitcpio-git hook. No functional change should
be expected from this change.

Closes: #14 ("Minimal initramfs pacman hooks should not present error messages on different init systems")
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
2024-01-05 17:08:16 -03:00