{"id":1461759,"url":"http://patchwork.ozlabs.org/api/patches/1461759/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/9cf63d0419bb51d91c5b1c83ce250dff1e7107cc.1617375802.git.christophe.leroy@csgroup.eu/","project":{"id":2,"url":"http://patchwork.ozlabs.org/api/projects/2/?format=json","name":"Linux PPC development","link_name":"linuxppc-dev","list_id":"linuxppc-dev.lists.ozlabs.org","list_email":"linuxppc-dev@lists.ozlabs.org","web_url":"https://github.com/linuxppc/wiki/wiki","scm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git","webscm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/","list_archive_url":"https://lore.kernel.org/linuxppc-dev/","list_archive_url_format":"https://lore.kernel.org/linuxppc-dev/{}/","commit_url_format":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"},"msgid":"<9cf63d0419bb51d91c5b1c83ce250dff1e7107cc.1617375802.git.christophe.leroy@csgroup.eu>","list_archive_url":"https://lore.kernel.org/linuxppc-dev/9cf63d0419bb51d91c5b1c83ce250dff1e7107cc.1617375802.git.christophe.leroy@csgroup.eu/","date":"2021-04-02T15:18:06","name":"[v4,05/20] cmdline: Gives architectures opportunity to use generically defined boot cmdline manipulation","commit_ref":null,"pull_url":null,"state":"not-applicable","archived":false,"hash":"7fbda532c9ec115f7538a24f49d8bb28661fbfce","submitter":{"id":79086,"url":"http://patchwork.ozlabs.org/api/people/79086/?format=json","name":"Christophe Leroy","email":"christophe.leroy@csgroup.eu"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/9cf63d0419bb51d91c5b1c83ce250dff1e7107cc.1617375802.git.christophe.leroy@csgroup.eu/mbox/","series":[{"id":237158,"url":"http://patchwork.ozlabs.org/api/series/237158/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=237158","date":"2021-04-02T15:18:03","name":"Implement GENERIC_CMDLINE","version":4,"mbox":"http://patchwork.ozlabs.org/series/237158/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/1461759/comments/","check":"warning","checks":"http://patchwork.ozlabs.org/api/patches/1461759/checks/","tags":{},"related":[{"id":1458778,"url":"http://patchwork.ozlabs.org/api/patches/1458778/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/76f43e108bda39dd374928d6d8b86038cc205e74.1616765869.git.christophe.leroy@csgroup.eu/","msgid":"<76f43e108bda39dd374928d6d8b86038cc205e74.1616765869.git.christophe.leroy@csgroup.eu>","list_archive_url":"https://lore.kernel.org/linuxppc-dev/76f43e108bda39dd374928d6d8b86038cc205e74.1616765869.git.christophe.leroy@csgroup.eu/","date":"2021-03-26T13:44:50","name":"[v3,03/17] cmdline: Gives architectures opportunity to use generically defined boot cmdline manipulation","mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/76f43e108bda39dd374928d6d8b86038cc205e74.1616765869.git.christophe.leroy@csgroup.eu/mbox/"}],"headers":{"Return-Path":"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Authentication-Results":["ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=112.213.38.117; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org;\n receiver=<UNKNOWN>)","lists.ozlabs.org; spf=pass (sender SPF authorized)\n smtp.mailfrom=csgroup.eu (client-ip=93.17.236.30; helo=pegase1.c-s.fr;\n envelope-from=christophe.leroy@csgroup.eu; receiver=<UNKNOWN>)"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4FBkJG0ljrz9sWd\n\tfor <patchwork-incoming@ozlabs.org>; Sat,  3 Apr 2021 02:20:14 +1100 (AEDT)","from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4FBkJG00VHz3c9t\n\tfor <patchwork-incoming@ozlabs.org>; Sat,  3 Apr 2021 02:20:14 +1100 (AEDT)","from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by lists.ozlabs.org (Postfix) with ESMTPS id 4FBkFx4zTpz3btG\n for <linuxppc-dev@lists.ozlabs.org>; Sat,  3 Apr 2021 02:18:13 +1100 (AEDT)","from localhost (mailhub1-int [192.168.12.234])\n by localhost (Postfix) with ESMTP id 4FBkFn3JGVz9v2m6;\n Fri,  2 Apr 2021 17:18:05 +0200 (CEST)","from pegase1.c-s.fr ([192.168.12.234])\n by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024)\n with ESMTP id VqEXDMYbbW_D; Fri,  2 Apr 2021 17:18:05 +0200 (CEST)","from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192])\n by pegase1.c-s.fr (Postfix) with ESMTP id 4FBkFn2H9Mz9v2ls;\n Fri,  2 Apr 2021 17:18:05 +0200 (CEST)","from localhost (localhost [127.0.0.1])\n by messagerie.si.c-s.fr (Postfix) with ESMTP id 327708BB7B;\n Fri,  2 Apr 2021 17:18:07 +0200 (CEST)","from messagerie.si.c-s.fr ([127.0.0.1])\n by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023)\n with ESMTP id RgJz95waFuwr; Fri,  2 Apr 2021 17:18:07 +0200 (CEST)","from po16121vm.idsi0.si.c-s.fr (unknown [192.168.4.90])\n by messagerie.si.c-s.fr (Postfix) with ESMTP id BB1658BB79;\n Fri,  2 Apr 2021 17:18:06 +0200 (CEST)","by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0)\n id 8EFAC67989; Fri,  2 Apr 2021 15:18:06 +0000 (UTC)"],"X-Virus-Scanned":["Debian amavisd-new at c-s.fr","amavisd-new at c-s.fr"],"Message-Id":"\n <9cf63d0419bb51d91c5b1c83ce250dff1e7107cc.1617375802.git.christophe.leroy@csgroup.eu>","In-Reply-To":"<cover.1617375802.git.christophe.leroy@csgroup.eu>","References":"<cover.1617375802.git.christophe.leroy@csgroup.eu>","From":"Christophe Leroy <christophe.leroy@csgroup.eu>","Subject":"[PATCH v4 05/20] cmdline: Gives architectures opportunity to use\n generically defined boot cmdline manipulation","To":"will@kernel.org, danielwa@cisco.com, robh@kernel.org,\n daniel@gimpelevich.san-francisco.ca.us, arnd@kernel.org,\n akpm@linux-foundation.org","Date":"Fri,  2 Apr 2021 15:18:06 +0000 (UTC)","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"linux-arch@vger.kernel.org, devicetree@vger.kernel.org,\n microblaze <monstr@monstr.eu>, linux-xtensa@linux-xtensa.org,\n linux-sh@vger.kernel.org, linux-hexagon@vger.kernel.org, x86@kernel.org,\n linux-kernel@vger.kernel.org, nios2 <ley.foon.tan@intel.com>,\n linux-mips@vger.kernel.org, linux-mm@kvack.org,\n openrisc@lists.librecores.org,\n sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org,\n linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"},"content":"Most architectures have similar boot command line manipulation\noptions. This patchs adds the definition in init/Kconfig, gated by\nCONFIG_HAVE_CMDLINE that the architectures can select to use them.\n\nCONFIG_CMDLINE_EXTEND is understood differently by architectures.\nFor some of them it appends built-in CMDLINE to bootloader provided\nline. For others it appends the bootloader provided CMDLINE to the\nbuilt-in one.\nTo avoid confusion, this commit brings to different options:\n- CONFIG_CMDLINE_APPEND to append the built-in CMDLINE to the\nbootloader line.\n- CONFIG_CMDLINE_PREPEND to prepend the built-in CMDLINE in front of\nthe bootloader line.\n\nFor compatibility with existing architecture which uses CONFIG_OF, as\nOF has already been converted to generic cmdline, we keep\nCONFIG_CMDLINE_EXTEND as a synonym to CONFIG_CMDLINE_APPEND until\narm, powerpc, riscv and sh architectures have been converted.\n\nA few differences are identified and will have to be taken\ninto account when converting the architecture to generic cmdline:\n- riscv has CMDLINE_FALLBACK instead of CMDLINE_FROM_BOOTLOADER\n- Some architectures are using CONFIG_CMDLINE_OVERRIDE or\nCONFIG_CMDLINE_OVERWRITE instead of CONFIG_CMDLINE_FORCE.\n\nSigned-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>\n---\nv3:\n- Comments from Will.\n- Remove CONFIG_CMDLINE_BOOL. Using CONFIG_CMDLINE != \"\" instead, like arm and powerpc.\n- Changed EXTEND to APPEND. Keep EXTEND for backward compatibility.\n\nv4:\n- Added CMDLINE_PREPEND as a dependency for INITRAMFS_FORCE\n- Removed the EXTEND || APPEND in cmdline.h, keep EXTEND as it\n   will always exit and switch to APPEND in last patch.\n\nSigned-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>\n---\n init/Kconfig | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n usr/Kconfig  |  2 +-\n 2 files changed, 53 insertions(+), 1 deletion(-)","diff":"diff --git a/init/Kconfig b/init/Kconfig\nindex 5f5c776ef192..af0d84662cc2 100644\n--- a/init/Kconfig\n+++ b/init/Kconfig\n@@ -117,6 +117,58 @@ config INIT_ENV_ARG_LIMIT\n \t  Maximum of each of the number of arguments and environment\n \t  variables passed to init from the kernel command line.\n \n+config GENERIC_CMDLINE\n+\tbool\n+\n+config CMDLINE\n+\tstring \"Default kernel command string\" if GENERIC_CMDLINE\n+\tdefault \"\"\n+\thelp\n+\t  Defines a default kernel command string.\n+\t  If this string is not empty, additional choices are proposed\n+\t  below to determine how it will be used by the kernel.\n+\n+choice\n+\tprompt \"Kernel command line type\" if CMDLINE != \"\"\n+\tdefault CMDLINE_PREPEND if ARCH_WANT_CMDLINE_PREPEND_BY_DEFAULT\n+\tdefault CMDLINE_FROM_BOOTLOADER\n+\tdepends on GENERIC_CMDLINE\n+\thelp\n+\t  Determine how the default kernel arguments are combined with any\n+\t  arguments passed by the bootloader if any.\n+\n+config CMDLINE_FROM_BOOTLOADER\n+\tbool \"Use bootloader kernel arguments if available\"\n+\thelp\n+\t  Uses the command-line options passed by the boot loader. If\n+\t  the boot loader doesn't provide any, the default kernel command\n+\t  string provided in CMDLINE will be used.\n+\n+config CMDLINE_APPEND\n+\tbool \"Append to the bootloader kernel arguments\"\n+\thelp\n+\t  The default kernel command string will be appended to the\n+\t  command-line arguments provided by the bootloader.\n+\n+config CMDLINE_PREPEND\n+\tbool \"Prepend to the bootloader kernel arguments\"\n+\thelp\n+\t  The default kernel command string will be prepended to the\n+\t  command-line arguments provided by the bootloader.\n+\n+config CMDLINE_FORCE\n+\tbool \"Always use the default kernel command string\"\n+\thelp\n+\t  Always use the default kernel command string, ignoring any\n+\t  arguments provided by the bootloader.\n+endchoice\n+\n+config CMDLINE_EXTEND\n+\tbool\n+\tdefault CMDLINE_APPEND\n+\thelp\n+\t  To be removed once all architectures are converted to generic CMDLINE\n+\n config COMPILE_TEST\n \tbool \"Compile also drivers which will not load\"\n \tdepends on HAS_IOMEM\ndiff --git a/usr/Kconfig b/usr/Kconfig\nindex 8bbcf699fe3b..b397e6b114d1 100644\n--- a/usr/Kconfig\n+++ b/usr/Kconfig\n@@ -24,7 +24,7 @@ config INITRAMFS_SOURCE\n \n config INITRAMFS_FORCE\n \tbool \"Ignore the initramfs passed by the bootloader\"\n-\tdepends on CMDLINE_EXTEND || CMDLINE_FORCE\n+\tdepends on CMDLINE_PREPEND || CMDLINE_APPEND || CMDLINE_FORCE\n \thelp\n \t  This option causes the kernel to ignore the initramfs image\n \t  (or initrd image) passed to it by the bootloader. This is\n","prefixes":["v4","05/20"]}