~ubuntu-branches/ubuntu/vivid/kmod/vivid

« back to all changes in this revision

Viewing changes to debian/patches/do_not_raise_on_null_alias

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-04-18 13:16:44 UTC
  • mfrom: (4.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20130418131644-r9zy91dgcydczbmw
Tags: 9-3ubuntu1
Merge with Debian unstable, bringing in a backport of upstream's
comprehensive fix for the bad alias assertion bug (LP: #1073062)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
5
 
 they are not null
6
 
 
7
 
This makes sure that we don't raise an error if we deal with the
8
 
following entries:
9
 
 
10
 
alias $module_name off
11
 
alias $module_name null
12
 
 
13
 
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
14
 
---
15
 
 tools/modprobe.c |   10 ++++++++--
16
 
 1 file changed, 8 insertions(+), 2 deletions(-)
17
 
 
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
22
 
@@ -34,6 +34,7 @@
23
 
 
24
 
 #include "libkmod.h"
25
 
 #include "libkmod-array.h"
26
 
+#include "libkmod-util.h"
27
 
 #include "macro.h"
28
 
 
29
 
 static int log_priority = LOG_CRIT;
30
 
@@ -537,6 +538,7 @@ static void print_action(struct kmod_module *m, bool install,
31
 
                                                        const char *options)
32
 
 {
33
 
        const char *path;
34
 
+       const char *name;
35
 
 
36
 
        if (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,
39
 
        }
40
 
 
41
 
        path = kmod_module_get_path(m);
42
 
+       name = kmod_module_get_name(m);
43
 
 
44
 
        if (path == NULL) {
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);
50
 
+               }
51
 
+               printf("builtin %s\n", name);
52
 
        } else
53
 
                printf("insmod %s %s\n", kmod_module_get_path(m), options);
54
 
 }
55
 
1.7.9.5
56