summaryrefslogtreecommitdiff
path: root/modutils/modprobe.c
diff options
context:
space:
mode:
authorKang-Che Sung2017-01-31 21:09:17 +0800
committerDenys Vlasenko2017-02-01 10:14:05 +0100
commitb1d6a2c6247bae0b9f1903ba0e0d16c56f4ef556 (patch)
treeafc10aba770e711341483ef13b95ab3ac4916f9b /modutils/modprobe.c
parent264cb01540cdd995e7c376fd8bcef94e09e31819 (diff)
downloadbusybox-b1d6a2c6247bae0b9f1903ba0e0d16c56f4ef556.zip
busybox-b1d6a2c6247bae0b9f1903ba0e0d16c56f4ef556.tar.gz
cmdline module options can be disabled on "big" modutils
Allow module options on command line to be disabled on "big" modutils. Config FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is renamed to FEATURE_CMDLINE_MODULE_OPTIONS and no longer depends on !MODPROBE_SMALL (I'm not sure if disabling this is useful on "big" modutils, but at least the macro can serve as a marker and ensure both implementations of same feature have consistent behavior.) Signed-off-by: Kang-Che Sung <explorer09@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'modutils/modprobe.c')
-rw-r--r--modutils/modprobe.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index cbec438..a6224fa 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -112,7 +112,7 @@
//usage:
//usage:#define modprobe_trivial_usage
//usage: "[-alrqvsD" IF_FEATURE_MODPROBE_BLACKLIST("b") "]"
-//usage: " MODULE [SYMBOL=VALUE]..."
+//usage: " MODULE" IF_FEATURE_CMDLINE_MODULE_OPTIONS(" [SYMBOL=VALUE]...")
//usage:#define modprobe_full_usage "\n\n"
//usage: " -a Load multiple MODULEs"
//usage: "\n -l List (MODULE is a pattern)"
@@ -174,7 +174,9 @@ static const char modprobe_longopts[] ALIGN1 =
struct globals {
llist_t *probes; /* MEs of module(s) requested on cmdline */
+#if ENABLE_FEATURE_CMDLINE_MODULE_OPTIONS
char *cmdline_mopts; /* module options from cmdline */
+#endif
int num_unresolved_deps;
/* bool. "Did we have 'symbol:FOO' requested on cmdline?" */
smallint need_symbols;
@@ -458,8 +460,10 @@ static int do_modprobe(struct module_entry *m)
options = m2->options;
m2->options = NULL;
options = parse_and_add_kcmdline_module_options(options, m2->modname);
+#if ENABLE_FEATURE_CMDLINE_MODULE_OPTIONS
if (m == m2)
options = gather_options_str(options, G.cmdline_mopts);
+#endif
if (option_mask32 & OPT_SHOW_DEPS) {
printf(options ? "insmod %s/%s/%s %s\n"
@@ -626,7 +630,9 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv)
/* First argument is module name, rest are parameters */
DBG("probing just module %s", *argv);
add_probe(argv[0]);
+#if ENABLE_FEATURE_CMDLINE_MODULE_OPTIONS
G.cmdline_mopts = parse_cmdline_module_options(argv, /*quote_spaces:*/ 1);
+#endif
}
/* Happens if all requested modules are already loaded */