Skip to content

Instantly share code, notes, and snippets.

@ulidtko
Created June 30, 2019 12:24
Show Gist options
  • Save ulidtko/1d515c523ecdd1f79ac21b78c96626f8 to your computer and use it in GitHub Desktop.
Save ulidtko/1d515c523ecdd1f79ac21b78c96626f8 to your computer and use it in GitHub Desktop.
Keep Arch Linux fully functional after kernel updates
# /etc/tmpfiles.d/kmod-fridge-cleanup.conf
#Type Path Mode User Group Age Argument
D! /lib/modules/fridge 0755 root root -
#-- Inspired by #archlinux IRC & this thread:
# https://www.reddit.com/r/archlinux/comments/4zrsc3/keep_your_system_fully_functional_after_a_kernel/
#
#-- ulidtko, June 2019 [File 3/3]
# /etc/pacman.d/hooks/kmod-update-post.hook
[Trigger]
Type = Package
Target = linux{,-lts,-clear}
Operation = Upgrade
[Action]
Description = Revive current kernel's kmods wiped by the cruel pacman
When = PostTransaction
Exec = /bin/sh -c 'test -e "/lib/modules/fridge/$(uname -r)" && ln -sf fridge/$(uname -r) /lib/modules/$(uname -r)'
Depends = coreutils
#-- Inspired by #archlinux IRC & this thread:
# https://www.reddit.com/r/archlinux/comments/4zrsc3/keep_your_system_fully_functional_after_a_kernel/
#
#-- ulidtko, June 2019 [File 2/3]
# /etc/pacman.d/hooks/kmod-update-pre.hook
[Trigger]
Type = Package
Target = linux{,-lts,-clear}
Operation = Upgrade
Operation = Remove
[Action]
Description = Save current kernel's kmods
When = PreTransaction
Exec = /bin/sh -c 'test -e "/lib/modules/fridge/$(uname -r)" || cp -a "/lib/modules/$(uname -r)" /lib/modules/fridge/'
Depends = coreutils
#-- Inspired by #archlinux IRC & this thread:
# https://www.reddit.com/r/archlinux/comments/4zrsc3/keep_your_system_fully_functional_after_a_kernel/
#
#-- ulidtko, June 2019 [File 1/3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment