[PATCH] arm64: Make CONFIG_CMDLINE behavior configurable

Matija Glavinic Pecotic matija.glavinic-pecotic.ext at nokia.com
Tue Sep 29 04:46:09 EDT 2020

arm64 has no means to define behavior if CONFIG_CMDLINE is set as e.g.
arm32 has. Parts of the kernel will ignore CMDLINE if behavior on how
to treat is not specified, e.g.:

        strlcat(data, " ", COMMAND_LINE_SIZE);
        strlcat(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
  #elif defined(CONFIG_CMDLINE_FORCE)
        strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
        /* No arguments from boot loader, use kernel's  cmdl*/
        if (!((char *)data)[0])
                strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
  #endif /* CONFIG_CMDLINE */

Sync behavior of arm64 with arm32 (and other platforms).

Signed-off-by: Matija Glavinic Pecotic <matija.glavinic-pecotic.ext at nokia.com>
 arch/arm64/Kconfig | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 6d232837cbee..0a03db76aa5a 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1824,14 +1824,32 @@ config CMDLINE
 	  entering them here. As a minimum, you should specify the the
 	  root device (e.g. root=/dev/nfs).
+	prompt "Kernel command line type" if CMDLINE != ""
+	depends on ATAGS
+	bool "Use bootloader kernel arguments if available"
+	help
+	  Uses the command-line options passed by the boot loader. If
+	  the boot loader doesn't provide any, the default kernel command
+	  string provided in CMDLINE will be used.
+	bool "Extend bootloader kernel arguments"
+	help
+	  The command-line arguments provided by the boot loader will be
+	  appended to the default kernel command string.
 	bool "Always use the default kernel command string"
-	depends on CMDLINE != ""
 	  Always use the default kernel command string, even if the boot
 	  loader passes other arguments to the kernel.
 	  This is useful if you cannot or don't want to change the
 	  command-line options your boot loader passes to the kernel.
 config EFI_STUB

More information about the linux-arm-kernel mailing list