summaryrefslogtreecommitdiffstats
path: root/kernel_prerm.d_dkms
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:20:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:20:55 +0000
commitc2c09589f14ac77fd4e29ca36483dfd80c439074 (patch)
treee102666aaa612a28c16dcd4097466764e97ba96a /kernel_prerm.d_dkms
parentInitial commit. (diff)
downloaddkms-c2c09589f14ac77fd4e29ca36483dfd80c439074.tar.xz
dkms-c2c09589f14ac77fd4e29ca36483dfd80c439074.zip
Adding upstream version 3.0.10.upstream/3.0.10upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'kernel_prerm.d_dkms')
-rwxr-xr-xkernel_prerm.d_dkms18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel_prerm.d_dkms b/kernel_prerm.d_dkms
new file mode 100755
index 0000000..aeb8e3a
--- /dev/null
+++ b/kernel_prerm.d_dkms
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# We're passed the version of the kernel being removed
+inst_kern=$1
+
+if command -v dkms > /dev/null; then
+ dkms status -k "$inst_kern" 2>/dev/null | while IFS=",:/ " read -r name vers _ arch status; do
+ [ "$status" = "installed" ] || continue
+ echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2
+ dkms remove -m "$name" -v "$vers" -k "$inst_kern" -a "$arch"
+ done
+fi
+
+rmdir --ignore-fail-on-non-empty \
+ "/lib/modules/$inst_kern/updates/dkms" \
+ "/lib/modules/$inst_kern/updates" 2>/dev/null
+
+exit 0