Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1098227yba; Tue, 2 Apr 2019 02:09:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxq1ELJqTBH+ifSNZEdfr3cN0NNMeQLIdgnjZiUTpWuoVRMMoDzIhwZQVp29lPZpIrKCPfV X-Received: by 2002:a63:6fcd:: with SMTP id k196mr53378294pgc.238.1554196193822; Tue, 02 Apr 2019 02:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554196193; cv=none; d=google.com; s=arc-20160816; b=Ee/zLgjbCheys75TEfhVCCgen2NRJWnyNCBTl+Bsl+FutIFpT2EtTjYBCoHlLU+8Ap ZP4jzX/fnPi3sJ+r8LAIcZ5ZSJbgjXRwVsHCfvtugOJYJuldR93gqpARRWdDMTu8Xmi+ 64Fpia6qMoslNUvhV4+VCta0QKukqxERcjIBchK+hP1wQISgYNz7Xedzdews3Y2E+3tU FimQcmU3MJwx4Q5u+PZrr6XljuNw/b3+pnlXjLBnZSIctzOSloEhLaGhIWvGWe/EQXky zS+0cNAY6YTYBbYpbonUmRdgsPHfme1s95b4SEE0W5rcHaNL7Kd5ePCVjXwxaHoAlJoX ooyA== 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=rWaMv7jLMRcybMw+rH4c15xjnJ5LQFZqC8X6T/gYj8o=; b=ggFbTOFNjWnjXCc6kCpiIu/0Uw7gO4p2Ljs7T24Ix0VEt+J/pc8508HVaZ+AM+VtyT zd06OUhP7HwQZznn5AhdUhhRNohvnP/1xK+tbIKwgPu+AyaDq6KokTtJpeAu1AyIqolt dUTwa71uqUIXLzLf6uV+GQBHP1aipK7MLDZl09i2TUb6GmS8ohO/yeZaHbHvy/UPI7EG 8cbbB2z73sR1v3RDBtZGM0jv9XrVtn3dZpwVBEsK2d3y64srv02mjsCLeTc9s7xJGkiP 9G/OJxUqHCu4ROPNw1qP0xxqAoW6/DfCns1w4Tnfb2MTZTq+bBfYazrii5SaHfo8oJj9 8epg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=swo9NRqG; 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 h24si10520638pgg.226.2019.04.02.02.09.38; Tue, 02 Apr 2019 02:09:53 -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=swo9NRqG; 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 S1729970AbfDBJIv (ORCPT + 99 others); Tue, 2 Apr 2019 05:08:51 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:52499 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729924AbfDBJIp (ORCPT ); Tue, 2 Apr 2019 05:08:45 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44YNfy3Vv9z9v0Zs; Tue, 2 Apr 2019 11:08:42 +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=swo9NRqG; 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 Li86sRJR3c32; Tue, 2 Apr 2019 11:08:42 +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 44YNfy22QMz9v0ZY; Tue, 2 Apr 2019 11:08:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1554196122; bh=rWaMv7jLMRcybMw+rH4c15xjnJ5LQFZqC8X6T/gYj8o=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=swo9NRqG5EU5D7oa6/L6CNl12ZwO5S9usIc8hhR7hD6w/GscJey8Ke3k6J1UlS5sk b+PSecS+LLqVw3WVycaPPBvZP9q93gMj5f6iSsji2YzH28G/qYnvcyOUNGaslY7uy2 ISLpIE1QUFco2Wy2/rP92UfAYcIwBX/KPYxGaFVo= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6165E8B8C4; Tue, 2 Apr 2019 11:08:43 +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 wTqIwhouLvzb; Tue, 2 Apr 2019 11:08:43 +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 2988C8B8C3; Tue, 2 Apr 2019 11:08:43 +0200 (CEST) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 0AA17661D9; Tue, 2 Apr 2019 09:08:43 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH 8/9] Gives arches opportunity to use generically defined boot cmdline manipulation 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:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Most arches have similar boot command line manipulation options. This patchs adds the definition in init/Kconfig, gated by CONFIG_HAVE_CMDLINE that the arches can select to use them. In order to use this, a few arches will have to change their CONFIG options: - riscv has to replace CMDLINE_FALLBACK by CMDLINE_FROM_BOOTLOADER - arches using CONFIG_CMDLINE_OVERRIDE or CONFIG_CMDLINE_OVERWRITE have to replace them by CONFIG_CMDLINE_FORCE Arches also have to define CONFIG_DEFAULT_CMDLINE Signed-off-by: Christophe Leroy --- init/Kconfig | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/init/Kconfig b/init/Kconfig index 4592bf7997c0..83537603412c 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -80,6 +80,62 @@ config INIT_ENV_ARG_LIMIT Maximum of each of the number of arguments and environment variables passed to init from the kernel command line. +config HAVE_CMDLINE + bool + +config CMDLINE_BOOL + bool "Default bootloader kernel arguments" + depends on HAVE_CMDLINE + help + On some platforms, there is currently no way for the boot loader to + pass arguments to the kernel. For these platforms, you can supply + some command-line options at build time by entering them here. In + most cases you will need to specify the root device here. + +config CMDLINE + string "Initial kernel command string" + depends on CMDLINE_BOOL + default DEFAULT_CMDLINE + help + On some platforms, there is currently no way for the boot loader to + pass arguments to the kernel. For these platforms, you can supply + some command-line options at build time by entering them here. In + most cases you will need to specify the root device here. + +choice + prompt "Kernel command line type" if CMDLINE != "" + default CMDLINE_FROM_BOOTLOADER + help + Selects the way you want to use the default kernel arguments. + +config CMDLINE_FROM_BOOTLOADER + bool "Use bootloader kernel arguments if available" + help + Uses the command-line options passed by the boot loader. If + the boot loader doesn't provide any, the default kernel command + string provided in CMDLINE will be used. + +config CMDLINE_EXTEND + bool "Extend bootloader kernel arguments" + help + The default kernel command string will be appended to the + command-line arguments provided during boot. + +config CMDLINE_PREPEND + bool "Prepend bootloader kernel arguments" + help + The default kernel command string will be prepend to the + command-line arguments provided during boot. + +config CMDLINE_FORCE + bool "Always use the default kernel command string" + help + Always use the default kernel command string, even if the boot + loader passes other arguments to the kernel. + This is useful if you cannot or don't want to change the + command-line options your boot loader passes to the kernel. +endchoice + config COMPILE_TEST bool "Compile also drivers which will not load" depends on !UML -- 2.13.3