From 46a4b5f70aef35f1da70a72400cd8f34083d7501 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Sat, 14 Jan 2017 01:00:31 +0800 Subject: [PATCH] kmodloader: log to kmsg when loading directories of modules syslog may not be ready yet before PREINIT Signed-off-by: Yousong Zhou --- kmodloader.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } -- 2.25.1