[Toybox] Feature request for kconfig: switch on/off stuff directly in make invocation

Oliver Webb aquahobbyist at proton.me
Sun Apr 28 19:45:15 PDT 2024


Almost 100% of the time I run menuconfig, I already
know exactly what changes I am going to make and am
only invoking menuconfig because I don't wanna manually
switch them on (e.g. defconfig +/- THIS_CMD). This
works okay, but makes things harder to automate and
takes extra time.

mkroot has apparently already ran into this problem before
(since running menuconfig right in the middle of a system
bootstrap is...). And has the PENDING environment variable
to solve half of this by allowing people to switch on
pending commands.

My proposed solution is "toggleconfig" and "TOGGLE",
a config rule to allow people to adjust the current
configuration according to the variable TOGGLE
(A CSV list of either "[+-]COMMAND,..." or "COMMAND=[yn],..."),
so a person could do something like:

"make defconfig toggleconfig TOGGLE=+EXPR,+TR,-FILE toybox"

To get a defconfig baseline, switch on expr and tr, switch off
file, and make a binary of toybox. All automatically with no user
input like you need to do the same in menuconfig.

A minimal system that only needs a few commands could
do something like "make allnoconfig toggleconfig TOGGLE=+foo,+bar,..."

A downside of a CSV list of +/-VALUES is that you can't operate on
number ranges. Although VALUES=y/n is more cumbersome and is probably
harder to do in raw C since for the +/- you only need to check the first
character.

"How hard is this to implement?": Well, I certainly cant speak for
code I never have had the chance to see. But given the routines menuconfig
needs to change a existing .config and the depends code having to look for
symbol names. It doesn't _seem_ that hard to integrate into a existing
kconfig. Maybe a -t flag that takes the list combined with the csv code
in lib.

What is the status of the kconfig rewrite? I'd be happy to contribute
code for this once the kconfig parser is added, but I can't add things
to code I can't see. Is there interest in a feature like this being
added to kconfig?

Thanks,

-   Oliver Webb <aquahobbyist at proton.me>



More information about the Toybox mailing list