summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArvind Sankar <nivedita@alum.mit.edu>2020-01-30 22:17:13 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-01-31 10:30:41 -0800
commitb88c50ac304a14f14e70c4ad22577b6b84632d5e (patch)
treea8cdfa9909e375ce3163ec3d3a559031fac87b2c
parent1fbede6e6f3dc6c1c33e84b6989cf8079d899f89 (diff)
downloadlinux-b88c50ac304a14f14e70c4ad22577b6b84632d5e.tar.gz
linux-b88c50ac304a14f14e70c4ad22577b6b84632d5e.tar.bz2
linux-b88c50ac304a14f14e70c4ad22577b6b84632d5e.zip
init/main.c: log arguments and environment passed to init
Extend logging in `run_init_process` to also show the arguments and environment that we are passing to init. Link: http://lkml.kernel.org/r/20191212180023.24339-2-nivedita@alum.mit.edu Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu> Cc: Chris Metcalf <cmetcalf@tilera.com> Cc: Krzysztof Mazur <krzysiek@podlesie.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--init/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/init/main.c b/init/main.c
index db13a76c036e..424d88fef08e 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1043,8 +1043,16 @@ static void __init do_pre_smp_initcalls(void)
static int run_init_process(const char *init_filename)
{
+ const char *const *p;
+
argv_init[0] = init_filename;
pr_info("Run %s as init process\n", init_filename);
+ pr_debug(" with arguments:\n");
+ for (p = argv_init; *p; p++)
+ pr_debug(" %s\n", *p);
+ pr_debug(" with environment:\n");
+ for (p = envp_init; *p; p++)
+ pr_debug(" %s\n", *p);
return do_execve(getname_kernel(init_filename),
(const char __user *const __user *)argv_init,
(const char __user *const __user *)envp_init);