From: Rusty Russell <rusty@rustcorp.com.au>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] modprobe -q: quieter when modules missing
Date: Mon, 08 Sep 2003 12:42:27 +1000 [thread overview]
Message-ID: <20030908024303.36AF72C186@lists.samba.org> (raw)
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.
reply other threads:[~2003-09-08 2:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030908024303.36AF72C186@lists.samba.org \
--to=rusty@rustcorp.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox