modprobe: handle -ENOENT return from init_module
authorDave Reisner <dreisner@archlinux.org>
Mon, 16 Apr 2012 14:37:32 +0000 (10:37 -0400)
committerDave Reisner <dreisner@archlinux.org>
Mon, 16 Apr 2012 14:37:32 +0000 (10:37 -0400)
init_module returns -ENOENT when the module failed to load because of a
bad parameter or unknown symbol. Throw a more descriptive error message
than the generic "No such file or directory" to alert the user.

Fixes Debian bug 668216.

tools/kmod-modprobe.c

index f6d47dc..26b7713 100644 (file)
@@ -607,6 +607,11 @@ static int insmod(struct kmod_ctx *ctx, const char *alias,
                                ERR("could not insert '%s': Module already in kernel\n",
                                                        kmod_module_get_name(mod));
                                break;
+                       case -ENOENT:
+                               ERR("could not insert '%s': Unknown symbol in module, "
+                                               "or unknown parameter (see dmesg)\n",
+                                               kmod_module_get_name(mod));
+                               break;
                        default:
                                ERR("could not insert '%s': %s\n",
                                                kmod_module_get_name(mod),