Artix Linux Forum

Artix Linux => Tutorials and HOWTOs => Topic started by: lq on 09 June 2025, 04:30:26

Title: grub-install.hook
Post by: lq on 09 June 2025, 04:30:26

/etc/pacman.d/hooks/grub-install.hook

Code: [Select]
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Target = usr/share/grub/*

[Action]
Description = New GRUB features provided ...
When = PostTransaction
# Exec = /etc/pacman.d/scripts/update-efi
# Exec = /etc/pacman.d/scripts/update-mbr

/etc/pacman.d/scripts/update-mbr

Code: [Select]
#!/bin/bash
grub-install --target=i386-pc /dev/sda &&
grub-mkconfig -o /boot/grub/grub.cfg

/etc/pacman.d/scripts/update-efi

Code: [Select]
#!/bin/bash
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub &&
grub-mkconfig -o /boot/grub/grub.cfg