[PATCH v2 0/2] x86: Parse CONFIG_CMDLINE in compressed kernel
From: Baskov Evgeniy
Date: Wed May 04 2022 - 16:41:54 EST
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.
Baskov Evgeniy (2):
x86: add strlcat() to compressed kernel
x86: Parse CONFIG_CMDLINE in compressed kernel
arch/x86/boot/compressed/cmdline.c | 28 ++++++++++++++++++++++++++--
arch/x86/boot/compressed/string.c | 15 +++++++++++++++
2 files changed, 41 insertions(+), 2 deletions(-)