mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Collate "run init" message to one line with prefixed var assignments
@ 2020-11-11 15:47 Rob Landley
  2020-11-12  7:11 ` ac0e958a00: Kernel_panic-not_syncing:stack-protector:Kernel_stack_is_corrupted_in:run_init_process kernel test robot
  0 siblings, 1 reply; 5+ messages in thread
From: Rob Landley @ 2020-11-11 15:47 UTC (permalink / raw)
  To: linux-kernel

From: Rob Landley <rob@landley.net>

Run init: HOME=/ TERM=linux /init

Signed-off-by: Rob Landley <rob@landley.net>
---

 init/main.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/init/main.c b/init/main.c
index 130376ec10ba..80b06566852b 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1328,15 +1328,16 @@ static void __init do_pre_smp_initcalls(void)
 static int run_init_process(const char *init_filename)
 {
 	const char *const *p;
+	char buf[512], *s = buf;

 	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);
+
+	for (p = (void *)envp_init; *p; p++)
+		s += sprintf(s, "%.*s ", (int)(sizeof(buf)-(s-buf)), *p);
+	for (p = (void *)argv_init; *p; p++)
+		s += sprintf(s, "%.*s ", (int)(sizeof(buf)-(s-buf)), *p);
+	pr_info("Run init: %s\n", buf);
+
 	return kernel_execve(init_filename, argv_init, envp_init);
 }


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-12 15:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-11 15:47 [PATCH] Collate "run init" message to one line with prefixed var assignments Rob Landley
2020-11-12  7:11 ` ac0e958a00: Kernel_panic-not_syncing:stack-protector:Kernel_stack_is_corrupted_in:run_init_process kernel test robot
2020-11-12 12:46   ` Rob Landley
2020-11-12 13:49     ` David Laight
2020-11-12 16:02       ` Rob Landley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome