arch/arm64/Kconfig | 6 ++++++ arch/arm64/kernel/pi/idreg-override.c | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-)
From: 谢致邦 (XIE Zhibang) <Yeking@Red54.com>
After commit e6384c398459 ("efi/libstub: Parse builtin command line
after bootloader provided one"), the behavior of EFI has been consistent
with FDT.
So add back and fix support for CMDLINE_EXTEND.
Fixes: cae118b6acc3 ("arm64: Drop support for CMDLINE_EXTEND")
Signed-off-by: 谢致邦 (XIE Zhibang) <Yeking@Red54.com>
---
arch/arm64/Kconfig | 6 ++++++
arch/arm64/kernel/pi/idreg-override.c | 8 +++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index a182295e6f08..736280eb0251 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -2427,6 +2427,12 @@ config CMDLINE_FROM_BOOTLOADER
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 default kernel command string will be appended to the
+ command-line arguments provided by the boot loader.
+
config CMDLINE_FORCE
bool "Always use the default kernel command string"
help
diff --git a/arch/arm64/kernel/pi/idreg-override.c b/arch/arm64/kernel/pi/idreg-override.c
index c6b185b885f7..cff403477ff5 100644
--- a/arch/arm64/kernel/pi/idreg-override.c
+++ b/arch/arm64/kernel/pi/idreg-override.c
@@ -382,11 +382,13 @@ static __init void parse_cmdline(const void *fdt, int chosen)
static char const cmdline[] __initconst = CONFIG_CMDLINE;
const u8 *prop = get_bootargs_cmdline(fdt, chosen);
- if (IS_ENABLED(CONFIG_CMDLINE_FORCE) || !prop)
- __parse_cmdline(cmdline, true);
-
if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && prop)
__parse_cmdline(prop, true);
+
+ if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) ||
+ IS_ENABLED(CONFIG_CMDLINE_FORCE) ||
+ !prop)
+ __parse_cmdline(cmdline, true);
}
void __init init_feature_override(u64 boot_status, const void *fdt,
--
2.43.0
On Fri, Mar 28, 2025 at 10:22:34AM +0000, Yeking@Red54.com wrote:
> From: 谢致邦 (XIE Zhibang) <Yeking@Red54.com>
>
> After commit e6384c398459 ("efi/libstub: Parse builtin command line
> after bootloader provided one"), the behavior of EFI has been consistent
> with FDT.
>
> So add back and fix support for CMDLINE_EXTEND.
>
> Fixes: cae118b6acc3 ("arm64: Drop support for CMDLINE_EXTEND")
> Signed-off-by: 谢致邦 (XIE Zhibang) <Yeking@Red54.com>
This breaks the ability for the user (via the boot loader) to override
built-in arguments.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
> This breaks the ability for the user (via the boot loader) to override > built-in arguments. How does a non-default configuration break the ability you're talking about? If you insist, why not remove the non-default CMDLINE_FORCE as well?
© 2016 - 2025 Red Hat, Inc.