Debian Bug report logs - #586724
dkms: Removing kernel uninstalls, but doesn't remove, modules

version graph

Package: dkms; Maintainer for dkms is Dynamic Kernel Module System Team <dkms@packages.debian.org>; Source for dkms is src:dkms (PTS, buildd, popcon).

Reported by: Jan Muszynski <debianbugs@jancm.org>

Date: Mon, 21 Jun 2010 23:51:02 UTC

Severity: normal

Tags: patch

Found in version dkms/2.1.1.2-3

Fixed in version dkms/2.1.1.2-4

Done: Giuseppe Iuculano <iuculano@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Dynamic Kernel Modules Support Team <pkg-dkms-maint@lists.alioth.debian.org>:
Bug#586724; Package dkms. (Mon, 21 Jun 2010 23:51:04 GMT) (full text, mbox, link).


Acknowledgement sent to Jan Muszynski <debianbugs@jancm.org>:
New Bug report received and forwarded. Copy sent to Dynamic Kernel Modules Support Team <pkg-dkms-maint@lists.alioth.debian.org>. (Mon, 21 Jun 2010 23:51:05 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Jan Muszynski <debianbugs@jancm.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: dkms: Removing kernel uninstalls, but doesn't remove, modules
Date: Mon, 21 Jun 2010 19:47:08 -0400
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




Information forwarded to debian-bugs-dist@lists.debian.org, Dynamic Kernel Modules Support Team <pkg-dkms-maint@lists.alioth.debian.org>:
Bug#586724; Package dkms. (Sat, 17 Jul 2010 10:51:03 GMT) (full text, mbox, link).


Acknowledgement sent to Giuseppe Iuculano <iuculano@debian.org>:
Extra info received and forwarded to list. Copy sent to Dynamic Kernel Modules Support Team <pkg-dkms-maint@lists.alioth.debian.org>. (Sat, 17 Jul 2010 10:51:03 GMT) (full text, mbox, link).


Message #10 received at 586724@bugs.debian.org (full text, mbox, reply):

From: Giuseppe Iuculano <iuculano@debian.org>
To: 586724@bugs.debian.org,control@bugs.debian.org,586724-submitter@bugs.debian.org
Subject: [01c7c14] Fix for Bug#586724 committed to git
Date: Sat, 17 Jul 2010 10:46:42 +0000
tags 586724 + pending
thanks

Hello,

     The following change has been committed for this bug by
 Giuseppe Iuculano <iuculano@debian.org> on Sat, 17 Jul 2010 12:45:32 +0200.
 The fix will be in the next upload. 
=========================================================================
Remove old modules when removing a kernel

Closes: #586724
Thanks: Jan Muszynski

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.
=========================================================================

You can check the diff of the fix at:

    http://git.debian.org/?p=collab-maint/dkms.git;a=commitdiff;h=01c7c14






Added tag(s) pending. Request was from Giuseppe Iuculano <iuculano@debian.org> to control@bugs.debian.org. (Sat, 17 Jul 2010 10:51:05 GMT) (full text, mbox, link).


Message sent on to Jan Muszynski <debianbugs@jancm.org>:
Bug#586724. (Sat, 17 Jul 2010 10:51:07 GMT) (full text, mbox, link).


Reply sent to Giuseppe Iuculano <iuculano@debian.org>:
You have taken responsibility. (Sat, 17 Jul 2010 11:48:14 GMT) (full text, mbox, link).


Notification sent to Jan Muszynski <debianbugs@jancm.org>:
Bug acknowledged by developer. (Sat, 17 Jul 2010 11:48:15 GMT) (full text, mbox, link).


Message #20 received at 586724-close@bugs.debian.org (full text, mbox, reply):

From: Giuseppe Iuculano <iuculano@debian.org>
To: 586724-close@bugs.debian.org
Subject: Bug#586724: fixed in dkms 2.1.1.2-4
Date: Sat, 17 Jul 2010 11:47:07 +0000
Source: dkms
Source-Version: 2.1.1.2-4

We believe that the bug you reported is fixed in the latest version of
dkms, which is due to be installed in the Debian FTP archive:

dkms_2.1.1.2-4.debian.tar.gz
  to main/d/dkms/dkms_2.1.1.2-4.debian.tar.gz
dkms_2.1.1.2-4.dsc
  to main/d/dkms/dkms_2.1.1.2-4.dsc
dkms_2.1.1.2-4_all.deb
  to main/d/dkms/dkms_2.1.1.2-4_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 586724@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Giuseppe Iuculano <iuculano@debian.org> (supplier of updated dkms package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 17 Jul 2010 13:23:43 +0200
Source: dkms
Binary: dkms
Architecture: source all
Version: 2.1.1.2-4
Distribution: unstable
Urgency: low
Maintainer: Dynamic Kernel Modules Support Team <pkg-dkms-maint@lists.alioth.debian.org>
Changed-By: Giuseppe Iuculano <iuculano@debian.org>
Description: 
 dkms       - Dynamic Kernel Module Support Framework
Closes: 586356 586724 588585 589308
Changes: 
 dkms (2.1.1.2-4) unstable; urgency=low
 .
   * [f649aa1] Added coreutils >= 7.4 in Depends (Closes: #586356)
   * [01c7c14] Remove old modules when removing a kernel (Closes: #586724)
     - thanks to Jan Muszynski
   * [b6182ba] Bump to Standards-Version 3.9.0, no changes needed
   * [eaeddb3] dkms_common.postinst: handle dkms build error gracefully
     by skipping build for the non matching kernels. (Closes: #588585) -
     thanks to Jan-Marek Glogowski
   * [73533c2] Promote lsb-release to Pre-Depends (Closes: #589308)
Checksums-Sha1: 
 6349fd51e5c0a7ee1041b5f1a1ae570fb441a94f 1290 dkms_2.1.1.2-4.dsc
 5d912ca4badc741f7e9edc2949ff72073595df53 15839 dkms_2.1.1.2-4.debian.tar.gz
 ab9eca871ec666ca31ef6009e6ade129cd3a232e 70938 dkms_2.1.1.2-4_all.deb
Checksums-Sha256: 
 3e78a6f0f9f30f9ba32a9c33df767abebb63eee3d177cdfabd385bfa6f06bff6 1290 dkms_2.1.1.2-4.dsc
 b5b46a0a6bc56f6668e986fbfa06f494fec55fa9e675194337ace60569ca237c 15839 dkms_2.1.1.2-4.debian.tar.gz
 597e030d0a76effcdd0560fd19bac91fb0702ca4b937c0abd2797247777105cd 70938 dkms_2.1.1.2-4_all.deb
Files: 
 c9aaee1042f6c36a52c47594e265828e 1290 kernel optional dkms_2.1.1.2-4.dsc
 fe57813241b0c39cdb9a4524b6c4d1d1 15839 kernel optional dkms_2.1.1.2-4.debian.tar.gz
 744fdbe05976a70fe2d4da828117cb24 70938 kernel optional dkms_2.1.1.2-4_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkxBlJ0ACgkQNxpp46476ar78QCeO9KchCxp/bCHEV8MSUlO8uug
c+sAn2TZGcUJjEI6kxZinbW90cdX3d1I
=kBMO
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Wed, 25 Aug 2010 07:33:12 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jul 2 06:28:14 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.