aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Klötzke <jan@kloetzke.net>2019-12-16 22:56:54 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2020-11-22 14:33:58 +0100
commit768153bf8cc84a1a53166a9fe538de9484cdc8d1 (patch)
tree561738f5ae509fa6398a52857dc3fa8bf11589f1
parente9003caf6dce05034147bb6382b17154d428f575 (diff)
downloadbusybox-w32-768153bf8cc84a1a53166a9fe538de9484cdc8d1.tar.gz
busybox-w32-768153bf8cc84a1a53166a9fe538de9484cdc8d1.tar.bz2
busybox-w32-768153bf8cc84a1a53166a9fe538de9484cdc8d1.zip
mdev: add -v to increase log verbosity
If logging to stderr and/or syslog the -v option can be given one or more times to increase the log verbosity. If mdev is used as hotplug helper the log level is fixed set to 2 if mdev.log is found an appended because there is no possiblity to pass arguments to the hotplug helper. Signed-off-by: Jan Klötzke <jan@kloetzke.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--util-linux/mdev.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index a67baf32e..66cff6e9c 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -80,7 +80,7 @@
80//kbuild:lib-$(CONFIG_MDEV) += mdev.o 80//kbuild:lib-$(CONFIG_MDEV) += mdev.o
81 81
82//usage:#define mdev_trivial_usage 82//usage:#define mdev_trivial_usage
83//usage: "[-S] " IF_FEATURE_MDEV_DAEMON("[") "[-s]" IF_FEATURE_MDEV_DAEMON(" | [-df]]") 83//usage: "[-Sv] " IF_FEATURE_MDEV_DAEMON("[") "[-s]" IF_FEATURE_MDEV_DAEMON(" | [-df]]")
84//usage:#define mdev_full_usage "\n\n" 84//usage:#define mdev_full_usage "\n\n"
85//usage: "mdev -s is to be run during boot to scan /sys and populate /dev.\n" 85//usage: "mdev -s is to be run during boot to scan /sys and populate /dev.\n"
86//usage: IF_FEATURE_MDEV_DAEMON( 86//usage: IF_FEATURE_MDEV_DAEMON(
@@ -90,6 +90,7 @@
90//usage: "\n" 90//usage: "\n"
91//usage: "optional arguments:\n" 91//usage: "optional arguments:\n"
92//usage: " -S: Log to syslog too\n" 92//usage: " -S: Log to syslog too\n"
93//usage: " -v: Increase log verbosity\n"
93//usage: "\n" 94//usage: "\n"
94//usage: "Bare mdev is a kernel hotplug helper. To activate it:\n" 95//usage: "Bare mdev is a kernel hotplug helper. To activate it:\n"
95//usage: " echo /sbin/mdev >/proc/sys/kernel/hotplug\n" 96//usage: " echo /sbin/mdev >/proc/sys/kernel/hotplug\n"
@@ -297,7 +298,7 @@ struct rule {
297 298
298struct globals { 299struct globals {
299 int root_major, root_minor; 300 int root_major, root_minor;
300 smallint verbose; 301 int verbose;
301 char *subsystem; 302 char *subsystem;
302 char *subsys_env; /* for putenv("SUBSYSTEM=subsystem") */ 303 char *subsys_env; /* for putenv("SUBSYSTEM=subsystem") */
303#if ENABLE_FEATURE_MDEV_CONF 304#if ENABLE_FEATURE_MDEV_CONF
@@ -1259,7 +1260,11 @@ int mdev_main(int argc UNUSED_PARAM, char **argv)
1259 1260
1260 xchdir("/dev"); 1261 xchdir("/dev");
1261 1262
1262 opt = getopt32(argv, "sS" IF_FEATURE_MDEV_DAEMON("df")); 1263 opt = getopt32(argv, "^"
1264 "sS" IF_FEATURE_MDEV_DAEMON("df") "v"
1265 "\0"
1266 "vv",
1267 &G.verbose);
1263 1268
1264#if ENABLE_FEATURE_MDEV_CONF 1269#if ENABLE_FEATURE_MDEV_CONF
1265 G.filename = "/etc/mdev.conf"; 1270 G.filename = "/etc/mdev.conf";