5

in defconfig files, you can set kernel options as such:

CONFIG_<optionName>=y
CONFIG_<optionName>=m
CONFIG_<optionName>=n
# CONFIG_<optionName> is not set

I understand the first 2.

What I would like to understand is the difference between #3 & #4, and when to use each - especially given that the kernel sources may use #ifdef CONFIG_ { ... } and sometimes, #if CONFIG_ { ... }

In my specific case, I want to decidedly say that optionName is not available.

Thanks

user3342339
  • 349
  • 1
  • 5
  • 19
  • It's been a while since I looked into this, but the actual definitions of the macro `CONFIG_xxx` should be in `autoconf.h`, a header file that's generated based on your config file. So `CONFIG_xxx is not set` and `CONFIG_xxx=n` should be equivalent. – Ram Jan 31 '17 at 00:46

2 Answers2

2

CONFIG_<optionName>=n is not valid. That's just not how Kconfig options are specified. # CONFIG_<optionName> is not set is how you specify that an option is not set.

1

CONFIG_<optionName>=n It means that you are explicitly disabling this config item from your defconfig file. So in your .config file it will show like # CONFIG_ is not set.

# CONFIG_<optionName> is not set In this case also you are explicitly disabling this config. So generated config file (.config) will show like # CONFIG_<optionName> is not set.

However with Any of these options you can disable the config item; but as per @ Alexandre comment it seems that "not set" is the proper way.

You can refer to the below link for more detail about the .config and defconfig file:

What exactly does Linux kernel's `make defconfig` do?

tleb
  • 4,395
  • 3
  • 25
  • 33
vinod maverick
  • 670
  • 4
  • 14