← Back to team overview

kernel-packages team mailing list archive

[Bug 151664] Re: DKMS uninstalls wrong file


The bug task for the somerville project has been removed by an automated
script.  This bug has been cloned on that project and is available here:

** No longer affects: somerville

You received this bug notification because you are a member of Kernel
Packages, which is subscribed to dkms in Ubuntu.

  DKMS uninstalls wrong file

Status in “dkms” package in Ubuntu:
  Fix Released

Bug description:
  DKMS and earlier has a bug whereby when running 'dkms
  uninstall', it will not delete the module previously installed into
  /lib/modules/$kernelver/updates/dkms/  but will instead delete the
  module at /lib/modules/$kernelver/kernel/drivers/... which is
  incorrect.  DKMS corrects this.

  In addition, DKMS invokes depmod after uninstalling a module
  so stale data is not retained, and invokes udevtrigger after
  installing a module for the currently-running kernel in case that
  module now enables a new device which udev should be aware of.

  DKMS is available in REVU at

  $ diffstat /tmp/dkms.patch
   Makefile             |    4 ++--
   dkms                 |   14 +++++++++++---
   dkms_autoinstaller   |    2 ++
   pkg/debian/changelog |    8 ++++++++
   4 files changed, 23 insertions, 5 deletions

  Package builds, installs, upgrades correctly.  Affected code paths
  tested.  Does not break other packages (none presently in Universe
  depend on it).

  File lists identical (after any substitutions)

  Control files: lines which differ (wdiff format)
  Version: [-] {+}

  The relevant changes are:
  diff --git a/dkms b/dkms
  index 13dbc54..c9b07c7 100755
  --- a/dkms
  +++ b/dkms
  @@ -1247,6 +1247,11 @@ function install_module()

  +    # Notify udev if we installed something for the currently running kernel
  +    if [ -x /sbin/udevtrigger -a "${kernelver_array[0]}" == "$(uname -r)" -a "${arch_array[0]}" == "$(uname -m)" ]; then
  +       /sbin/udevtrigger
  +    fi
       echo $""
       echo $"DKMS: install Completed."
  @@ -1451,9 +1456,9 @@ function possible_dest_module_locations()
       # override_dest_module_location() is what controls whether or not they're the same.

       local location
  -    location[0]="${DEST_MODULE_LOCATION[$count]}"
  -    [ "${location[0]}" != "${dest_module_location[$count]}" ] && \
  -       location[1]="${dest_module_location[$count]}"
  +    location[0]="${dest_module_location[$count]}"
  +    [ "${DEST_MODULE_LOCATION[$count]}" != "${dest_module_location[$count]}" ] && \
  +       location[1]="${DEST_MODULE_LOCATION[$count]}"

       echo "${location[0]} ${location[1]}"
  @@ -1581,6 +1586,9 @@ function do_uninstall()
       # But only do this if it was just ACTIVE on the kernel we just uninstalled from
       [ -n "$was_active" ] && [ -n "$remake_initrd" ] && $0 status -m $module -v $module_version | grep -q "installed" && modu
  leconfig_add "$1"

  +    # Run depmod because we changed /lib/modules
  +    invoke_command "depmod -a ${kernelver_array[0]}" "depmod" background
       echo $""
       echo $"DKMS: uninstall Completed."

To manage notifications about this bug go to: