Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4578439pxf; Tue, 30 Mar 2021 11:09:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHW/H6y4NQEz3K2fRK8QQnPFPjJb3P14ZnpvUC5ltWglwjT9ZUWM5igC2Env0Rw78i4COS X-Received: by 2002:a17:906:3949:: with SMTP id g9mr33926475eje.7.1617127780691; Tue, 30 Mar 2021 11:09:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1617127780; cv=pass; d=google.com; s=arc-20160816; b=OymYve6EPhN+D0nEviL1eagDXu5/uhBcLqF3wskmk4b4trNTR3XFtGf4kYjxaH8hrZ LHNUHAgdTeEGDzi5PTFofZWhbiIjkgLOuf8ntv5nTrgI2ZvTTJkNLKdD0Fpkqy/b3mie n4VrWXvbgjEVoOhXP441t9wKZpDniHdv/FQqUMP+Un/Nw4vQv9/lfyb/cpMp1kvshL+Z v+sINByyIaUOhQ7+rNIwK8X8vabwybIu0hzR5R6NlJ7rl0bLR2BEFbO81fd+ofrZ8Xfr Bjx9M7J4hPep/bViIGVgHRvR3WPvAUm7SzzoNkfv/UcK6QPaGyj6QYz5bYB0yCUaRBWv EGwA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:mime-version :subject:dkim-signature; bh=TBtxdLUkTjgMvDEB4mRh0JBbXrVFmzYUj0lLVMFFsdA=; b=NSq1UEWO7ZJ/ErxIPVQq/2d+bvRGw5pRM8iOgvHmJEEsCvKjFK03KKLaj1s8eBUBub RTl9N4wK+UamWKVgyCTW4Jjbylzv/GO12AEIlRX8C5Hkx3lBcjAzkB570d06Tu3Sk91D GfwbVtPlN3off4SsX0HwASWrxfG1BWf7uDHWP9EIHGy1WiL8RZyI5g+vawivPXTU9ovz se/3lvxbvvuMHU7ph1PvTi2u3crofGbrWnCNp9jgXph4FGSg/lD/8u4PUgDu7LwzACdm QO8KA4VMfmZmCVVkbIOuH3RHmj0vxQ00rnb5EE7p/tclbe3jTvSStZy90T6o8rGLrupy gA+A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=mbDZevjF; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce13si15330595ejc.750.2021.03.30.11.09.17; Tue, 30 Mar 2021 11:09:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=mbDZevjF; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231701AbhC3SIV (ORCPT + 99 others); Tue, 30 Mar 2021 14:08:21 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.83]:14571 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232648AbhC3SIN (ORCPT ); Tue, 30 Mar 2021 14:08:13 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1617127652; cv=none; d=strato.com; s=strato-dkim-0002; b=Eyq7UqYoQqaEh0TMUnq5UzdsBNGHStBafdmSxV9W2kisa22bG7lmyAywbGT1XJNba7 eioohjWH90m+ApCCaLfIJxxrR0fQOvTVZ+fpgqmhqIMk/mcG5vvv755Km5wHzjfz85eD AIodf4KHXJpzky4K9Aqs3tShThestACt/nWf04t592qQQCRQl6j3BZfA4sQbOP2xon7H CO2OSrUFpfKhmJRWkNPpKptwmAM6sMygUV0eEVrdYDzhUtLa+wHtAn+mOZEsc3EVuVuK I1WEqmTMsSz6bLFh8xF0oI/lJJm26GPzvsu8uvlw+eAR9YXciV1S+X5IXCmUg1qJUIug fnig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1617127652; s=strato-dkim-0002; d=strato.com; h=To:References:Message-Id:Cc:Date:In-Reply-To:From:Subject:Cc:Date: From:Subject:Sender; bh=TBtxdLUkTjgMvDEB4mRh0JBbXrVFmzYUj0lLVMFFsdA=; b=iDxuBxBtN4zGXwH2FsNDucbzs44++UuByW9OubNfPa+SgIUVYehN+9wajhoPfWf8ne AJBeDpLzfO9gvPi1AhT0jxBhUc3mkrU3McdEHDV+b0zDo5wFvykL3ipqabsAzZU6O7uz is7TqCigWd9ZbgrEsfGbT107MDunzyDPutsq+PzsCSPNZocW9LxvOzLbkyCPLhoBlc7/ oipum/qvWNjCcVAwprWos80uz+EPG1wDUnbl2HlPeD0LPZubEv85OlwKgkt04b/wC3ze Q/YiSR5IF99tHUC2aAp+hTj0JNzGcOYR8WbAB/c0XCz3bibgnOfYzQ2C5UX/ZGASRCMW /9Eg== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1617127652; s=strato-dkim-0002; d=goldelico.com; h=To:References:Message-Id:Cc:Date:In-Reply-To:From:Subject:Cc:Date: From:Subject:Sender; bh=TBtxdLUkTjgMvDEB4mRh0JBbXrVFmzYUj0lLVMFFsdA=; b=mbDZevjFp2b5R5VUle8FDC8MwkfYJzBYGCwkaBTe2ybLg6GWxZEJsH5woKenUz96DZ HLCOwfabBd5h1GPxw3d1/qdKw063SU3JfrMvJjSZc4etXqVgZ2OuBchcRp0XGZjLqw0Q XI9sVLA8HjveKwrt594YK3I6FiUVUxeNeTlYhNwAe6WYcF1jzcOR6pVtqoJP9uP/xZ/D Syv6uzaw6Ma5RlMrYSJzO01MZ2ln4j1+WzqLWaT+SnK0MZvUpV72FVIyBP3MJRqqvVES dGUeryXh/+ZW1PiQ4IEXCAuRPM4Xx3PnN8Xk5C5+DltqN18M43BTURpT9dF2flHnmD8l liYA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMgPgp8VKxflSZ1P34KBj4Qpw9iZeHmAjw47t884=" X-RZG-CLASS-ID: mo00 Received: from [192.168.178.35] by smtp.strato.de (RZmta 47.23.1 DYNA|AUTH) with ESMTPSA id h03350x2UI7VJS3 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Tue, 30 Mar 2021 20:07:31 +0200 (CEST) Subject: Re: [PATCH v3 01/17] cmdline: Add generic function to build command line. Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset=us-ascii From: "H. Nikolaus Schaller" In-Reply-To: <20210330172714.GR109100@zorba> Date: Tue, 30 Mar 2021 20:07:30 +0200 Cc: will@kernel.org, Rob Herring , daniel@gimpelevich.san-francisco.ca.us, linux-arch@vger.kernel.org, devicetree , linuxppc-dev@lists.ozlabs.org, Linux Kernel Mailing List , linux-arm-kernel , microblaze , linux-mips , nios2 , openrisc@lists.librecores.org, linux-hexagon@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org, linux-xtensa@linux-xtensa.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <878228ad88df38f8914c7aa25dede3ed05c50f48.1616765869.git.christophe.leroy@csgroup.eu> <20210330172714.GR109100@zorba> To: Daniel Walker , Christophe Leroy X-Mailer: Apple Mail (2.3124) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Am 30.03.2021 um 19:27 schrieb Daniel Walker : >=20 > On Fri, Mar 26, 2021 at 01:44:48PM +0000, Christophe Leroy wrote: >> This code provides architectures with a way to build command line >> based on what is built in the kernel and what is handed over by the >> bootloader, based on selected compile-time options. >>=20 >> Signed-off-by: Christophe Leroy >> --- >> v3: >> - Addressed comments from Will >> - Added capability to have src =3D=3D dst >> --- >> include/linux/cmdline.h | 57 = +++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 57 insertions(+) >> create mode 100644 include/linux/cmdline.h >>=20 >> diff --git a/include/linux/cmdline.h b/include/linux/cmdline.h >> new file mode 100644 >> index 000000000000..dea87edd41be >> --- /dev/null >> +++ b/include/linux/cmdline.h >> @@ -0,0 +1,57 @@ >> +/* SPDX-License-Identifier: GPL-2.0 */ >> +#ifndef _LINUX_CMDLINE_H >> +#define _LINUX_CMDLINE_H >> + >> +#include >> + >> +/* Allow architectures to override strlcat, powerpc can't use = strings so early */ >> +#ifndef cmdline_strlcat >> +#define cmdline_strlcat strlcat >> +#endif >> + >> +/* >> + * 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. >> + * @dst: The destination of the final appended/prepended string. >> + * @src: The starting string or NULL if there isn't one. >> + * @len: the length of dest buffer. >> + */ >=20 > Append or prepend ? Cisco requires both at the same time. This is why = my > implementation provides both. I can't use this with both at once. Just an idea: what about defining CMDLINE as a pattern where e.g. "$$" = or "%%" is replaced by the boot loader command line? Then you can formulate replace, prepend, append, prepend+append with a = single CONFIG setting. It may be a little more complex in code (scanning for the pattern and = replacing it and take care to temporary memory) but IMHO it could be worth to = consider. BR, Nikolaus Schaller