[Toybox] [PATCH] dmesg: fix multi-line messages

Ju Hyung Park qkrwngud825 at gmail.com
Sat Mar 7 08:24:43 PST 2020


Hi Rob, sorry for the late reply.

Was busy with uni stuffs.

On Tue, Mar 3, 2020 at 5:00 AM Rob Landley <rob at landley.net> wrote:
> I'm not sure what the sh -c wrapper accomplishes here?

The results are different from
`sh -c "printf 'line a\nline b\n'" > /dev/kmsg`
and
`printf 'line a\nline b\n' > /dev/kmsg`.

I honestly don't know why, but you'll get the same issue as my
original commit message describes if you wrap it with `sh -c`.

> The util-linux dmesg isn't parsing "\x0a" as a magic sequence, that I can tell?

I deliberately didn't peek at util-linux or busybox's implementation
as that would potentially become a licensing issue..?
But either way, I'm sure they'll handle this "multi-line" kmsg.

> How do I reproduce the problem you're seeing?

As I mentioned, a `sh -c` wrapper will do its thing.

The behavior is reproducible on my Ubuntu setup and my Android 10 device.

The reason why I wanted to fix this was to make toybox properly
display multi-line printk()s such as `pr_info("%s\n%s\n%s", ...);`.

Thanks.



More information about the Toybox mailing list