1
When removing a kernel it would be good to remove all the modules and not just uninstall them.
2
Issuing a remove instead of an uninstall to dkms will cause the module to be uninstalled first
3
(if it's not already), then removed. If the kernel is ever re-installed then dkims will
4
rebuild the module as needed, so nothing is lost by removing the modules for a
5
reomoved kernel, but you do run a cleaner system.
7
--- a/kernel_prerm.d_dkms
8
+++ b/kernel_prerm.d_dkms
9
@@ -8,8 +8,8 @@ while read line; do
10
name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
11
vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
12
arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
13
- echo "dkms: uninstalling: $name $vers ($inst_kern) ($arch)" >&2
14
- dkms uninstall -m $name -v $vers -k $inst_kern -a $arch
15
+ echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2
16
+ dkms remove -m $name -v $vers -k $inst_kern -a $arch
17
done < <(dkms status -k $inst_kern 2>/dev/null | grep ": installed")