dkms does not remove module config lines it adds

Bug #317238 reported by David Gaarenstroom
2
Affects Status Importance Assigned to Milestone
dkms (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: dkms

Description: Ubuntu 8.10
Release: 8.10
Platform: amd64

dkms:
  Installed: 2.0.20.4-0ubuntu2
  Candidate: 2.0.20.4-0ubuntu2
  Version table:
 *** 2.0.20.4-0ubuntu2 0
        500 http://nl.archive.ubuntu.com intrepid/main Packages
        100 /var/lib/dpkg/status

On an "ADD" event, dkms installs "MODULES_CONF" lines into /etc/modprobe.d/dkms
However, it does not remove these on an "REMOVE" event, because the dkms script lacks a reference to /etc/modprobe.d/dkms.

The following snippets from /usr/sbin/dkms says it all:
--8<--
function moduleconfig_add ()
{
    # $1 = kernel version

    local temp_dir_name=`mktemp -d $tmp_location/dkms.XXXXXX`
    modconfig_files=""
    [ -e /etc/modprobe.d/dkms ] && modconfig_files="/etc/modprobe.d/dkms"
    [ -e /etc/modules.conf ] && modconfig_files="/etc/modules.conf"
    [ -e /etc/modprobe.conf ] && modconfig_files="$modconfig_files /etc/modprobe
.conf"
--8<--

--8<--
function moduleconfig_remove ()
{
    # $1 = kernel version

    local temp_dir_name=`mktemp -d $tmp_location/dkms.XXXXXX`
    modconfig_files=""
    [ -e /etc/modules.conf ] && modconfig_files="/etc/modules.conf"
    [ -e /etc/modprobe.conf ] && modconfig_files="$modconfig_files /etc/modprobe.conf"
--8<--

As you can see, the moduleconfig_remove function doesn't do anything with /etc/modprobe.d/dkms at all.

By the way, if /etc/modules.conf exists, dkms is also completely forgotten about. I guess that for both functions, the following should be the best replacement code:

    [ -e /etc/modprobe.d/dkms ] && modconfig_files="/etc/modprobe.d/dkms"
    [ -e /etc/modules.conf ] && modconfig_files="$modconfig_files /etc/modules.conf"
    [ -e /etc/modprobe.conf ] && modconfig_files="$modconfig_files /etc/modprobe.conf"

Related branches

Revision history for this message
David Gaarenstroom (david-gaarenstroom) wrote :

The bug is in the original and current dkms, I notified the dkms mailing list.

Revision history for this message
Mario Limonciello (superm1) wrote :

As indicated, this was fixed from the patch on the mailing list. Thanks!

Changed in dkms:
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dkms - 2.0.21.0-0ubuntu1

---------------
dkms (2.0.21.0-0ubuntu1) jaunty; urgency=low

  [ Mario Limonciello ]
  * Don't output useless output on removal (LP: #274792)
  * Depend on linux-headers-generic | linux-headers so that depends are
    resolved for the majority case.
  * Improved bash completion.
  * Improvements to suse driver disk creation.
  * Use an unversioned dependency on bash. (LP: #314774)
  * Promote gcc to Depends (LP: #304014)
  * Set the default behavior to NOT use udevadm trigger. (LP: #320200)

  [ David Gaarenstroom ]
  * Check for /etc/modprobe.d/dkms not just /etc/modprobe.conf (LP: #317238)

  [ Alessio Igor Bogani ]
  * Fix path into man page (LP: #292289)

 -- Mario Limonciello <email address hidden> Thu, 09 Oct 2008 17:54:09 -0500

Changed in dkms:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.