From: Nathan Chancellor <nathan@kernel.org>
To: Song Liu <song@kernel.org>
Cc: linux-kbuild@vger.kernel.org, Nicolas Schier <nsc@kernel.org>
Subject: Re: make olddefconfig surprises
Date: Fri, 23 Jan 2026 16:44:18 -0700 [thread overview]
Message-ID: <20260123234418.GA206716@ax162> (raw)
In-Reply-To: <CAPhsuW5XfLkAkEWVosGQFhgKj4f_Fez0G0fsT_6D1dbZuudr4w@mail.gmail.com>
On Fri, Jan 23, 2026 at 02:54:27PM -0800, Song Liu wrote:
> I think in many cases, we use selftests/xx/config as the base .config
> and run olddefconfig on it. This is how I got confused in the first
> place.
Okay, that makes much more sense in light of everything! I would expect
that to work but only if the dependencies of all the required
configurations are also included in the files.
> I guess the right way to achieve the this goal is:
> make defconfig
> ./scripts/kconfig/merge_config.sh .config selftests/xxx/config
>
> Actually, from my simple tests, this is the same as
> make defconfig
> cat selftests/xxx/config >> .config
> make olddefconfig
Right, I believe those two are generally equivalent. merge_config.sh
becomes more useful as you have more fragments to merge (one recent use
case for performance improvements to merge_config.sh has over 100
fragments to merge) and helps avoid some "redefined" warnings, IIRC.
> It appears merge_config.sh and olddefconfig cannot figure out
> dependencies, so we need to do it manually. For example, if I
> want CONFIG_LIVEPATCH=y, I also need to include all the
> dependencies in selftests/xxx/config:
>
> CONFIG_FUNCTION_TRACER=y
> CONFIG_DYNAMIC_FTRACE=y
> CONFIG_DYNAMIC_FTRACE_WITH_REGS=y
> CONFIG_LIVEPATCH=y
Right, that is exactly the issue here: if certain configurations are
expected to be enabled after these files are used as standalone bases or
merged into other files, these files need to have all of their
dependencies included as well.
> I haven't figured out a way to include all the dependencies
> automatically. Did I miss something?
I do not think something like this exists (maybe a SAT solver? :P), at
least not as part of the kernel tree. This is basically the same thing
as not being able to turn on a configuration in menuconfig until you
have gone through and enabled all of its dependencies. I personally use
menuconfig when trying to create a configuration fragment for minimized
reproducers on top of defconfigs because it is easy to see the final
diff when everything is switched:
$ make defconfig
$ make menuconfig
$ git diff --no-index .config.old .config
You could start with defconfig or a more minimal configuration like
allnoconfig depending on how the selftests config is expected to be
used (as a base or merged into other configs).
Cheers,
Nathan
next prev parent reply other threads:[~2026-01-23 23:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 18:21 make olddefconfig surprises Song Liu
2026-01-23 20:53 ` Nathan Chancellor
2026-01-23 22:54 ` Song Liu
2026-01-23 23:44 ` Nathan Chancellor [this message]
2026-01-23 23:57 ` Song Liu
2026-01-24 19:36 ` Nicolas Schier
2026-01-26 17:17 ` Song Liu
2026-01-26 17:52 ` Randy Dunlap
2026-01-26 19:15 ` Song Liu
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=20260123234418.GA206716@ax162 \
--to=nathan@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=nsc@kernel.org \
--cc=song@kernel.org \
/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