X-Git-Url: http://git.openwrt.org/?p=project%2Fubox.git;a=blobdiff_plain;f=kmodloader.c;h=db4574e27d25005228baf740cc81db53c9351945;hp=f0985eeb5c9240b92aebe86cec553ed964deffdd;hb=71ea854364833c5dcb0800e092b45fed2c45910e;hpb=f3b07dd3c6eca504cf082e2cf6c0d9e9aa1e91a6 diff --git a/kmodloader.c b/kmodloader.c index f0985ee..db4574e 100644 --- a/kmodloader.c +++ b/kmodloader.c @@ -55,6 +55,7 @@ struct module { char *name; char *depends; + char *opts; int size; int usage; @@ -182,6 +183,7 @@ alloc_module(const char *name, const char *depends, int size) return NULL; m->avl.key = m->name = strcpy(_name, name); + m->opts = 0; if (depends) { m->depends = strcpy(_dep, depends); @@ -467,7 +469,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->opts) ? (m->opts) : (""))) { m->state = LOADED; m->error = 0; loaded++; @@ -726,6 +728,8 @@ static int main_loader(int argc, char **argv) if (!m || (m->state == LOADED)) continue; + if (opts) + m->opts = strdup(opts); m->state = PROBE; if (basename(gl.gl_pathv[j])[0] - '0' <= 9) load_modprobe();