Forked from ephemient/⁄etc⁄pacman.d⁄hooks⁄linux-modules-post.hook
Last active
February 16, 2023 16:15
-
-
Save varqox/a4e5abd490059844e0e521db531a9d8f to your computer and use it in GitHub Desktop.
(Arch Linux) Keep current modules around during kernel upgrade ("30" is in the name to run before DMKS remove ("90" for install) when upgrading kernel)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/sh | |
# Run: curl 'https://gist.githubusercontent.com/varqox/a4e5abd490059844e0e521db531a9d8f/raw/e69686e6b63791ef82fc3e182689986ffe838a53/INSTALL.sh' | sudo sh | |
curl 'https://gist.githubusercontent.com/varqox/a4e5abd490059844e0e521db531a9d8f/raw/85e25433f2f67576ea82b38a7cd461d424376901/%25E2%2581%2584usr%25E2%2581%2584share%25E2%2581%2584libalpm%25E2%2581%2584hooks%25E2%2581%258430-linux-modules-pre.hook' | sudo tee /usr/share/libalpm/hooks/30-linux-modules-pre.hook | |
curl 'https://gist.githubusercontent.com/varqox/a4e5abd490059844e0e521db531a9d8f/raw/85e25433f2f67576ea82b38a7cd461d424376901/%25E2%2581%2584usr%25E2%2581%2584share%25E2%2581%2584libalpm%25E2%2581%2584hooks%25E2%2581%258490-linux-modules-post.hook' | sudo tee /usr/share/libalpm/hooks/90-linux-modules-post.hook | |
curl 'https://gist.githubusercontent.com/varqox/a4e5abd490059844e0e521db531a9d8f/raw/85e25433f2f67576ea82b38a7cd461d424376901/%25E2%2581%2584etc%25E2%2581%2584tmpfiles.d%25E2%2581%2584linux-modules-cleanup.conf' | sudo tee /etc/tmpfiles.d/linux-modules-cleanup.conf | |
curl 'https://gist.githubusercontent.com/varqox/a4e5abd490059844e0e521db531a9d8f/raw/85e25433f2f67576ea82b38a7cd461d424376901/%25E2%2581%2584etc%25E2%2581%2584systemd%25E2%2581%2584system%25E2%2581%2584linux-modules-cleanup.service' | sudo tee /etc/systemd/system/linux-modules-cleanup.service | |
systemctl enable linux-modules-cleanup.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Clean up modules from old kernels | |
[Service] | |
Type=oneshot | |
ExecStart=/bin/bash -exc 'for i in /usr/lib/modules/[0-9]*; do if [[ $${i##*/} = \'%v\' ]] || pacman -Qo "$${i}"; then continue; fi; rsync -AHXal "$${i}" /usr/lib/modules/.old/; rm -rf "$${i}"; done' | |
[Install] | |
WantedBy=basic.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
R! /usr/lib/modules/.old/* - - - 4w |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment