summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD2
-rw-r--r--kmodcache-post.hook8
-rw-r--r--kmodcache-pre.hook8
-rwxr-xr-xpre-upgrade11
5 files changed, 17 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3c46cea88340..0d9c0161ee86 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -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
diff --git a/PKGBUILD b/PKGBUILD
index e36e64660b15..04b8f97728cb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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