diff options
author | John Crispin <blogic@openwrt.org> | 2014-01-22 17:57:09 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2014-01-22 20:08:24 +0000 |
commit | 71ea854364833c5dcb0800e092b45fed2c45910e (patch) | |
tree | 8ecb23c0c66cd9db49721a63a5473c14f8bdb066 /kmodloader.c | |
parent | f3b07dd3c6eca504cf082e2cf6c0d9e9aa1e91a6 (diff) | |
download | ubox-71ea854364833c5dcb0800e092b45fed2c45910e.tar.gz |
kmodloader: allow /etc/modules.d/ files to pass options
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'kmodloader.c')
-rw-r--r-- | kmodloader.c | 6 |
1 files changed, 5 insertions, 1 deletions
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(); |