void-packages/srcpkgs/dkms/files/kernel.d/dkms.prerm
Subhaditya Nath efe694ed36 dkms: update to 3.0.6
files/kernel.d/dkms.prerm has been updated to match the
kernel_prerm.d_dkms file distributed with dkms 3.0.6

Also, note that these dkms.conf directives have been deprecated since
dkms 2.8.8
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD

Also, note that the output of `dkms status` was changed in version 2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
2022-08-29 16:25:10 -04:00

19 lines
549 B
Bash

#!/bin/sh
# We're passed the version of the kernel being removed
PKGNAME="$1"
VERSION="$2"
if [ -x /usr/bin/dkms ]; then
/usr/bin/dkms status -k "$VERSION" 2>/dev/null | while IFS=" ,:/" read -r name vers _ arch status; do
[ "$status" = installed ] || continue
echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
/usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
done
fi
rmdir 2>/dev/null \
"/lib/modules/$VERSION/updates/dkms" \
"/lib/modules/$VERSION/updates"
exit 0