Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1098934yba; Tue, 2 Apr 2019 02:10:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzepiYqWlN/hw8UW9FuD7K2celUINPHiTzp//qEN+N9S/9wuPRZgW3ZHomPge3UnYmb8PTV X-Received: by 2002:a17:902:f24:: with SMTP id 33mr66258606ply.47.1554196255374; Tue, 02 Apr 2019 02:10:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554196255; cv=none; d=google.com; s=arc-20160816; b=uPdOah9P5ZwSjpAPO0cByKySK73xwVz6TUECOfVWB60rER5V4VAwcG1ggcFgAi4FyR VvHpl14qxNHV1Ou041LgCJr74PxyEfD/99EuhWApToG+UWy7E8tH4xxdLpRjNvHlXocL qXB1GRawmkxqrgxH2N3GIt53nb32D0SavYhZAwRCQzAXHFM9ePUWAh9mDlPVWOkkE7nf 6HQpqmiiCagfC92nQfhC5SUdqGkKCQQUjKKRva1uyMmbnaUcorlHUpmtUusDcTUx0xLd 6P17xVqlOoq8wbfQoq4l//84h/YGguAaeXeNEHIVKPpkSAim5mIxDqzIjnbXy3Pdcnct ZoAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=AzVUINW1pHnpBCWDawAI2SVoEUpzzOXoBPgFojhPawQ=; b=HsrOPYtdJ3fvC6Tub5BGWoHPpoMIIkL30BzJy7x5vb7N+6/GZUTKUmo/QUZcBY/QON 4Z/5qxJouH6frCFh+MXkDUgL0uwW9S0ycRCSYrzGs02uWhyvL82NQpM63S/0va33PwM+ N8WHNfHfNnMu1EdB2IfFmA6BChG2CKw8FDAKpSqZYiHYlkQht+bijPylsMkHyEVQSBVh 54Z8mzmpxjn4VK9tzhkt00a3qGalZNh2gZBH6+IthP1Dzxa+HGLo6Q7HK4t4mHJ0Mgco HqIPy2S/1wKlbrCtEWbZiB1BuVKpurT0PZcxV9w4to7uR5l85EGKeynf5vXLbAe0P2wU nZTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=VywnFieo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si10714893plk.144.2019.04.02.02.10.40; Tue, 02 Apr 2019 02:10:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=VywnFieo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729916AbfDBJIm (ORCPT + 99 others); Tue, 2 Apr 2019 05:08:42 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:34703 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729891AbfDBJIm (ORCPT ); Tue, 2 Apr 2019 05:08:42 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44YNfw286Fz9v0Zh; Tue, 2 Apr 2019 11:08:40 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=VywnFieo; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 8LpclvzCYQI2; Tue, 2 Apr 2019 11:08:40 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 44YNfw13Q1z9v0ZY; Tue, 2 Apr 2019 11:08:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1554196120; bh=AzVUINW1pHnpBCWDawAI2SVoEUpzzOXoBPgFojhPawQ=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=VywnFieoWyrjl+ZL/WDhF9RVWk4L0eUMusXPOHDZqVutcseHtUWTGzAI9kZeEGNz1 H46+35KcyCGT/5oZ6dkQSCWC5nz+Pqpxw6PjsvODze3yJDrAKO1lE8X0ubCRnpzINx 4YJiFH/dpYWpJw/Utb6YYrsjJZQ27aSog8jpV1nw= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 3FA9A8B8C4; Tue, 2 Apr 2019 11:08:41 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id GwB73V1amiSE; Tue, 2 Apr 2019 11:08:41 +0200 (CEST) Received: from po16846vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1C26A8B8C3; Tue, 2 Apr 2019 11:08:41 +0200 (CEST) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id F3232661D9; Tue, 2 Apr 2019 09:08:40 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH 6/9] Add capability to prepend the command line To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , danielwa@cisco.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arch@vger.kernel.org Date: Tue, 2 Apr 2019 09:08:40 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchs adds an option of prepend a text to the command line instead of appending it. Signed-off-by: Christophe Leroy --- include/linux/cmdline.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/cmdline.h b/include/linux/cmdline.h index afcc00d7628d..5caf3724c1ab 100644 --- a/include/linux/cmdline.h +++ b/include/linux/cmdline.h @@ -3,7 +3,7 @@ #define _LINUX_CMDLINE_H /* - * This function will append a builtin command line to the command + * This function will append or prepend a builtin command line to the command * line provided by the bootloader. Kconfig options can be used to alter * the behavior of this builtin command line. * @dest: The destination of the final appended/prepended string. @@ -22,6 +22,9 @@ static __always_inline void cmdline_build(char *dest, const char *src, size_t le strlcat(dest, CONFIG_CMDLINE, length); return; } + + if (IS_ENABLED(CONFIG_CMDLINE_PREPEND) && sizeof(CONFIG_CMDLINE) > 1) + strlcat(dest, CONFIG_CMDLINE " ", length); #endif if (dest != src) strlcat(dest, src, length); -- 2.13.3