Advertisement
Guest User

Untitled

a guest
Apr 11th, 2025
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. # Reinstall grub after a package update, and update the /boot/grub/grub.cfg file
  2.  
  3. # This hook is intended to prevent one's system of becoming unbootable after a package upgrade
  4.  
  5. # Depending on how you installed grub, what shell you use and what is your ESP, adjust this file accordingly!
  6.  
  7. # Also, a pacman update will probably overwrite any customizations done to the /etc/default/grub file and files inside /etc/grub.d/
  8. # In this case, reimplement your customizations and re-run the grub-mkconfig command
  9.  
  10. [Trigger]
  11. Operation = Install
  12. Operation = Upgrade
  13. Type = Package
  14. Target = grub
  15.  
  16. [Action]
  17. Description = Reinstalling and configuring grub...
  18. When = PostTransaction
  19. Depends = grub
  20. Depends = bash
  21. Exec = /usr/bin/bash -c 'echo; /usr/bin/grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB; echo; /usr/bin/grub-mkconfig -o /boot/grub/grub.cfg; echo'
  22. # Suggestion to run more than one command in a single hook found here: https://bbs.archlinux.org/viewtopic.php?pid=1797121#p1797121
  23.  
  24. # https://wiki.archlinux.org/title/GRUB#Installation
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement