Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030632AbcDMJwe (ORCPT ); Wed, 13 Apr 2016 05:52:34 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:35707 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030369AbcDMJwc (ORCPT ); Wed, 13 Apr 2016 05:52:32 -0400 From: Max Uvarov To: linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org, robh+dt@kernel.org, frowand.list@gmail.co, grant.likely@linaro.org, Max Uvarov Subject: [PATCH] fdt: fix extend of cmd line Date: Wed, 13 Apr 2016 12:52:16 +0300 Message-Id: <1460541136-18385-1-git-send-email-muvarov@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1185 Lines: 36 On arm CONFIG_CMDLINE_EXTEND does not append build-in cmdline in kernel to U-boot parameters. Fix it here. Theoretically this patch should repair kdump work where it adds elfcorehdr= and memmap additional parameters to second kernel. Signed-off-by: Max Uvarov --- drivers/of/fdt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 3349d2a..5e897bf 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -969,10 +969,16 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, * is set in which case we override whatever was found earlier. */ #ifdef CONFIG_CMDLINE -#ifndef CONFIG_CMDLINE_FORCE +#if defined(CONFIG_CMDLINE_EXTEND) + strlcat(data, " ", COMMAND_LINE_SIZE); + strlcat(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE); +#elif defined(CONFIG_CMDLINE_FORCE) + strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE); +#else + /* No arguments from boot loader, use kernel's cmdl*/ if (!((char *)data)[0]) -#endif strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE); +#endif #endif /* CONFIG_CMDLINE */ pr_debug("Command line is: %s\n", (char*)data); -- 1.9.1