对于布尔配置,我使用select。是否有类似的字符串?
最后,我希望有类似的东西:
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"
根据内核docs v4.15,不可能将select
用于非布尔值
https://github.com/torvalds/linux/blob/v4.15/Documentation/kbuild/kconfig-language.txt#L104说:
- reverse dependencies: "select" <symbol> ["if" <expr>]
[...]
Reverse dependencies can only be used with boolean or tristate symbols.
这可能意味着根本不可能。