lkml.org 
[lkml]   [2022]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] of/fdt: extend cmdline is not avail when kernel grub config ends with "--"
Date
when boot_command_line = boot-command "--" CONFIG_CMDLINE,
parse_args() will exit and without parsing the contents of CONFIG_CMDLINE

Signed-off-by: hmy <huanglin@uniontech.com>
---
drivers/of/fdt.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index a8f5b6532165..5a289712c8fb 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -1162,6 +1162,7 @@ int __init early_init_dt_scan_chosen(char *cmdline)
const char *p;
const void *rng_seed;
const void *fdt = initial_boot_params;
+ char *q __maybe_unused;

node = fdt_path_offset(fdt, "/chosen");
if (node < 0)
@@ -1186,6 +1187,9 @@ int __init early_init_dt_scan_chosen(char *cmdline)
*/
#ifdef CONFIG_CMDLINE
#if defined(CONFIG_CMDLINE_EXTEND)
+ q = strstr(cmdline, "--");
+ if (q)
+ *q = '\0';
strlcat(cmdline, " ", COMMAND_LINE_SIZE);
strlcat(cmdline, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
#elif defined(CONFIG_CMDLINE_FORCE)
--
2.20.1


\
 
 \ /
  Last update: 2022-07-01 07:39    [W:0.033 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site