Re: [QUESTION] Why tristate look like bool?
From: Randy Dunlap
Date: Wed Dec 03 2025 - 12:53:31 EST
Hi,
On 12/3/25 4:07 AM, Les Boys wrote:
> First, I wrote a minimal Kconfig:
> ```
> config TRISTATE_TEST
> tristate "Test"
> ```
> Then, I ran:
> ```
> ./conf --oldaskconfig test.lbConfig
> ```
> Finally, it showed:
> ```
> Test (TRISTATE_TEST) [N/y] (NEW):
> ```
> This is not excepted, it should shows:
> ```
> Test (TRISTATE_TEST) [N/y/m] (NEW):
> ```
> I am confused about this problem, no document talks about it, please explain to me, thanks.
I was fairly sure that it has something to do with MODULES.
To your test config file, I added:
config MODULES
def_bool y
but the test results were still the same. Then I recalled that there is
a special keyword for "modules", described (or mentioned) in
Documentation/kbuild/kconfig-language.rst. When I add "modules" to
CONFIG_MODULES, it works as expected.
config MODULES
modules
def_bool y
The kconfig subsystem knows about modular builds but they must be
enabled for them to be allowed on other kconfig symbols.
HTH.
--
~Randy