lkml.org 
[lkml]   [2022]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH v3 0/2] x86: Parse CONFIG_CMDLINE in compressed kernel
Date
CONFIG_CMDLINE_BOOL and CONFIG_CMDLINE_OVERRIDE was ignored during
options lookup in compressed kernel, including earlyprintk option,
so it was impossible to get earlyprintk messages from that stage
of boot process via command line provided at compile time.
Being able to enable earlyprintk via compile-time option might
be desirable for booting on systems with broken UEFI command line
arguments via EFISTUB.

v2 changes:

As Borislav Petkov stated, we can do the work just once and then
return correct command line pointer. Doing it this way require
us to perform string manipulations, so the first patch adds missing
strlcat() to compressed kernel, since this function simplifies
the code a lot.

If we need to concatenate strings, static buffer of fixed length
is used. The maximum command line length is set to the same value
as the one in the kernel setup code.

v3 changes:

v2 had a bug: cmd_line_ptr was set to a pointer to a buffer inside
a kernel before kernel relocation, that makes this pointer invalid.
It was fixed by replacing the pointer by a boolean variable.

Baskov Evgeniy (2):
x86: Add strlcat() to compressed kernel
x86: Parse CONFIG_CMDLINE in compressed kernel

arch/x86/boot/compressed/cmdline.c | 24 +++++++++++++++++++++++-
arch/x86/boot/compressed/string.c | 15 +++++++++++++++
2 files changed, 38 insertions(+), 1 deletion(-)

\
 
 \ /
  Last update: 2022-05-05 12:34    [W:0.133 / U:25.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site