From: Laura Abbott <labbott@fedoraproject.org>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Laura Abbott <labbott@fedoraproject.org>, linux-modules@vger.kernel.org
Subject: [PATCH 2/4] modprobe: Add appropriate error message when path is missing
Date: Fri, 11 Sep 2015 13:55:54 -0700 [thread overview]
Message-ID: <1442004956-3868-3-git-send-email-labbott@fedoraproject.org> (raw)
In-Reply-To: <1442004956-3868-1-git-send-email-labbott@fedoraproject.org>
Currently, modprobe fails with no output by default if the
search paths it tries are missing:
$ modprobe -S notakernel dm-crypt
$
$ modprobe -S notakernel lkjjweiojo
$
This is fairly cryptic and not at all obvious there is a problem
unless the error code is checked or verbose flags are used.
Add a message to give a better idea that something went wrong.
---
tools/modprobe.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/modprobe.c b/tools/modprobe.c
index 3ba8f52..b50a385 100644
--- a/tools/modprobe.c
+++ b/tools/modprobe.c
@@ -489,8 +489,11 @@ static int insmod(struct kmod_ctx *ctx, const char *alias,
const char *options) = NULL;
err = kmod_module_new_from_lookup(ctx, alias, &list);
- if (err < 0)
+ if (err < 0) {
+ ERR("Could not generate list of modules from context\n");
+ ERR("(Is your version correct)?)\n");
return err;
+ }
if (list == NULL) {
LOG("Module %s not found.\n", alias);
--
2.4.3
next prev parent reply other threads:[~2015-09-11 20:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-11 20:55 [PATCH 0/4] depmod and modprobe error message fixups Laura Abbott
2015-09-11 20:55 ` [PATCH 1/4] build: Properly check for Cython Laura Abbott
2015-09-12 18:27 ` Lucas De Marchi
2015-09-18 17:38 ` Laura Abbott
2015-09-24 1:11 ` Lucas De Marchi
2015-09-11 20:55 ` Laura Abbott [this message]
2015-09-12 18:45 ` [PATCH 2/4] modprobe: Add appropriate error message when path is missing Lucas De Marchi
2015-09-11 20:55 ` [PATCH 3/4] depmod: Fix message printing before log_setup_kmod_log Laura Abbott
2015-09-12 18:55 ` Lucas De Marchi
2015-09-18 18:26 ` Laura Abbott
2015-09-24 1:16 ` Lucas De Marchi
2015-09-11 20:55 ` [PATCH 4/4] depmod: Add error message for bad version Laura Abbott
2015-09-12 19:00 ` Lucas De Marchi
2015-09-18 18:30 ` Laura Abbott
2015-09-24 1:17 ` Lucas De Marchi
2015-09-12 19:05 ` [PATCH 0/4] depmod and modprobe error message fixups Lucas De Marchi
2015-09-16 23:35 ` Kay Sievers
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=1442004956-3868-3-git-send-email-labbott@fedoraproject.org \
--to=labbott@fedoraproject.org \
--cc=linux-modules@vger.kernel.org \
--cc=lucas.demarchi@intel.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;
as well as URLs for NNTP newsgroup(s).