Subject: [PATCH] Warn about non .conf files in /etc/modprobe.d

From: Raphael Geissert <[email-masked]>
Date: Sat, 2 May 2009 20:37:53 -0500

Current version of module-init-tools warns loudly when it encounters
such files, but there are no details as to whether future versions will
continue warning or completely ignore them.
---
 checks/files                                |    4 ++++
 checks/files.desc                           |   11 +++++++++++
 t/tests/files-general/debian/debian/install |    2 +-
 t/tests/files-general/desc                  |    1 +
 t/tests/files-general/tags                  |    1 +
 5 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/checks/files b/checks/files
index 897c965..02eae4b 100644
--- a/checks/files
+++ b/checks/files
@@ -236,6 +236,10 @@ foreach my $file (sort keys %{$info->index}) {
 	    tag "non-standard-file-permissions-for-etc-init.d-script",
 		sprintf("$file %04o != 0755",$operm);
 	}
+	# ---------------- /etc/modprobe.d
+	elsif ($file =~ m,^etc/modprobe\.d/.+(?!\.conf)$, and $index_info->{type} !~ m/^d/) {
+	    tag "non-conf-file-in-modprobe.d", $file;
+	}
 	#----------------- /etc/pam.conf
 	elsif ($file =~ m,^etc/pam.conf, and $pkg ne "libpam-runtime" ) {
 	    tag "config-file-reserved", "$file by libpam-runtime";
diff --git a/checks/files.desc b/checks/files.desc
index e914d34..c60127b 100644
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -970,3 +970,14 @@ Info: The given file ends with <tt>.gz</tt>, which normally indicates it
  gzip-compressed file.  gzip will fail with an error on such files.
  Normally this indicates a mistake in the installation process of the
  package.
+
+Tag: non-conf-file-in-modprobe.d
+Severity: important
+Certainty: certain
+Ref: http://lists.debian.org/debian-devel/2009/03/msg00119.html
+Info: Files in <tt>/etc/modprobe.d</tt> that do not have a <tt>.conf</tt>
+ suffix are no longer processed by certain (including future) versions of
+ module-init-tools/modprobe.
+ .
+ It is discouraged to ship comments-only files in that directory as they are
+ read each and every time modprobe is run (which is often at boot time.)
diff --git a/t/tests/files-general/debian/debian/install b/t/tests/files-general/debian/debian/install
index a250062..3ff9c84 100644
--- a/t/tests/files-general/debian/debian/install
+++ b/t/tests/files-general/debian/debian/install
@@ -1,3 +1,3 @@
 lintian-16x16.png usr/share/apps/lintian/icons/hicolor/22x22
 lintian-22x22.png usr/share/apps/lintian/icons/hicolor/22x22
---lzma usr/share/doc/lintian
+--lzma etc/modprobe.d/
diff --git a/t/tests/files-general/desc b/t/tests/files-general/desc
index 90dce6c..4539d78 100644
--- a/t/tests/files-general/desc
+++ b/t/tests/files-general/desc
@@ -6,3 +6,4 @@ Test-For:
  dir-or-file-in-var-lock
  dir-or-file-in-var-run
  icon-size-and-directory-name-mismatch
+ non-conf-file-in-modprobe.d
diff --git a/t/tests/files-general/tags b/t/tests/files-general/tags
index 677feae..d72c75b 100644
--- a/t/tests/files-general/tags
+++ b/t/tests/files-general/tags
@@ -1,3 +1,4 @@
 E: files-general: dir-or-file-in-var-lock var/lock/lintian/
 E: files-general: dir-or-file-in-var-run var/run/lintian/
+E: files-general: non-conf-file-in-modprobe.d etc/modprobe.d/--lzma
 W: files-general: icon-size-and-directory-name-mismatch usr/share/apps/lintian/icons/hicolor/22x22/lintian-16x16.png 16x16