To reflect on these two quoted sentences, I have played around today on my EnOS Bios (legacy) installation, and created two pacman-hooks, that some here might find helpful…
Note to Newbies, ready to experiment: Pacman hooks are simple text-files, placed inside the folder /etc/pacman.d/hooks/ .
The suffix (filename-extension) must always be “.hook” for each file, to be carried out automtically by the system (not by the user).
[Action]
Description = Installing GRUB after grub-update…
Depends = grub
When = PostTransaction
Exec = /usr/bin/grub-install --target=i386 /dev/sda
As I am not in possession of any EFI (UEFI) -enabled computer, I cannot test possible solutions on my own for this. Also, there probably will be a lot of different solutions necessary for these systems, depending on their individual setup.
Perhaps, some here like to share their pacman-hooks to re-install GRUB on an EFI system, alongside presenting their individual solutions, as needed?
I just want to point out that as far as I know, there is no generic way to call grub-install that will work for all UEFI installs. Just calling grub-install --no-nvram with no additional arguments will probably work for most installs. The problem is that it also has the ability break your install depending on your specific configuration.
For hooks for grub-mkconfig there is a package in AUR called grub-hook which provides the hooks you need for that.
In that case, I might point out that I am not sure you need to run grub-mkconfig on Upgrade. In theory you should only need to run it on Install and Remove
After installing the hooks I provided above, an EnOS kernel-update shot my dual-boot with Arch Linux to death.
What happened? - Well, I wasn’t really aware, that EnOs, other than Arch Linux, has another - very important hook installed: 90-mkinitcpio-install.hook
So everyone, please all disregard my OP as a potentially good suggestion!!!
When copying those files I gave above to /etc/pacman.d/hooks/ it will lead to a situation that 90-mkinitcpio-install.hook will not be carried out on kernel updates and thus render the system un-bootable.