From 5c472fc895c32a189d574b338057164e95430825 Mon Sep 17 00:00:00 2001 From: nbd Date: Thu, 20 Apr 2006 20:17:34 +0000 Subject: add kconfig from linux 2.6 to scripts/config git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3682 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/config/conf.c | 626 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 626 insertions(+) create mode 100644 scripts/config/conf.c (limited to 'scripts/config/conf.c') diff --git a/scripts/config/conf.c b/scripts/config/conf.c new file mode 100644 index 0000000000..10eeae53d8 --- /dev/null +++ b/scripts/config/conf.c @@ -0,0 +1,626 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#include +#include +#include +#include +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" + +static void conf(struct menu *menu); +static void check_conf(struct menu *menu); + +enum { + ask_all, + ask_new, + ask_silent, + set_default, + set_yes, + set_mod, + set_no, + set_random +} input_mode = ask_all; +char *defconfig_file; + +static int indent = 1; +static int valid_stdin = 1; +static int conf_cnt; +static char line[128]; +static struct menu *rootEntry; + +static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); + +static void strip(char *str) +{ + char *p = str; + int l; + + while ((isspace(*p))) + p++; + l = strlen(p); + if (p != str) + memmove(str, p, l + 1); + if (!l) + return; + p = str + l - 1; + while ((isspace(*p))) + *p-- = 0; +} + +static void check_stdin(void) +{ + if (!valid_stdin && input_mode == ask_silent) { + printf(_("aborted!\n\n")); + printf(_("Console input/output is redirected. ")); + printf(_("Run 'make oldconfig' to update configuration.\n\n")); + exit(1); + } +} + +static char *fgets_check_stream(char *s, int size, FILE *stream) +{ + char *ret = fgets(s, size, stream); + + if (ret == NULL && feof(stream)) { + printf(_("aborted!\n\n")); + printf(_("Console input is closed. ")); + printf(_("Run 'make oldconfig' to update configuration.\n\n")); + exit(1); + } + + return ret; +} + +static void conf_askvalue(struct symbol *sym, const char *def) +{ + enum symbol_type type = sym_get_type(sym); + tristate val; + + if (!sym_has_value(sym)) + printf("(NEW) "); + + line[0] = '\n'; + line[1] = 0; + + if (!sym_is_changable(sym)) { + printf("%s\n", def); + line[0] = '\n'; + line[1] = 0; + return; + } + + switch (input_mode) { + case set_no: + case set_mod: + case set_yes: + case set_random: + if (sym_has_value(sym)) { + printf("%s\n", def); + return; + } + break; + case ask_new: + case ask_silent: + if (sym_has_value(sym)) { + printf("%s\n", def); + return; + } + check_stdin(); + case ask_all: + fflush(stdout); + fgets_check_stream(line, 128, stdin); + return; + case set_default: + printf("%s\n", def); + return; + default: + break; + } + + switch (type) { + case S_INT: + case S_HEX: + case S_STRING: + printf("%s\n", def); + return; + default: + ; + } + switch (input_mode) { + case set_yes: + if (sym_tristate_within_range(sym, yes)) { + line[0] = 'y'; + line[1] = '\n'; + line[2] = 0; + break; + } + case set_mod: + if (type == S_TRISTATE) { + if (sym_tristate_within_range(sym, mod)) { + line[0] = 'm'; + line[1] = '\n'; + line[2] = 0; + break; + } + } else { + if (sym_tristate_within_range(sym, yes)) { + line[0] = 'y'; + line[1] = '\n'; + line[2] = 0; + break; + } + } + case set_no: + if (sym_tristate_within_range(sym, no)) { + line[0] = 'n'; + line[1] = '\n'; + line[2] = 0; + break; + } + case set_random: + do { + val = (tristate)(random() % 3); + } while (!sym_tristate_within_range(sym, val)); + switch (val) { + case no: line[0] = 'n'; break; + case mod: line[0] = 'm'; break; + case yes: line[0] = 'y'; break; + } + line[1] = '\n'; + line[2] = 0; + break; + default: + break; + } + printf("%s", line); +} + +int conf_string(struct menu *menu) +{ + struct symbol *sym = menu->sym; + const char *def, *help; + + while (1) { + printf("%*s%s ", indent - 1, "", menu->prompt->text); + printf("(%s) ", sym->name); + def = sym_get_string_value(sym); + if (sym_get_string_value(sym)) + printf("[%s] ", def); + conf_askvalue(sym, def); + switch (line[0]) { + case '\n': + break; + case '?': + /* print help */ + if (line[1] == '\n') { + help = nohelp_text; + if (menu->sym->help) + help = menu->sym->help; + printf("\n%s\n", menu->sym->help); + def = NULL; + break; + } + default: + line[strlen(line)-1] = 0; + def = line; + } + if (def && sym_set_string_value(sym, def)) + return 0; + } +} + +static int conf_sym(struct menu *menu) +{ + struct symbol *sym = menu->sym; + int type; + tristate oldval, newval; + const char *help; + + while (1) { + printf("%*s%s ", indent - 1, "", menu->prompt->text); + if (sym->name) + printf("(%s) ", sym->name); + type = sym_get_type(sym); + putchar('['); + oldval = sym_get_tristate_value(sym); + switch (oldval) { + case no: + putchar('N'); + break; + case mod: + putchar('M'); + break; + case yes: + putchar('Y'); + break; + } + if (oldval != no && sym_tristate_within_range(sym, no)) + printf("/n"); + if (oldval != mod && sym_tristate_within_range(sym, mod)) + printf("/m"); + if (oldval != yes && sym_tristate_within_range(sym, yes)) + printf("/y"); + if (sym->help) + printf("/?"); + printf("] "); + conf_askvalue(sym, sym_get_string_value(sym)); + strip(line); + + switch (line[0]) { + case 'n': + case 'N': + newval = no; + if (!line[1] || !strcmp(&line[1], "o")) + break; + continue; + case 'm': + case 'M': + newval = mod; + if (!line[1]) + break; + continue; + case 'y': + case 'Y': + newval = yes; + if (!line[1] || !strcmp(&line[1], "es")) + break; + continue; + case 0: + newval = oldval; + break; + case '?': + goto help; + default: + continue; + } + if (sym_set_tristate_value(sym, newval)) + return 0; +help: + help = nohelp_text; + if (sym->help) + help = sym->help; + printf("\n%s\n", help); + } +} + +static int conf_choice(struct menu *menu) +{ + struct symbol *sym, *def_sym; + struct menu *child; + int type; + bool is_new; + + sym = menu->sym; + type = sym_get_type(sym); + is_new = !sym_has_value(sym); + if (sym_is_changable(sym)) { + conf_sym(menu); + sym_calc_value(sym); + switch (sym_get_tristate_value(sym)) { + case no: + return 1; + case mod: + return 0; + case yes: + break; + } + } else { + switch (sym_get_tristate_value(sym)) { + case no: + return 1; + case mod: + printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu)); + return 0; + case yes: + break; + } + } + + while (1) { + int cnt, def; + + printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu)); + def_sym = sym_get_choice_value(sym); + cnt = def = 0; + line[0] = '0'; + line[1] = 0; + for (child = menu->list; child; child = child->next) { + if (!menu_is_visible(child)) + continue; + if (!child->sym) { + printf("%*c %s\n", indent, '*', menu_get_prompt(child)); + continue; + } + cnt++; + if (child->sym == def_sym) { + def = cnt; + printf("%*c", indent, '>'); + } else + printf("%*c", indent, ' '); + printf(" %d. %s", cnt, menu_get_prompt(child)); + if (child->sym->name) + printf(" (%s)", child->sym->name); + if (!sym_has_value(child->sym)) + printf(" (NEW)"); + printf("\n"); + } + printf("%*schoice", indent - 1, ""); + if (cnt == 1) { + printf("[1]: 1\n"); + goto conf_childs; + } + printf("[1-%d", cnt); + if (sym->help) + printf("?"); + printf("]: "); + switch (input_mode) { + case ask_new: + case ask_silent: + if (!is_new) { + cnt = def; + printf("%d\n", cnt); + break; + } + check_stdin(); + case ask_all: + fflush(stdout); + fgets_check_stream(line, 128, stdin); + strip(line); + if (line[0] == '?') { + printf("\n%s\n", menu->sym->help ? + menu->sym->help : nohelp_text); + continue; + } + if (!line[0]) + cnt = def; + else if (isdigit(line[0])) + cnt = atoi(line); + else + continue; + break; + case set_random: + def = (random() % cnt) + 1; + case set_default: + case set_yes: + case set_mod: + case set_no: + cnt = def; + printf("%d\n", cnt); + break; + } + + conf_childs: + for (child = menu->list; child; child = child->next) { + if (!child->sym || !menu_is_visible(child)) + continue; + if (!--cnt) + break; + } + if (!child) + continue; + if (line[strlen(line) - 1] == '?') { + printf("\n%s\n", child->sym->help ? + child->sym->help : nohelp_text); + continue; + } + sym_set_choice_value(sym, child->sym); + if (child->list) { + indent += 2; + conf(child->list); + indent -= 2; + } + return 1; + } +} + +static void conf(struct menu *menu) +{ + struct symbol *sym; + struct property *prop; + struct menu *child; + + if (!menu_is_visible(menu)) + return; + + sym = menu->sym; + prop = menu->prompt; + if (prop) { + const char *prompt; + + switch (prop->type) { + case P_MENU: + if (input_mode == ask_silent && rootEntry != menu) { + check_conf(menu); + return; + } + case P_COMMENT: + prompt = menu_get_prompt(menu); + if (prompt) + printf("%*c\n%*c %s\n%*c\n", + indent, '*', + indent, '*', prompt, + indent, '*'); + default: + ; + } + } + + if (!sym) + goto conf_childs; + + if (sym_is_choice(sym)) { + conf_choice(menu); + if (sym->curr.tri != mod) + return; + goto conf_childs; + } + + switch (sym->type) { + case S_INT: + case S_HEX: + case S_STRING: + conf_string(menu); + break; + default: + conf_sym(menu); + break; + } + +conf_childs: + if (sym) + indent += 2; + for (child = menu->list; child; child = child->next) + conf(child); + if (sym) + indent -= 2; +} + +static void check_conf(struct menu *menu) +{ + struct symbol *sym; + struct menu *child; + + if (!menu_is_visible(menu)) + return; + + sym = menu->sym; + if (sym && !sym_has_value(sym)) { + if (sym_is_changable(sym) || + (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) { + if (!conf_cnt++) + printf(_("*\n* Restart config...\n*\n")); + rootEntry = menu_get_parent_menu(menu); + conf(rootEntry); + } + } + + for (child = menu->list; child; child = child->next) + check_conf(child); +} + +int main(int ac, char **av) +{ + int i = 1; + const char *name; + struct stat tmpstat; + + if (ac > i && av[i][0] == '-') { + switch (av[i++][1]) { + case 'o': + input_mode = ask_new; + break; + case 's': + input_mode = ask_silent; + valid_stdin = isatty(0) && isatty(1) && isatty(2); + break; + case 'd': + input_mode = set_default; + break; + case 'D': + input_mode = set_default; + defconfig_file = av[i++]; + if (!defconfig_file) { + printf(_("%s: No default config file specified\n"), + av[0]); + exit(1); + } + break; + case 'n': + input_mode = set_no; + break; + case 'm': + input_mode = set_mod; + break; + case 'y': + input_mode = set_yes; + break; + case 'r': + input_mode = set_random; + srandom(time(NULL)); + break; + case 'h': + case '?': + printf("%s [-o|-s] config\n", av[0]); + exit(0); + } + } + name = av[i]; + if (!name) { + printf(_("%s: Kconfig file missing\n"), av[0]); + } + conf_parse(name); + //zconfdump(stdout); + switch (input_mode) { + case set_default: + if (!defconfig_file) + defconfig_file = conf_get_default_confname(); + if (conf_read(defconfig_file)) { + printf("***\n" + "*** Can't find default configuration \"%s\"!\n" + "***\n", defconfig_file); + exit(1); + } + break; + case ask_silent: + if (stat(".config", &tmpstat)) { + printf(_("***\n" + "*** You have not yet configured your kernel!\n" + "***\n" + "*** Please run some configurator (e.g. \"make oldconfig\" or\n" + "*** \"make menuconfig\" or \"make xconfig\").\n" + "***\n")); + exit(1); + } + case ask_all: + case ask_new: + conf_read(NULL); + break; + case set_no: + case set_mod: + case set_yes: + case set_random: + name = getenv("KCONFIG_ALLCONFIG"); + if (name && !stat(name, &tmpstat)) { + conf_read_simple(name); + break; + } + switch (input_mode) { + case set_no: name = "allno.config"; break; + case set_mod: name = "allmod.config"; break; + case set_yes: name = "allyes.config"; break; + case set_random: name = "allrandom.config"; break; + default: break; + } + if (!stat(name, &tmpstat)) + conf_read_simple(name); + else if (!stat("all.config", &tmpstat)) + conf_read_simple("all.config"); + break; + default: + break; + } + + if (input_mode != ask_silent) { + rootEntry = &rootmenu; + conf(&rootmenu); + if (input_mode == ask_all) { + input_mode = ask_silent; + valid_stdin = 1; + } + } + do { + conf_cnt = 0; + check_conf(&rootmenu); + } while (conf_cnt); + if (conf_write(NULL)) { + fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); + return 1; + } + return 0; +} -- cgit v1.2.3 From 451518eba5be299ae1ef004112a6ecdc3b2e26c0 Mon Sep 17 00:00:00 2001 From: nbd Date: Thu, 20 Apr 2006 21:00:14 +0000 Subject: modify the kconfig system for openwrt git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3683 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/config/Makefile | 8 ++++---- scripts/config/README | 2 ++ scripts/config/conf.c | 4 ++-- scripts/config/confdata.c | 14 +++++++------- scripts/config/mconf.c | 38 ++++++++++++++++++-------------------- scripts/config/menu.c | 3 +++ scripts/config/symbol.c | 13 +++++++++++-- scripts/config/zconf.tab.c_shipped | 2 +- scripts/config/zconf.y | 2 +- 9 files changed, 49 insertions(+), 37 deletions(-) create mode 100644 scripts/config/README (limited to 'scripts/config/conf.c') diff --git a/scripts/config/Makefile b/scripts/config/Makefile index 04e8330a01..a731a40e7c 100644 --- a/scripts/config/Makefile +++ b/scripts/config/Makefile @@ -1,5 +1,5 @@ # =========================================================================== -# Kernel configuration targets +# OpenWrt configuration targets # These targets are used from top-level makefile # =========================================================================== @@ -40,10 +40,10 @@ lex.zconf.c: zconf.l zconf.hash.c: zconf.gperf %.tab.c: %.y - bison -l -b $* -p $(notdir $*) $< && cp $@ $@_shipped || cp $@_shipped $@ + cp $@_shipped $@ || bison -l -b $* -p $(notdir $*) $< lex.%.c: %.l - flex -L -P$(notdir $*) -o$@ $< && cp $@ $@_shipped || cp $@_shipped $@ + cp $@_shipped $@ || flex -L -P$(notdir $*) -o$@ $< %.hash.c: %.gperf - gperf < $< > $@ && cp $@ $@_shipped || cp $@_shipped $@ + cp $@_shipped $@ || gperf < $< > $@ diff --git a/scripts/config/README b/scripts/config/README new file mode 100644 index 0000000000..54aaefb598 --- /dev/null +++ b/scripts/config/README @@ -0,0 +1,2 @@ +These files were taken from the Linux 2.6.16.7 Kernel +Configuration System and modified for the OpenWrt Buildroot. diff --git a/scripts/config/conf.c b/scripts/config/conf.c index 10eeae53d8..cb2093691e 100644 --- a/scripts/config/conf.c +++ b/scripts/config/conf.c @@ -570,7 +570,7 @@ int main(int ac, char **av) case ask_silent: if (stat(".config", &tmpstat)) { printf(_("***\n" - "*** You have not yet configured your kernel!\n" + "*** You have not yet configured your build!\n" "***\n" "*** Please run some configurator (e.g. \"make oldconfig\" or\n" "*** \"make menuconfig\" or \"make xconfig\").\n" @@ -619,7 +619,7 @@ int main(int ac, char **av) check_conf(&rootmenu); } while (conf_cnt); if (conf_write(NULL)) { - fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); + fprintf(stderr, _("\n*** Error during writing of the build configuration.\n\n")); return 1; } return 0; diff --git a/scripts/config/confdata.c b/scripts/config/confdata.c index b0cbbe2e41..a1abdeb087 100644 --- a/scripts/config/confdata.c +++ b/scripts/config/confdata.c @@ -22,13 +22,10 @@ static int conf_lineno, conf_warnings, conf_unsaved; const char conf_def_filename[] = ".config"; -const char conf_defname[] = "arch/$ARCH/defconfig"; +const char conf_defname[] = "scripts/config/defconfig"; const char *conf_confnames[] = { ".config", - "/lib/modules/$UNAME_RELEASE/.config", - "/etc/kernel-config", - "/boot/config-$UNAME_RELEASE", conf_defname, NULL, }; @@ -375,7 +372,7 @@ int conf_write(const char *name) if (!out_h) return 1; } - sym = sym_lookup("KERNELVERSION", 0); + sym = sym_lookup("OPENWRTVERSION", 0); sym_calc_value(sym); time(&now); env = getenv("KCONFIG_NOTIMESTAMP"); @@ -384,7 +381,7 @@ int conf_write(const char *name) fprintf(out, _("#\n" "# Automatically generated make config: don't edit\n" - "# Linux kernel version: %s\n" + "# OpenWrt version: %s\n" "%s%s" "#\n"), sym_get_string_value(sym), @@ -393,7 +390,7 @@ int conf_write(const char *name) if (out_h) fprintf(out_h, "/*\n" " * Automatically generated C config: don't edit\n" - " * Linux kernel version: %s\n" + " * OpenWrt version: %s\n" "%s%s" " */\n" "#define AUTOCONF_INCLUDED\n", @@ -428,8 +425,11 @@ int conf_write(const char *name) type = sym->type; if (type == S_TRISTATE) { sym_calc_value(modules_sym); +/* tristate always enabled */ +#if 0 if (modules_sym->curr.tri == no) type = S_BOOLEAN; +#endif } switch (type) { case S_BOOLEAN: diff --git a/scripts/config/mconf.c b/scripts/config/mconf.c index bb82bbe49f..69cd56f138 100644 --- a/scripts/config/mconf.c +++ b/scripts/config/mconf.c @@ -29,11 +29,9 @@ static char menu_backtitle[128]; static const char mconf_readme[] = N_( "Overview\n" "--------\n" -"Some kernel features may be built directly into the kernel.\n" -"Some may be made into loadable runtime modules. Some features\n" -"may be completely removed altogether. There are also certain\n" -"kernel parameters which are not really features, but must be\n" -"entered in as decimal or hexadecimal numbers or possibly text.\n" +"Some OpenWrt features may be built directly into the image.\n" +"Some may be made into installable ipkg packages. Some features\n" +"may be completely removed altogether.\n" "\n" "Menu items beginning with [*], or [ ] represent features\n" "configured to be built in, modularized or removed respectively.\n" @@ -115,7 +113,7 @@ static const char mconf_readme[] = N_( "-----------------------------\n" "Menuconfig supports the use of alternate configuration files for\n" "those who, for various reasons, find it necessary to switch\n" -"between different kernel configurations.\n" +"between different OpenWrt configurations.\n" "\n" "At the end of the main menu you will find two options. One is\n" "for saving the current configuration to a file of your choosing.\n" @@ -148,7 +146,7 @@ static const char mconf_readme[] = N_( "\n" "Optional personality available\n" "------------------------------\n" -"If you prefer to have all of the kernel options listed in a single\n" +"If you prefer to have all of the build options listed in a single\n" "menu, rather than the default multimenu hierarchy, run the menuconfig\n" "with MENUCONFIG_MODE environment variable set to single_menu. Example:\n" "\n" @@ -186,18 +184,18 @@ setmod_text[] = N_( "This feature depends on another which has been configured as a module.\n" "As a result, this feature will be built as a module."), nohelp_text[] = N_( - "There is no help available for this kernel option.\n"), + "There is no help available for this config option.\n"), load_config_text[] = N_( "Enter the name of the configuration file you wish to load. " "Accept the name shown to restore the configuration you " "last retrieved. Leave blank to abort."), load_config_help[] = N_( "\n" - "For various reasons, one may wish to keep several different kernel\n" + "For various reasons, one may wish to keep several different OpenWrt\n" "configurations available on a single machine.\n" "\n" - "If you have saved a previous configuration in a file other than the\n" - "kernel's default, entering the name of the file here will allow you\n" + "If you have saved a previous configuration in a file other than\n" + "OpenWrt's default, entering the name of the file here will allow you\n" "to modify that configuration.\n" "\n" "If you are uncertain, then you have probably never used alternate\n" @@ -207,7 +205,7 @@ save_config_text[] = N_( "as an alternate. Leave blank to abort."), save_config_help[] = N_( "\n" - "For various reasons, one may wish to keep different kernel\n" + "For various reasons, one may wish to keep different OpenWrt\n" "configurations available on a single machine.\n" "\n" "Entering a file name here will allow you to later retrieve, modify\n" @@ -1051,9 +1049,9 @@ int main(int ac, char **av) conf_parse(av[1]); conf_read(NULL); - sym = sym_lookup("KERNELVERSION", 0); + sym = sym_lookup("OPENWRTVERSION", 0); sym_calc_value(sym); - sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"), + sprintf(menu_backtitle, _("OpenWrt %s Configuration"), sym_get_string_value(sym)); mode = getenv("MENUCONFIG_MODE"); @@ -1070,7 +1068,7 @@ int main(int ac, char **av) do { cprint_init(); cprint("--yesno"); - cprint(_("Do you wish to save your new kernel configuration?")); + cprint(_("Do you wish to save your new OpenWrt configuration?")); cprint("5"); cprint("60"); stat = exec_conf(); @@ -1079,18 +1077,18 @@ int main(int ac, char **av) if (stat == 0) { if (conf_write(NULL)) { fprintf(stderr, _("\n\n" - "Error during writing of the kernel configuration.\n" - "Your kernel configuration changes were NOT saved." + "Error during writing of the OpenWrt configuration.\n" + "Your configuration changes were NOT saved." "\n\n")); return 1; } printf(_("\n\n" - "*** End of Linux kernel configuration.\n" - "*** Execute 'make' to build the kernel or try 'make help'." + "*** End of OpenWrt configuration.\n" + "*** Execute 'make' to build the OpenWrt or try 'make help'." "\n\n")); } else { fprintf(stderr, _("\n\n" - "Your kernel configuration changes were NOT saved." + "Your configuration changes were NOT saved." "\n\n")); } diff --git a/scripts/config/menu.c b/scripts/config/menu.c index 0fce20cb7f..20fda9b2fc 100644 --- a/scripts/config/menu.c +++ b/scripts/config/menu.c @@ -88,11 +88,14 @@ struct expr *menu_check_dep(struct expr *e) e->left.expr = menu_check_dep(e->left.expr); e->right.expr = menu_check_dep(e->right.expr); break; +/* tristate always enabled */ +#if 0 case E_SYMBOL: /* change 'm' into 'm' && MODULES */ if (e->left.sym == &symbol_mod) return expr_alloc_and(e, expr_alloc_symbol(modules_sym)); break; +#endif default: break; } diff --git a/scripts/config/symbol.c b/scripts/config/symbol.c index 3d7877afcc..b79d81ac13 100644 --- a/scripts/config/symbol.c +++ b/scripts/config/symbol.c @@ -61,10 +61,10 @@ void sym_init(void) if (p) sym_add_default(sym, p); - sym = sym_lookup("KERNELVERSION", 0); + sym = sym_lookup("OPENWRTVERSION", 0); sym->type = S_STRING; sym->flags |= SYMBOL_AUTO; - p = getenv("KERNELVERSION"); + p = getenv("OPENWRTVERSION"); if (p) sym_add_default(sym, p); @@ -81,8 +81,11 @@ enum symbol_type sym_get_type(struct symbol *sym) if (type == S_TRISTATE) { if (sym_is_choice_value(sym) && sym->visible == yes) type = S_BOOLEAN; +/* tristate always enabled */ +#if 0 else if (modules_val == no) type = S_BOOLEAN; +#endif } return type; } @@ -201,7 +204,12 @@ static void sym_calc_visibility(struct symbol *sym) prop->visible.tri = expr_calc_value(prop->visible.expr); tri = E_OR(tri, prop->visible.tri); } +/* tristate always enabled */ +#if 0 if (tri == mod && (sym->type != S_TRISTATE || modules_val == no)) +#else + if (tri == mod && (sym->type != S_TRISTATE)) +#endif tri = yes; if (sym->visible != tri) { sym->visible = tri; @@ -354,6 +362,7 @@ void sym_calc_value(struct symbol *sym) if (memcmp(&oldval, &sym->curr, sizeof(oldval))) sym_set_changed(sym); + if (modules_sym == sym) modules_val = modules_sym->curr.tri; diff --git a/scripts/config/zconf.tab.c_shipped b/scripts/config/zconf.tab.c_shipped index dbf1e039ed..8060dc6a06 100644 --- a/scripts/config/zconf.tab.c_shipped +++ b/scripts/config/zconf.tab.c_shipped @@ -1922,7 +1922,7 @@ void conf_parse(const char *name) sym_init(); menu_init(); modules_sym = sym_lookup("MODULES", 0); - rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); + rootmenu.prompt = menu_add_prompt(P_MENU, "OpenWrt Configuration", NULL); #if YYDEBUG if (getenv("ZCONF_DEBUG")) diff --git a/scripts/config/zconf.y b/scripts/config/zconf.y index 1f61fba6aa..83243f5efe 100644 --- a/scripts/config/zconf.y +++ b/scripts/config/zconf.y @@ -459,7 +459,7 @@ void conf_parse(const char *name) sym_init(); menu_init(); modules_sym = sym_lookup("MODULES", 0); - rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); + rootmenu.prompt = menu_add_prompt(P_MENU, "OpenWrt Configuration", NULL); #if YYDEBUG if (getenv("ZCONF_DEBUG")) -- cgit v1.2.3