4

For Boolean config, I am using select. Is there a similar one for string?

Eventually, I would like to have something like:

config MY_VAR_STR
string

config MY_VAR_BOOL
bool
default n

config OPTION_2
bool
# Set MY_VAR_BOOL value to y
select MY_VAR_BOOL
# something like set MY_VAR "test string"
Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
Bechir
  • 987
  • 10
  • 26

2 Answers2

3

It is not possible to use select for non booleans according to kernel docs v4.15

https://github.com/torvalds/linux/blob/v4.15/Documentation/kbuild/kconfig-language.txt#L104 says:

- reverse dependencies: "select" <symbol> ["if" <expr>] 
  [...]
  Reverse dependencies can only be used with boolean or tristate symbols.

This likely implies it is not possible at all.

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
1

It's possible to use default on string variable like that:

config MY_VAR_STR
    string
    default "test string" if OPTION_2

config OPTION_2
    bool