Re: [PATCH 1/2] selftests/lkdtm: Don't clear dmesg when running tests

From: Kees Cook
Date: Thu Jun 25 2020 - 02:16:09 EST


On Mon, Jun 22, 2020 at 02:21:38PM +0530, Naresh Kamboju wrote:
> On Fri, 8 May 2020 at 12:23, Michael Ellerman <mpe@xxxxxxxxxxxxxx> wrote:
> > # Record and dump the results
> > -dmesg -c >"$LOG"
> > +dmesg | diff --changed-group-format='%>' --unchanged-group-format='' "$DMESG" - > "$LOG" || true
>
> We are facing problems with the diff `=%>` part of the option.
> This report is from the OpenEmbedded environment.
> We have the same problem from livepatch_testcases.

Does "comm" exists in those environments?

dmesg | comm -13 "$DMESG" - > "$LOG" || true

this is even shorter than the diff command line. :)

--
Kees Cook