diff options
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 2 | ||||
-rw-r--r-- | kmodcache-post.hook | 8 | ||||
-rw-r--r-- | kmodcache-pre.hook | 8 | ||||
-rwxr-xr-x | pre-upgrade | 11 |
5 files changed, 17 insertions, 14 deletions
@@ -1,6 +1,6 @@ pkgbase = kmodcache pkgdesc = Scripts to make a copy of installed kernel modules, which will be used for on-demand loading from then point on, thus make reboots unnecessary after kernel updates. - pkgver = 1.3 + pkgver = 1.4 pkgrel = 1 arch = any license = GPL3 @@ -1,7 +1,7 @@ # Maintainer: Oliver Mangold <o.mangold@gmail.com> pkgname=kmodcache -pkgver=1.3 +pkgver=1.4 pkgrel=1 pkgdesc="Scripts to make a copy of installed kernel modules, which will be used for on-demand loading from then point on, thus make reboots unnecessary after kernel updates." arch=('any') diff --git a/kmodcache-post.hook b/kmodcache-post.hook index 5bdf3c465597..4b93778d5835 100644 --- a/kmodcache-post.hook +++ b/kmodcache-post.hook @@ -1,9 +1,9 @@ [Trigger] +Type = Path +Operation = Install Operation = Upgrade -Type = Package -Target = linux -Target = linux-* -Target = zfs-linux* +Operation = Remove +Target = usr/lib/modules/*/ [Action] Description = Adjust symlink to cache for kernel module directory diff --git a/kmodcache-pre.hook b/kmodcache-pre.hook index f1e10e66522a..cbccdcefe654 100644 --- a/kmodcache-pre.hook +++ b/kmodcache-pre.hook @@ -1,9 +1,9 @@ [Trigger] +Type = Path +Operation = Install Operation = Upgrade -Type = Package -Target = linux -Target = linux-* -Target = zfs-linux* +Operation = Remove +Target = usr/lib/modules/*/ [Action] Description = Copy old kernel module directory to cache diff --git a/pre-upgrade b/pre-upgrade index eb6b7abdc21a..d65b324b0f48 100755 --- a/pre-upgrade +++ b/pre-upgrade @@ -2,15 +2,18 @@ set -eu +shopt -s nullglob + read cur_osrelease </proc/sys/kernel/osrelease moddir=/usr/lib/modules/$cur_osrelease oldlink=$(readlink -m "$moddir") -if [ "${oldlink}" == /var/cache/kmods ]; then - rm "$moddir" - exit 0 -fi +for l in /usr/lib/modules/*; do + oldlink=$(readlink -m "$l") + [ "${oldlink}" == /var/cache/kmods ] || continue + rm "$l" +done if [ -e /var/cache/kmods/osrelease ]; then read prev_osrelease </var/cache/kmods/osrelease |