diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2021-03-14 04:48:32 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2021-04-14 15:22:48 +0900 |
commit | b75b0a819af9f78fc395b189cddd40f590194d20 (patch) | |
tree | d02451f57f32ad27f68c01a8c56a3ec83ec6ed4d /scripts/kconfig/confdata.c | |
parent | kconfig: move JUMP_NB to mconf.c (diff) | |
download | linux-dev-b75b0a819af9f78fc395b189cddd40f590194d20.tar.xz linux-dev-b75b0a819af9f78fc395b189cddd40f590194d20.zip |
kconfig: change defconfig_list option to environment variable
"defconfig_list" is a weird option that defines a static symbol that
declares the list of base config files in case the .config does not
exist yet.
This is quite different from other normal symbols; we just abused the
"string" type and the "default" properties to list out the input files.
They must be fixed values since these are searched for and loaded in
the parse stage.
It is an ugly hack, and should not exist in the first place. Providing
this feature as an environment variable is a saner approach.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | scripts/kconfig/confdata.c | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 198f70957fbf..f3998d5ddd02 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -360,28 +360,46 @@ int conf_read_simple(const char *name, int def) if (name) { in = zconf_fopen(name); } else { - struct property *prop; + char *env; name = conf_get_configname(); in = zconf_fopen(name); if (in) goto load; sym_add_change_count(1); - if (!sym_defconfig_list) + + env = getenv("KCONFIG_DEFCONFIG_LIST"); + if (!env) return 1; - for_all_defaults(sym_defconfig_list, prop) { - if (expr_calc_value(prop->visible.expr) == no || - prop->expr->type != E_SYMBOL) - continue; - sym_calc_value(prop->expr->left.sym); - name = sym_get_string_value(prop->expr->left.sym); - in = zconf_fopen(name); + while (1) { + bool is_last; + + while (isspace(*env)) + env++; + + if (!*env) + break; + + p = env; + while (*p && !isspace(*p)) + p++; + + is_last = (*p == '\0'); + + *p = '\0'; + + in = zconf_fopen(env); if (in) { conf_message("using defaults found in %s", - name); + env); goto load; } + + if (is_last) + break; + + env = p + 1; } } if (!in) |