summaryrefslogtreecommitdiff
path: root/kmodloader.c
diff options
context:
space:
mode:
authorGerard Ryan <g.m0n3y.2503@gmail.com>2019-10-20 16:01:11 +1000
committerJohn Crispin <john@phrozen.org>2019-10-21 13:18:17 +0200
commitc9ffeac74a3de0ea6cd6b79b9ce9238668be388c (patch)
tree4673d9d87d0d9982c61bed9081504fc26cc3b513 /kmodloader.c
parent4df34a4d0d5183135217fc8280faae8e697147bc (diff)
downloadubox-c9ffeac74a3de0ea6cd6b79b9ce9238668be388c.tar.gz
kmodloader: added -v arg to modeprobe
This is primarily to satiate the usage by docker/libnetwork. Signed-off-by: Gerard Ryan <G.M0N3Y.2503@gmail.com>
Diffstat (limited to 'kmodloader.c')
-rw-r--r--kmodloader.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/kmodloader.c b/kmodloader.c
index 422c895..07b6700 100644
--- a/kmodloader.c
+++ b/kmodloader.c
@@ -678,7 +678,10 @@ static int print_insmod_usage(void)
static int print_modprobe_usage(void)
{
- ULOG_INFO("Usage:\n\tmodprobe [-q] filename\n");
+ ULOG_INFO(
+ "Usage:\n"
+ "\tmodprobe [-q] [-v] filename\n"
+ );
return -1;
}
@@ -855,14 +858,18 @@ static int main_modprobe(int argc, char **argv)
struct module *m;
char *name;
char *mod = NULL;
+ int log_level = LOG_WARNING;
int opt;
bool quiet = false;
- while ((opt = getopt(argc, argv, "q")) != -1 ) {
+ while ((opt = getopt(argc, argv, "qv")) != -1 ) {
switch (opt) {
case 'q': /* shhhh! */
quiet = true;
break;
+ case 'v':
+ log_level = LOG_DEBUG;
+ break;
default: /* '?' */
return print_modprobe_usage();
break;
@@ -872,6 +879,9 @@ static int main_modprobe(int argc, char **argv)
if (optind >= argc)
return print_modprobe_usage(); /* expected module after options */
+ /* after print_modprobe_usage() so it won't be filtered out */
+ ulog_threshold(log_level);
+
mod = argv[optind];
if (scan_module_folders())