kmod-loader: fix module options support when using modprobe
authorJohn Crispin <blogic@openwrt.org>
Fri, 8 Nov 2013 21:59:58 +0000 (22:59 +0100)
committerJohn Crispin <blogic@openwrt.org>
Mon, 11 Nov 2013 12:28:10 +0000 (13:28 +0100)
Signed-off-by: John Crispin <blogic@openwrt.org>
kmodloader.c

index 11af0ae..3238190 100644 (file)
@@ -55,6 +55,7 @@ struct module {
 
        char *name;
        char *depends;
+       char *options;
 
        int size;
        int usage;
@@ -455,7 +456,7 @@ static int load_modprobe(void)
                todo = 0;
                avl_for_each_element(&modules, m, avl) {
                        if ((m->state == PROBE) && (!deps_available(m, 0))) {
-                               if (!insert_module(get_module_path(m->name), "")) {
+                               if (!insert_module(get_module_path(m->name), m->options)) {
                                        m->state = LOADED;
                                        m->error = 0;
                                        loaded++;
@@ -709,6 +710,7 @@ static int main_loader(int argc, char **argv)
                        if (!m || (m->state == LOADED))
                                continue;
 
+                       m->options = opts;
                        m->state = PROBE;
                        if (basename(gl.gl_pathv[j])[0] - '0' <= 9)
                                load_modprobe();