Re: [PATCH] init/main.c: Wrap long kernel cmdline when printing to logs

From: Andrew Morton

Date: Tue Oct 21 2025 - 16:55:55 EST


On Mon, 20 Oct 2025 13:00:22 -0700 Doug Anderson <dianders@xxxxxxxxxxxx> wrote:

> > And the code would presumably be much simpler if we simply chunked up
> > the printing and spat out one really long line.
>
> I'm not quite sure what you're suggesting. Before my changes we _do_
> try to spit out one really long line, but then printk() silently
> truncates it for us at 1021 characters. Re-reading your suggestion,
> I'm not sure if you're suggesting that we improve printk() to handle
> lines longer than 1021 characters by chunking them up, or if you're
> suggesting that this code could use "pr_cont()" to chunk things up.
> ...or something totally different. ;-) Can you clarify?

I was suggsting the latter - emit these really long lines via repeated
calls to printk().