ANDROID: Revert "arm64: Drop support for CMDLINE_EXTEND"
This reverts commit cae118b6acc309539b33339e846cbb19187c164c.
Upstream removed the support for CMDLINE_EXTEND on arm64 due to some
inconsistencies in the way command-line was assembled together. However,
the patch inadvertently deleted same config option from the android tree
which was first introduced by commit 056f12819b75 ("ANDROID: arm64: copy
CONFIG_CMDLINE_EXTEND from ARM") back in 2014.
Upstream is currently working on a solution to fix the divergence by
allowing prepend and append functionalities. While we wait for the new
series to land let's bring back CMDLINE_EXTEND option for android, so
arm64 can actually use of the functionality provided by d9a2a3f2c2c4
("ANDROID: of: Support CONFIG_CMDLINE_EXTEND config option").
Bug: 120440972
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I051f445641c8fbc3b8a13015d948f553d87cd791
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index eba4b9f..70ceadf 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -2242,6 +2242,12 @@
the boot loader doesn't provide any, the default kernel command
string provided in CMDLINE will be used.
+config CMDLINE_EXTEND
+ bool "Extend bootloader kernel arguments"
+ help
+ The command-line arguments provided by the boot loader will be
+ appended to the default kernel command string.
+
config CMDLINE_FORCE
bool "Always use the default kernel command string"
help
diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c
index 3addc09..209fffb 100644
--- a/arch/arm64/kernel/idreg-override.c
+++ b/arch/arm64/kernel/idreg-override.c
@@ -304,8 +304,11 @@ static __init void parse_cmdline(void)
{
const u8 *prop = get_bootargs_cmdline();
- if (IS_ENABLED(CONFIG_CMDLINE_FORCE) || !prop)
+ if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) ||
+ IS_ENABLED(CONFIG_CMDLINE_FORCE) ||
+ !prop) {
__parse_cmdline(CONFIG_CMDLINE, true);
+ }
if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && prop)
__parse_cmdline(prop, true);