PHONY += oldnoconfig savedefconfig defconfig
+ifneq ($(VARIANT_DEFCONFIG),)
+export KCONFIG_VARIANT := arch/$(SRCARCH)/configs/$(VARIANT_DEFCONFIG)
+endif
+
+ifneq ($(DEBUG_DEFCONFIG),)
+export KCONFIG_DEBUG := arch/$(SRCARCH)/configs/$(DEBUG_DEFCONFIG)
+endif
+
+ifneq ($(SELINUX_DEFCONFIG),)
+export KCONFIG_SELINUX := arch/$(SRCARCH)/configs/$(SELINUX_DEFCONFIG)
+endif
+
+ifneq ($(SELINUX_LOG_DEFCONFIG),)
+export KCONFIG_LOG_SELINUX := arch/$(SRCARCH)/configs/$(SELINUX_LOG_DEFCONFIG)
+endif
+
# oldnoconfig is an alias of olddefconfig, because people already are dependent
# on its behavior (sets new symbols to their default value but not 'n') with the
# counter-intuitive name.
"***\n"), defconfig_file);
exit(1);
}
+ name = getenv("KCONFIG_SELINUX");
+ printf("KCONFIG_SELINUX(%s)\n", name);
+ if (name) {
+ if (conf_read_simple(name, S_DEF_USER, false)) {
+ printf(_("***\n"
+ "*** Can't find selinux configuration \"%s\"!\n"
+ "***\n"), name);
+ exit(1);
+ }
+ }
+ name = getenv("KCONFIG_LOG_SELINUX");
+ printf("KCONFIG_LOG_SELINUX(%s)\n", name);
+ if (name) {
+ if (conf_read_simple(name, S_DEF_USER, false)) {
+ printf(_("***\n"
+ "*** Can't find selinux log configuration \"%s\"!\n"
+ "***\n"), name);
+ exit(1);
+ }
+ }
+ name = getenv("KCONFIG_VARIANT");
+ printf("KCONFIG_VARIANT(%s)\n", name);
+ if (name) {
+ if (conf_read_simple(name, S_DEF_USER, false)) {
+ printf(_("***\n"
+ "*** Can't find variant configuration \"%s\"!\n"
+ "***\n"), name);
+ exit(1);
+ }
+ } else {
+ printf(_("***\n"
+ "*** You must specify VARIANT_DEFCONFIG !\n"
+ "***\n"));
+ exit(1);
+ }
+ name = getenv("KCONFIG_DEBUG");
+ printf("KCONFIG_DEBUG(%s)\n", name);
+ if (name) {
+ if (conf_read_simple(name, S_DEF_USER, false)) {
+ printf(_("***\n"
+ "*** Can't find debug configuration \"%s\"!\n"
+ "***\n"), name);
+ exit(1);
+ }
+ }
break;
case savedefconfig:
case silentoldconfig:
if (!name)
break;
if ((strcmp(name, "") != 0) && (strcmp(name, "1") != 0)) {
- if (conf_read_simple(name, S_DEF_USER)) {
+ if (conf_read_simple(name, S_DEF_USER, true)) {
fprintf(stderr,
_("*** Can't read seed configuration \"%s\"!\n"),
name);
case randconfig: name = "allrandom.config"; break;
default: break;
}
- if (conf_read_simple(name, S_DEF_USER) &&
- conf_read_simple("all.config", S_DEF_USER)) {
+ if (conf_read_simple(name, S_DEF_USER, true) &&
+ conf_read_simple("all.config", S_DEF_USER, true)) {
fprintf(stderr,
_("*** KCONFIG_ALLCONFIG set, but no \"%s\" or \"all.config\" file found\n"),
name);
return -1;
}
-int conf_read_simple(const char *name, int def)
+int conf_read_simple(const char *name, int def, int sym_init)
{
FILE *in = NULL;
char *line = NULL;
conf_unsaved = 0;
def_flags = SYMBOL_DEF << def;
+
+ if (!sym_init)
+ goto readsym;
+
for_all_symbols(i, sym) {
sym->flags |= SYMBOL_CHANGED;
sym->flags &= ~(def_flags|SYMBOL_VALID);
}
}
+readsym:
while (compat_getline(&line, &line_asize, in) != -1) {
conf_lineno++;
sym = NULL;
sym_set_change_count(0);
- if (conf_read_simple(name, S_DEF_USER)) {
+ if (conf_read_simple(name, S_DEF_USER, true)) {
sym_calc_value(modules_sym);
return 1;
}
int res, i, fd;
name = conf_get_autoconfig_name();
- conf_read_simple(name, S_DEF_AUTO);
+ conf_read_simple(name, S_DEF_AUTO, true);
sym_calc_value(modules_sym);
if (chdir("include/config"))
/* confdata.c */
void conf_parse(const char *name);
int conf_read(const char *name);
-int conf_read_simple(const char *name, int);
+int conf_read_simple(const char *name, int, int);
int conf_write_defconfig(const char *name);
int conf_write(const char *name);
int conf_write_autoconf(void);