linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] modprobe -q: quieter when modules missing
@ 2003-09-08  2:42 Rusty Russell
  0 siblings, 0 replies; only message in thread
From: Rusty Russell @ 2003-09-08  2:42 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Linus, please apply.  modprobe -q currently suppresses only "module
already loaded" messages, but in next release it also suppresses "no
such module" messages.

Name: Modprobe should be invoked with -q
Status: Tested on 2.6.0-test4-bk9

D: The kernel invokes "modprobe" on modules which might not exist:
D: rightfully, modprobe complains by default when this happens.  So
D: the correct response is to invoke "modprobe -q", which is silent on
D: such errors (but still reports other errors such as config errors).
D: Also, use MODULE_NAME_LEN from module.h instead of inventing our own.

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .24247-linux-2.6.0-test4-bk9/kernel/kmod.c .24247-linux-2.6.0-test4-bk9.updated/kernel/kmod.c
--- .24247-linux-2.6.0-test4-bk9/kernel/kmod.c	2003-06-23 10:52:59.000000000 +1000
+++ .24247-linux-2.6.0-test4-bk9.updated/kernel/kmod.c	2003-09-08 12:27:34.000000000 +1000
@@ -60,12 +60,11 @@ char modprobe_path[256] = "/sbin/modprob
  */
 int request_module(const char *fmt, ...)
 {
-#define MODULENAME_SIZE 32
 	va_list args;
-	char module_name[MODULENAME_SIZE];
+	char module_name[MODULE_NAME_LEN];
 	unsigned int max_modprobes;
 	int ret;
-	char *argv[] = { modprobe_path, "--", module_name, NULL };
+	char *argv[] = { modprobe_path, "-q", "--", module_name, NULL };
 	static char *envp[] = { "HOME=/",
 				"TERM=linux",
 				"PATH=/sbin:/usr/sbin:/bin:/usr/bin",
@@ -75,9 +74,9 @@ int request_module(const char *fmt, ...)
 	static int kmod_loop_msg;
 
 	va_start(args, fmt);
-	ret = vsnprintf(module_name, MODULENAME_SIZE, fmt, args);
+	ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args);
 	va_end(args);
-	if (ret >= MODULENAME_SIZE)
+	if (ret >= MODULE_NAME_LEN)
 		return -ENAMETOOLONG;
 
 	/* If modprobe needs a service that is in a module, we get a recursive

Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-09-08  2:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-08  2:42 [PATCH] modprobe -q: quieter when modules missing Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).