[PATCH v1 0/3] Proper fix for allnoconfig
Charles Mirabile via busybox <[email protected]> Sun, 5 Jul 2026 17:00:29 -0400
| Newsgroups | gmane.linux.busybox |
|---|---|
| Message-ID | <[email protected]> |
Note: this patch series references issue numbers from the now disabled
Bugzilla instance for Busybox. I wrote these patches a while ago when it
was still available, but sat on them because I wasn't seeing patches be
merged from the mailing list. I have seen some more activity lately so
I revived these patches and am sending them now. I will try to provide
context for the issue numbers I am referencing even though the primary
source information is not accessible except perhaps to Denys.
While it is critical that `make allnoconfig` does produce a `.config` with
as many options turned off as physically possible, and it does do that on
the current master branch, that alone is not enough to be of much use,
because a Busybox configured with all options disabled does nothing.
Kconfig has the concept of a `KCONFIG_ALLCONFIG` seed file for use with
the `allnoconfig`, `allyesconfig`, `allmodconfig`, and `randconfig`.
When that environment variable is set to a file containing a list of
options, it provides constraints to Kconfig that it should not violate
while preparing the type of config you request (e.g. options that should
remain on while all others are disabled for `allnoconfig`, or vice versa
for `allyesconfig`, or those that shouldn't randomize with `randconfig`,
or shouldn't modularize with `allmodconfig`).
Currently this functionality is broken on master. Since the commit:
0b1c62934 ("build system: fix "allnoconfig" to clear all options. Closes 10296")
Any options in a `KCONFIG_ALLCONFIG` file are completely ignored and the
output of `all{yes,no,mod}config` are always fixed. This patch sought to
fix an issue #10296 where some configs were remaining enabled incorrectly
after `make allnoconfig`. The user who filed that bug reopened it seeking
a different fix, or at least a revert of the commit, and also filed #11736
to specifically report this problem. They are not the only user impacted
by this regression; I also sought a fix for both issues and I imagine I am
not the only one.
The inability to provide a seed for the Kconfig generating targets makes
them unsuitable for use in scripts to generate a reproducible minimized
config from a small list of desired options, leaving only `make defconfig`
with custom `KBUILD_DEFCONFIG`, which is unsuitable for users looking to
configure for a minimal Busybox build.
The problems with `make defconfig` for minimal builds are as follows:
1) Because most applets and options are enabled by default to provide a
rich and useful experience with Busybox by default, a user wanting to
create a minimal Busybox will need to list hundreds of options as
explicitly disabled in their `KBUILD_DEFCONFIG` file.
2) As new options appear over time, because they are often enabled by
default, a previously small `KBUILD_DEFCONFIG` will bloat slowly over time
and require constant maintenance to keep small.
A `KCONFIG_ALLCONFIG` seed used with `make allnoconfig` solves both of
these issues: only those options wanted are listed in the file, and if it
is brought to a newer version with new options, they will not be mentioned
and will be turned off by default.
As a first step, the patch that broke `KCONFIG_ALLCONFIG` should be
reverted, and that is what patches 1 and 2 do (there was a subsequent
bug fix to the code being reverted that I also revert so both can happen
cleanly). This fixes #11736 by making seeds to allnoconfig work again,
but brings us right back to where we started with the issue in #10296.
Next, we can fix the original problem with configs staying on spuriously
as reported in #10296 for real. The solution was surprisingly simple:
trawl through the git log of `scripts/kconfig/` in the Linux kernel for
any fixes to the Kconfig logic. One interesting commit from 2007 authored
by Roman Zippel the original creator of Kconfig jumped out at me:
f82f3f9422d4d ("kconfig: oldconfig shall not set symbols if it does not need to")
That sounds suspiciously like our issue (except about oldconfig instead of
allnoconfig).
I was able to take that patch and apply it with some minor context fix-ups
to the version of Kconfig from Busybox and like magic the issue went away:
`make allnoconfig` actually turned everything off, unless you told it to
do otherwise in a KCONFIG_ALLCONFIG seed file. Unfortunately how exactly
the patch worked wasn't immediately apparent to me, but after staring at
it for a few hours, I think understand, and I tried to explain it as best
I could in the commit message. Read there for more details.
Charles Mirabile (3):
Revert "build system: fix a compiler warning"
Revert "build system: fix "allnoconfig" to clear all options. Closes 10296"
build system: don't record defaults as explicit choices. Closes 10296
scripts/kconfig/conf.c | 77 ++++++++----------------------------------
1 file changed, 14 insertions(+), 63 deletions(-)
--
2.54.0