From: Yousong Zhou Date: Fri, 13 Jan 2017 17:00:31 +0000 (+0800) Subject: kmodloader: log to kmsg when loading directories of modules X-Git-Url: http://git.openwrt.org/?p=project%2Fubox.git;a=commitdiff_plain;h=46a4b5f70aef35f1da70a72400cd8f34083d7501 kmodloader: log to kmsg when loading directories of modules syslog may not be ready yet before PREINIT Signed-off-by: Yousong Zhou --- diff --git a/kmodloader.c b/kmodloader.c index 9fe7d7f..b20de6e 100644 --- a/kmodloader.c +++ b/kmodloader.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -785,7 +784,7 @@ static int main_loader(int argc, char **argv) return -1; } - syslog(LOG_INFO, "kmodloader: loading kernel modules from %s\n", path); + ULOG_INFO("loading kernel modules from %s\n", path); if (glob(path, gl_flags, NULL, &gl) < 0) goto out; @@ -836,6 +835,8 @@ static int main_loader(int argc, char **argv) avl_for_each_element(&modules, m, avl) if ((m->state == PROBE) || (m->error)) ULOG_ERR("- %s - %d\n", m->name, deps_available(m, 1)); + } else { + ULOG_INFO("done loading kernel modules from %s\n", path); } out: @@ -881,5 +882,6 @@ int main(int argc, char **argv) if (!strcmp(exec, "modprobe")) return main_modprobe(argc, argv); + ulog_open(ULOG_KMSG, LOG_USER, "kmodloader"); return main_loader(argc, argv); }