public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: Zhangjin Wu <falcon@tinylab.org>
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux@weissschuh.net,
	thomas@t-8ch.de
Subject: Re: [PATCH v1 4/8] selftests/nolibc: add extra config file customize support
Date: Sat, 29 Jul 2023 09:45:18 +0200	[thread overview]
Message-ID: <20230729074518.GH956@1wt.eu> (raw)
In-Reply-To: <20230725143006.37452-1-falcon@tinylab.org>

Hi Zhangjin,

On Tue, Jul 25, 2023 at 10:30:06PM +0800, Zhangjin Wu wrote:
> Hi, Willy
> 
> > On Wed, Jul 19, 2023 at 05:14:07AM +0800, Zhangjin Wu wrote:
> > > The default DEFCONFIG_<ARCH> may not always work for all architectures,
> > > some architectures require to add extra kernel config options, this adds
> > > a new 'extconfig' target for this requirement.
> > > 
> > > It allows to customize extra kernel config options via the common
> > > common.config and the architecture specific <ARCH>.config, at last
> > > trigger 'allnoconfig' to let them take effect with missing config
> > > options as disabled.
> > > 
> > > The scripts/kconfig/merge_config.sh tool is used to merge the extra
> > > config files.
> > > 
> > > Suggested-by: Thomas Wei?schuh <linux@weissschuh.net>
> > > Link: https://lore.kernel.org/lkml/67eb70d4-c9ff-4afc-bac7-7f36cc2c81bc@t-8ch.de/
> > > Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
> > > ---
> > >  tools/testing/selftests/nolibc/Makefile | 7 +++++++
> > >  1 file changed, 7 insertions(+)
> > > 
> > > diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
> > > index f42adef87e12..08a5ca5f418b 100644
> > > --- a/tools/testing/selftests/nolibc/Makefile
> > > +++ b/tools/testing/selftests/nolibc/Makefile
> > > @@ -39,6 +39,9 @@ DEFCONFIG_s390       = defconfig
> > >  DEFCONFIG_loongarch  = defconfig
> > >  DEFCONFIG            = $(DEFCONFIG_$(ARCH))
> > >  
> > > +# extra kernel config files under configs/, include common + architecture specific
> > > +EXTCONFIG            = common.config $(ARCH).config
> > > +
> > >  # optional tests to run (default = all)
> > >  TEST =
> > >  
> > > @@ -162,6 +165,10 @@ initramfs: nolibc-test
> > >  defconfig:
> > >  	$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare
> > >  
> > > +extconfig:
> > > +	$(Q)$(srctree)/scripts/kconfig/merge_config.sh -O "$(srctree)" -m "$(srctree)/.config" $(foreach c,$(EXTCONFIG),$(wildcard $(CURDIR)/configs/$c))
> > > +	$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) KCONFIG_ALLCONFIG="$(srctree)/.config" allnoconfig
> > > +
> > 
> > Please also mention this entry in the "help" message.
> > Other than that, OK.
> >
> 
> Willy, as we discussed in another tinyconfig series, in order to avoid
> add more complexity to users, I plan to drop this standalone 'extconfig'
> target and move the extra config operations to defconfig target like
> this:
> 
>     defconfig:
>      	$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) mrproper $(DEFCONFIG) prepare
>      	$(Q)$(srctree)/scripts/kconfig/merge_config.sh -O "$(srctree)" -m "$(srctree)/.config" $(foreach c,$(EXTCONFIG),$(wildcard $(CURDIR)/configs/$c))
>      	$(Q)$(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) KCONFIG_ALLCONFIG="$(srctree)/.config" allnoconfig
> 
> This extra config options are really critical to default boot and test, so, it
> should be a 'default' config action as the 'defconfig' target originally mean.
> 
> Will test carefully about this change, what's your idea?

Well, *iff* we need to have per-arch config settings, probably to better
support Qemu, the console output, etc, then indeed we'd rather add them
to all configs indeed. However the example above is bogus. First you
create a default config, then prepare the rest of the kernel, then
merge that config with the extensions (based on the arch and not the
sub-arch BTW) then erase everything to restart from an allnoconfig.

Also if you're using merge_config you'll need -Q to disable warning
about overridden options since you're starting from a defconfig which
contains plenty of them. Usually I just do defconfig, append the few
changes, then oldconfig and that's done. But merge_config can probably
be fine as well. Also make prepare should be done last, to make sure
that if it depends on anything in the config (e.g. 32 vs 64 bit etc)
it's up to date.

Willy

  reply	other threads:[~2023-07-29  7:45 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-18 21:09 [PATCH v1 0/8] tools/nolibc: add 32/64-bit powerpc support Zhangjin Wu
2023-07-18 21:10 ` [PATCH v1 1/8] tools/nolibc: add support for powerpc Zhangjin Wu
2023-07-23  7:32   ` Thomas Weißschuh
2023-07-23  8:15     ` Willy Tarreau
2023-07-25  5:44       ` Zhangjin Wu
2023-07-25  6:29         ` Willy Tarreau
2023-07-25 11:02           ` Zhangjin Wu
2023-07-25 14:45             ` Ammar Faizi
2023-07-25 17:04               ` Zhangjin Wu
2023-07-25 18:23                 ` Ammar Faizi
2023-07-25 20:23                   ` Zhangjin Wu
2023-07-25 18:27             ` Willy Tarreau
2023-07-25 20:52               ` Zhangjin Wu
2023-07-25  6:14     ` Zhangjin Wu
2023-07-18 21:11 ` [PATCH v1 2/8] tools/nolibc: add support for powerpc64 Zhangjin Wu
2023-07-18 21:13 ` [PATCH v1 3/8] selftests/nolibc: select_null: fix up for big endian powerpc64 Zhangjin Wu
2023-07-18 22:17   ` Thomas Weißschuh
2023-07-18 23:56     ` Zhangjin Wu
2023-07-19  4:33       ` Willy Tarreau
2023-07-19  6:49         ` Zhangjin Wu
2023-07-19 20:25           ` Willy Tarreau
2023-07-20  6:11           ` Thomas Weißschuh
2023-07-18 21:14 ` [PATCH v1 4/8] selftests/nolibc: add extra config file customize support Zhangjin Wu
2023-07-22 12:00   ` Willy Tarreau
2023-07-25 14:30     ` Zhangjin Wu
2023-07-29  7:45       ` Willy Tarreau [this message]
2023-07-29  9:43         ` Zhangjin Wu
2023-07-18 21:15 ` [PATCH v1 5/8] selftests/nolibc: add XARCH and ARCH mapping support Zhangjin Wu
2023-07-22 12:03   ` Willy Tarreau
2023-07-18 21:16 ` [PATCH v1 6/8] selftests/nolibc: add test support for powerpc Zhangjin Wu
2023-07-18 21:17 ` [PATCH v1 7/8] selftests/nolibc: add test support for powerpc64le Zhangjin Wu
2023-07-22 12:07   ` Willy Tarreau
2023-07-18 21:18 ` [PATCH v1 8/8] selftests/nolibc: add test support for powerpc64 Zhangjin Wu
2023-07-22 12:10   ` Willy Tarreau
2023-07-25  5:50     ` Zhangjin Wu
2023-07-25  6:02       ` Willy Tarreau
2023-07-23  7:47 ` [PATCH v1 0/8] tools/nolibc: add 32/64-bit powerpc support Thomas Weißschuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230729074518.GH956@1wt.eu \
    --to=w@1wt.eu \
    --cc=arnd@arndb.de \
    --cc=falcon@tinylab.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=thomas@t-8ch.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox