~ubuntu-branches/ubuntu/oneiric/dkms/oneiric

« back to all changes in this revision

Viewing changes to debian/patches/remove-old-mod.patch

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2010-10-25 01:32:41 UTC
  • mfrom: (2.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20101025013241-cw5ulnje1j2j4rco
Tags: 2.1.1.2-5ubuntu1
* Merge from Debian unstable, remaining changes:
  - debian/control:
    - depend on patch instead of recommending it, if its missing
      the "patches" feature of dkms will no longer work and that
      will cause build failures (LP: #653899)
  - debian/patches/improve-the-logic-behind-kernels-detection.patch:
    - Before using the current kernel we need to make sure that this
      kernel doesn't belong to the host of a chroot and we should
      also be more careful when adding kernels to the candidates
      list (LP: #602408).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
When removing a kernel it would be good to remove all the modules and not just uninstall them.
 
2
Issuing a remove instead of an uninstall to dkms will cause the module to be uninstalled first
 
3
(if it's not already), then removed. If the kernel is ever re-installed then dkims will
 
4
rebuild the module as needed, so nothing is lost by removing the modules for a
 
5
reomoved kernel, but you do run a cleaner system.
 
6
 
 
7
--- a/kernel_prerm.d_dkms
 
8
+++ b/kernel_prerm.d_dkms
 
9
@@ -8,8 +8,8 @@ while read line; do
 
10
    name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
 
11
    vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
 
12
    arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
 
13
-   echo "dkms: uninstalling: $name $vers ($inst_kern) ($arch)" >&2
 
14
-   dkms uninstall -m $name -v $vers -k $inst_kern -a $arch
 
15
+   echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2
 
16
+   dkms remove -m $name -v $vers -k $inst_kern -a $arch
 
17
 done < <(dkms status -k $inst_kern 2>/dev/null | grep ": installed")
 
18
 fi
 
19