From: Rob Landley <rob@landley.net>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] Collate "run init" message to one line with prefixed var assignments
Date: Wed, 11 Nov 2020 09:47:14 -0600 [thread overview]
Message-ID: <6daf4796-b211-8022-984c-0dcc20dede0f@landley.net> (raw)
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);
}
next reply other threads:[~2020-11-11 15:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-11 15:47 Rob Landley [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6daf4796-b211-8022-984c-0dcc20dede0f@landley.net \
--to=rob@landley.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).