summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@canonical.com>2010-08-16 17:45:43 +0100
committerLeann Ogasawara <leann.ogasawara@canonical.com>2010-08-20 16:03:17 -0700
commitf15182e0f0b28d5a712fbacc96d941767f602720 (patch)
treea1feea14a1667c53d036de1c9289fb4cdf97c92b /debian
parent3193f8dbea1830cdcd3190be448a74ecc02e1b84 (diff)
UBUNTU: debian -- more agressivly clean up after depmod on purge
BugLink: http://bugs.launchpad.net/bugs/618591 During install we execute depmod to ensure we have the appropriate module supper indexes for the installed system, we are however required to clean up after it on uninstall. As depmod is provided by an external package changes in that package can lead to the kernel leaking files on uninstall, preventing a successful purge. Though we cannot know what files depmod does generate they (so far) all are prefixed with "modules." in /lib/modules/<version>/. The kernel binary packages do intentionally include two files with this prefix (modules.builtin and modules.order). As we know exactly which files we are carrying move to removing all other modules.* files when uninstalling to ensure we cleanup comprehensivly behind depmod. Also adds linkage between the two places where these files are now listed to ensure we keep them in lock-step. This should ensure that should new files be added to depmod's output set we should purge them automatically. Signed-off-by: Andy Whitcroft <apw@canonical.com> Acked-by: Tim Gardner <tim.gardner@canonical.com> Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Diffstat (limited to 'debian')
-rw-r--r--debian/control-scripts/prerm23
-rw-r--r--debian/rules.d/2-binary-arch.mk2
2 files changed, 12 insertions, 13 deletions
diff --git a/debian/control-scripts/prerm b/debian/control-scripts/prerm
index ae248dd67252..c2148424fce0 100644
--- a/debian/control-scripts/prerm
+++ b/debian/control-scripts/prerm
@@ -278,19 +278,16 @@ if (-d "/etc/kernel/prerm.d/$version") {
}
sub success () {
- my @files_to_remove = qw{
- modules.dep modules.isapnpmap modules.pcimap
- modules.usbmap modules.parportmap
- modules.generic_string modules.ieee1394map
- modules.ieee1394map modules.pnpbiosmap
- modules.alias modules.ccwmap modules.inputmap
- modules.symbols modules.ofmap modules.seriomap
- modules.alias.bin modules.builtin.bin modules.dep.bin modules.symbols.bin
- };
-
- foreach my $extra_file (@files_to_remove) {
- if (-f "/lib/modules/$version/$extra_file") {
- unlink "/lib/modules/$version/$extra_file";
+ # NOTE: need to keep this list in sync with rules.d/2-binary-arch.mk
+ my %files_to_keep = (
+ 'modules.builtin' => 1,
+ 'modules.order' => 1,
+ );
+ my $short;
+ for my $file (</lib/modules/$version/modules.*>) {
+ $short = $file; $short =~ s,.*/,,;
+ if (!defined $files_to_keep{$short}) {
+ unlink "$file";
}
}
exit 0;
diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index 6777b5e3f4a6..16656c0988d2 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -201,6 +201,8 @@ endif
#
# Remove files which are generated at installation by postinst,
# except for modules.order and modules.builtin
+ #
+ # NOTE: need to keep this list in sync with postrm
#
mkdir $(pkgdir)/lib/modules/$(abi_release)-$*/_
mv $(pkgdir)/lib/modules/$(abi_release)-$*/modules.order \