1
From d5d78c148ffabd9751caa06054612cf29e5d284c Mon Sep 17 00:00:00 2001
2
From: Alberto Milone <alberto.milone@canonical.com>
3
Date: Wed, 13 Mar 2013 14:11:03 +0100
4
Subject: [PATCH 1/1] tools/modprobe.c: look for the modules in /sys only if
7
This makes sure that we don't raise an error if we deal with the
10
alias $module_name off
11
alias $module_name null
13
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
15
tools/modprobe.c | 10 ++++++++--
16
1 file changed, 8 insertions(+), 2 deletions(-)
18
diff --git a/tools/modprobe.c b/tools/modprobe.c
19
index b108112..3509d67 100644
20
--- a/tools/modprobe.c
21
+++ b/tools/modprobe.c
25
#include "libkmod-array.h"
26
+#include "libkmod-util.h"
29
static int log_priority = LOG_CRIT;
30
@@ -537,6 +538,7 @@ static void print_action(struct kmod_module *m, bool install,
37
printf("install %s %s\n", kmod_module_get_install_commands(m),
38
@@ -545,10 +547,14 @@ static void print_action(struct kmod_module *m, bool install,
41
path = kmod_module_get_path(m);
42
+ name = kmod_module_get_name(m);
45
- assert(kmod_module_get_initstate(m) == KMOD_MODULE_BUILTIN);
46
- printf("builtin %s\n", kmod_module_get_name(m));
47
+ /* Look for the modules in /sys only if they are not null */
48
+ if (name && !streq(name, "off") && !streq(name, "null")) {
49
+ assert(kmod_module_get_initstate(m) == KMOD_MODULE_BUILTIN);
51
+ printf("builtin %s\n", name);
53
printf("insmod %s %s\n", kmod_module_get_path(m), options);