[Pkg-dkms-maint] Bug#586724: dkms: Removing kernel uninstalls, but doesn't remove, modules
Jan Muszynski
debianbugs at jancm.org
Mon Jun 21 23:47:08 UTC 2010
Package: dkms
Version: 2.1.1.2-3
Severity: normal
Tags: patch
Basically just as the subject states. When removing a kernel it would be good to remove all the modules and not just uninstall them. Issuing a remove instead of an uninstall to dkms will cause the module to be uninstalled first (if it's not already), then removed. If the kernel is ever re-installed then dkims will rebuild the module as needed, so nothing is lost by removing the modules for a reomoved kernel, but you do run a cleaner system.
Patch is very simple:
---------start patch here------------
--- /etc/kernel/prerm.d/dkms.old 2010-06-04 09:33:33.000000000 -0400
+++ /etc/kernel/prerm.d/dkms 2010-06-15 09:22:22.607762648 -0400
@@ -8,8 +8,8 @@
name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
- echo "dkms: uninstalling: $name $vers ($inst_kern) ($arch)" >&2
- dkms uninstall -m $name -v $vers -k $inst_kern -a $arch
+ echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2
+ dkms remove -m $name -v $vers -k $inst_kern -a $arch
done < <(dkms status -k $inst_kern 2>/dev/null | grep ": installed")
fi
---------end patch here------------
I've tested and it works fine. Hmm - might want to change the grep so it handles any modules that exist (remove modules that have already been uninstalled). Just noticed that part. Can probably remove it althogether, but to be safe change it to 'egrep ": installed|: built"
Bottom line - keeping the modules for a removed kernel serves no useful purpose.
TIA, need any more information just ask.
-jcm
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (900, 'testing'), (100, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.34-02.i386vanilla (PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages dkms depends on:
ii build-essential 11.5 Informational list of build-essent
ii dpkg-dev 1.15.7.2 Debian package development tools
ii gcc 4:4.4.4-2 The GNU C compiler
ii make 3.81-8 An utility for Directing compilati
ii module-init-tools 3.12~pre2-3 tools for managing Linux kernel mo
Versions of packages dkms recommends:
ii fakeroot 1.14.4-1 Gives a fake root environment
ii linux-headers-2.6.32-5-686 2.6.32-15 Header files for Linux 2.6.32-5-68
ii linux-headers-2.6.34-0.dmz. 2.6.34-43 Header files for Linux 2.6.34-0.dm
ii linux-headers-2.6.34-02.i38 2010.163.jcm Header files related to Linux kern
ii linux-image-2.6.32-5-686 [l 2.6.32-15 Linux 2.6.32 for modern PCs
ii linux-image-2.6.34-0.dmz.12 2.6.34-43 Linux 2.6.34 for modern PCs
ii linux-image-2.6.34-02.i386v 2010.163.jcm Linux kernel binary image for vers
ii lsb-release 3.2-23.1 Linux Standard Base version report
ii menu 2.1.43 generates programs menu for all me
ii patch 2.6-2 Apply a diff file to an original
ii sudo 1.7.2p7-1 Provide limited super user privile
dkms suggests no packages.
-- Configuration Files:
/etc/kernel/prerm.d/dkms changed:
inst_kern=$1
if [ -x /usr/sbin/dkms ]; then
while read line; do
name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2
dkms remove -m $name -v $vers -k $inst_kern -a $arch
done < <(dkms status -k $inst_kern 2>/dev/null | grep ": installed")
fi
rmdir --ignore-fail-on-non-empty \
"/lib/modules/$inst_kern/updates/dkms" \
"/lib/modules/$inst_kern/updates" 2>/dev/null
exit 0
-- no debconf information
More information about the Pkg-dkms-maint
mailing list