Skip to contentSkip to conversation

unnecessary "tristate"ness in Kconfig files

DISCUSSION Robert P. J. Day 2 participants 2 messages Feb 13, 2008 – Apr 10, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

can someone correct me if my thinking is out of whack here?
consider init/Kconfig:

...
config IKCONFIG
tristate "Kernel .config support"
---help---
This option enables the complete Linux kernel ".config" file contents to be saved in the kernel. It provides documentation of which kernel options are used in a running kernel or in an on-disk kernel. This information can be extracted from the kernel image file with the script scripts/extract-ikconfig and used as input to rebuild the current kernel or to build another kernel. It can also be extracted from a running kernel by reading /proc/config.gz if enabled (below).

config IKCONFIG_PROC
bool "Enable access to .config through /proc/config.gz" depends on IKCONFIG && PROC_FS
---help---
This option enables access to the kernel configuration file through /proc/config.gz.
...

now why is IKCONFIG tristate instead of simple bool? it's used
solely as a dependency for IKCONFIG_PROC, and that's used in kernel/configs.c thusly:

...
#ifdef CONFIG_IKCONFIG_PROC
...
#endif
...

so it's easy to see that it should be selectable, but it's *not*
clear to see why it should be *tristate*. what is the value of its tristate-ness? thanks.

rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.

http://crashcourse.ca Waterloo, Ontario, CANADA
========================================================================

#1 lore raw
Quoted 29 lines · On Wed, 13 Feb 2008 11:46:00 -0500 (EST) Robert P. J. Day wrote:

can someone correct me if my thinking is out of whack here?
consider init/Kconfig:

...
config IKCONFIG
tristate "Kernel .config support"
---help---
This option enables the complete Linux kernel ".config" file contents to be saved in the kernel. It provides documentation of which kernel options are used in a running kernel or in an on-disk kernel. This information can be extracted from the kernel image file with the script scripts/extract-ikconfig and used as input to rebuild the current kernel or to build another kernel. It can also be extracted from a running kernel by reading /proc/config.gz if enabled (below).

config IKCONFIG_PROC
bool "Enable access to .config through /proc/config.gz" depends on IKCONFIG && PROC_FS
---help---
This option enables access to the kernel configuration file through /proc/config.gz.
...

now why is IKCONFIG tristate instead of simple bool? it's used
solely as a dependency for IKCONFIG_PROC, and that's used in kernel/configs.c thusly:

Quoted 5 lines

...
#ifdef CONFIG_IKCONFIG_PROC
...
#endif
...

and it's used in kernel/Makefile:

obj-$(CONFIG_IKCONFIG) += configs.o

Quoted 3 lines

so it's easy to see that it should be selectable, but it's *not*
clear to see why it should be *tristate*. what is the value of its tristate-ness? thanks.

Did you test building with CONFIG_IKCONFIG=m ? How did you evaluate that it (tristate) is unnecessary?

---
~Randy
PS: IKCONFIG was originally a bool. Someone from Google thought it would be interesting to make it a loadable module. I disagreed, but the patch was merged anyway.
PPS: Sorry about the delayed reply.