From 7a728e893bc2d0eba4d89e675b086530bf9ad1c0 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sat, 13 Jan 2024 20:43:58 -0500 Subject: [PATCH] Add pacman hook for automatically handling grub updates --- chrootInstall.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chrootInstall.sh b/chrootInstall.sh index ff38fdd..166901f 100755 --- a/chrootInstall.sh +++ b/chrootInstall.sh @@ -30,10 +30,13 @@ rc-update add NetworkManager # bootloader installation and configuration pacman -S grub efibootmgr os-prober mtools dosfstools --noconfirm +echo -e "[Trigger]\nOperation=Install\nOperation=Upgrade\nType=Package\nTarget=grub\n\n[Action]\nDescription=Re-install grub after package upgrade.\nWhen=PostTransaction\nNeedsTargets" > /etc/pacman.d/hooks/grub.hook if [ "$boot" == 1 ]; then + echo "Exec=/bin/sh -c 'grub-install --target=x86_64-efi --efi-directory=/boot/EFI --bootloader-id=GRUB --recheck && grub-mkconfig -o /boot/grub/grub.cfg'" >> /etc/pacman.d/hooks/grub.hook grub-install --target=x86_64-efi --efi-directory=/boot/EFI --bootloader-id=GRUB --recheck fi if [ "$boot" == 2 ]; then + echo "Exec=/bin/sh -c 'grub-install --target=i386-pc "$disk" && grub-mkconfig -o /boot/grub/grub.cfg'" >> /etc/pacman.d/hooks/grub.hook grub-install --target=i386-pc "$disk" fi cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo