DKMS 2.0.17.4 uninstalls wrong file

Bug #151664 reported by Matt Domsch
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dkms (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

DKMS 2.0.17.4 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 2.0.17.5 corrects this.

In addition, DKMS 2.0.17.5 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 2.0.17.5 is available in REVU at http://revu.tauware.de/details.py?upid=376

$ 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).

debdiff:
File lists identical (after any substitutions)

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

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()
        fi
     fi

+ # 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."
 }

Tags: upgrade
description: updated
Changed in dell:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 151664] Re: DKMS 2.0.17.4 uninstalls wrong file

Is this something you can provide a patch to the existing version to fix?

Revision history for this message
Matt Domsch (matt-domsch) wrote :

I'm upstream, so I just released a new upstream. a 2.0.17.4-0ubuntu2 with the patch would be identical to 2.0.17.5-0.ubuntu1. But I'll do whatever is needed to get it uploaded. Please advise.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Ack for a UVFe from me. I can upload a patch version if no one else acks.
If you would prepare an ubuntu2 debdiff and attach it to this bug, it'd be
a big help.

Revision history for this message
Matt Domsch (matt-domsch) wrote :

Here's a debdiff bumping to 2.0.17.4-0ubuntu2.
Thanks for your help!
-Matt

Revision history for this message
Scott Kitterman (kitterman) wrote :

I'll deal with this as a revision. No need for UVFe. Unsubscribing motu-uvf.

Changed in dkms:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Scott Kitterman (kitterman) wrote :

Uploaded.

Changed in dkms:
status: Confirmed → Fix Committed
Changed in dell:
status: Confirmed → Fix Committed
Changed in dkms:
status: Fix Committed → Fix Released
Changed in dell:
status: Fix Committed → Fix Released
Changed in somerville:
importance: Undecided → Medium
status: New → Fix Released
no longer affects: dell
Revision history for this message
Timothy R. Chavez (timrchavez) wrote :

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: https://bugs.launchpad.net/bugs/1305815

no longer affects: somerville
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.