From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQo8L-0002jF-Ll for ptxdist@pengutronix.de; Fri, 09 Oct 2020 10:52:13 +0200 Received: from mol by dude02.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1kQo8L-0005Y2-D2 for ptxdist@pengutronix.de; Fri, 09 Oct 2020 10:52:13 +0200 Date: Fri, 9 Oct 2020 10:52:13 +0200 From: Michael Olbrich Message-ID: <20201009085213.GA26482@pengutronix.de> References: <20200922092901.30715-1-rhi@pengutronix.de> <20200922092901.30715-4-rhi@pengutronix.de> <3677004.r5CB0fc9gf@ada> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3677004.r5CB0fc9gf@ada> Subject: Re: [ptxdist] [PATCH v2 4/6] ptxdist: implement 'defconfig' commands for kconfig packages List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de On Mon, Sep 28, 2020 at 03:34:45PM +0200, Alexander Dahl wrote: > Hei Roland, > > Am Dienstag, 22. September 2020, 11:28:59 CEST schrieb Roland Hieber: > > The current process to generate a kernel .config file from a defconfig > > is a bit cumbersome: > > > > $ ptxdist extract kernel > > $ cd platform-foo/build-target/linux- > > $ make ARCH=... CROSS_COMPILE=... foo_defconfig > > $ cp .config ../../../configs/platform-foo/kernelconfig > > What about the following? > > $ ptxdist extract kernel > $ cp platform-foo/build-target/linux-/arch/arm/configs/ > bar_defconfig configs/platform-foo/kernelconfig > $ ptxdist oldconfig kernel > > > All kernel and barebox rules and templates already support the > > _%config target since commit b0f9f2fe33ca9027a554 (2020-08-07, > > "barebox, kernel: enable use of {allyes, allno, allmod, alldef, > > rand}config"), so we only need to wire them into the command line > > parser, and then we can easily get a defconfig like this: > > > > $ ptxdist defconfig kernel # most ARCHs > > $ ptxdist imx_v6_v7_defconfig kernel # e.g. with ARCH=arm > > This looks somehow like a weird syntax, but I have no idea for a better one. > :-/ Hmm, I agree that this looks weird. And having a wildcard for a ptxdist command is not something that I want. Maybe: ptxdist defconfig kernel imx_v6_v7 Michael > What about U-Boot? Currently there's PTXCONF_U_BOOT_CONFIGSYSTEM_LEGACY and > you can just use a defconfig name in there. > > (That was actually not supposed to target defconfig in particular, but the pre > kconfig U-Boot config mechanism, but it also works for recent U-Boot > defconfigs.) > > Greets > Alex > > > Signed-off-by: Roland Hieber > > --- > > * v2: fix in help text, it's not an optional parameter > > > > bin/ptxdist | 15 ++++++++++++++- > > doc/ref_parameter.rst | 9 +++++++++ > > 2 files changed, 23 insertions(+), 1 deletion(-) > > > > diff --git a/bin/ptxdist b/bin/ptxdist > > index 0d5e4328e1d6..000879f45187 100755 > > --- a/bin/ptxdist > > +++ b/bin/ptxdist > > @@ -705,6 +705,9 @@ Setup and Project Actions: > > > > menuconfig barebox configure the bootloader Barebox > > > > + []defconfig generate a default config file for > > + e.g.: ptxdist multi_v7_defconfig kernel > > + > > oldconfig run 'make oldconfig' on ptxconfig file > > allmodconfig run 'make allmodconfig' on ptxconfig file > > allyesconfig run 'make allyesconfig' on ptxconfig file > > @@ -1267,6 +1270,16 @@ do_config() > > case "${config}" in > > menuconfig|nconfig|oldconfig|all*config|randconfig) > > ;; > > + *defconfig) > > + case "${part}" in > > + "ptx"|"ptxdist"|""|"setup"|"platform"|"board"|"user"|"collection") > > + echo > > + echo "${PTXDIST_LOG_PROMPT}error: cannot do a '${config}' for part > > '${part}'" + echo > > + exit 1 > > + ;; > > + esac > > + ;; > > *) > > echo > > echo "${PTXDIST_LOG_PROMPT}error: invalid use of '${FUNCNAME} ${@}'" > > @@ -1625,7 +1638,7 @@ parse_second() > > > > ######## *config, *setup, toolchain > > > > - menuconfig|nconfig|oldconfig|allmodconfig|allyesconfig|allnoconfig| > alldef > > config|randconfig) > > + menuconfig|nconfig|oldconfig|allmodconfig|allyesconfig|allnoconfig|*defc > > onfig|randconfig) do_config "${cmd}" "${@}" > > exit > > ;; > > diff --git a/doc/ref_parameter.rst b/doc/ref_parameter.rst > > index 1d54fa4b4428..cac35cddb5ac 100644 > > --- a/doc/ref_parameter.rst > > +++ b/doc/ref_parameter.rst > > @@ -95,6 +95,15 @@ Setup and Project Actions > > functionality as ``menuconfig``. It can be used instead of ``menuconfig`` > > for all the component described above. > > > > +``[]defconfig `` > > + generate a default config file for kconfig-based packages (kernel, > > barebox). + The ``[]`` can be given optionally to use a specific > > defconfig file, + which depends on the respective package and the > > architecture. > > + Examples:: > > + > > + $ ptxdist defconfig kernel # most ARCHs > > + $ ptxdist imx_v6_v7_defconfig kernel # e.g. for ARCH=arm > > + > > ``oldconfig []``, ``allmodconfig []``, ``allyesconfig > > []``, ``allnoconfig []``, ``alldefconfig > > []``, ``randconfig []`` this action will run the > > corresponding kconfig action for the specified component. ``oldconfig`` > > will prompt for all new options. > > > > > > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de