Skip to content

Instantly share code, notes, and snippets.

@Waltibaba
Last active April 15, 2019 10:19
Show Gist options
  • Save Waltibaba/7e3c5b340ad6d1d81161870459419e22 to your computer and use it in GitHub Desktop.
Save Waltibaba/7e3c5b340ad6d1d81161870459419e22 to your computer and use it in GitHub Desktop.
/etc/pacman.d/hooks/. - pacman hooks for not killing the system when there's a kernel update.
/etc/pacman.d/hooks/backup-modules.hook
[Trigger]
Operation = Upgrade
Operation = Remove
Type = Package
Target = linux
[Action]
Depends = coreutils
Depends = bash
When = PreTransaction
Exec = /usr/bin/bash -c 'find /usr/lib/modules -maxdepth 1 -type l -delete; cp -a /usr/lib/modules/$(uname -r) /tmp 2>/dev/null || :'
/etc/pacman.d/hooks/upgrade-backup-modules.hook
[Trigger]
Operation = Remove
Operation = Upgrade
Type = Package
Target = linux
[Action]
Depends = coreutils
Depends = bash
When = PostTransaction
Exec = /usr/bin/bash -c '[[ -d /usr/lib/modules/$(uname -r) ]] || ln -s /tmp/$(uname -r) /usr/lib/modules/$(uname -r)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment