Put back 2.6.23 files for rdc, allowing to switch from one kernel version to another...
[openwrt.git] / scripts / config / mconf.c
index bb82bbe..8c58b62 100644 (file)
@@ -22,6 +22,7 @@
 #include <unistd.h>
 #include <locale.h>
 
 #include <unistd.h>
 #include <locale.h>
 
+#define BUFSIZE 524288
 #define LKC_DIRECT_LINK
 #include "lkc.h"
 
 #define LKC_DIRECT_LINK
 #include "lkc.h"
 
@@ -29,19 +30,17 @@ static char menu_backtitle[128];
 static const char mconf_readme[] = N_(
 "Overview\n"
 "--------\n"
 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 [*], <M> or [ ] represent features\n"
 "\n"
 "Menu items beginning with [*], <M> or [ ] represent features\n"
-"configured to be built in, modularized or removed respectively.\n"
-"Pointed brackets <> represent module capable features.\n"
+"configured to be included, built as package or removed respectively.\n"
+"Pointed brackets <> represent packaging capable features.\n"
 "\n"
 "To change any of these features, highlight it with the cursor\n"
 "\n"
 "To change any of these features, highlight it with the cursor\n"
-"keys and press <Y> to build it in, <M> to make it a module or\n"
-"<N> to removed it.  You may also press the <Space Bar> to cycle\n"
+"keys and press <Y> to include it, <M> to make it a package or\n"
+"<N> to remove it.  You may also press the <Space Bar> to cycle\n"
 "through the available options (ie. Y->N->M->Y).\n"
 "\n"
 "Some additional keyboard hints:\n"
 "through the available options (ie. Y->N->M->Y).\n"
 "\n"
 "Some additional keyboard hints:\n"
@@ -115,7 +114,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"
 "-----------------------------\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"
 "\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 +147,7 @@ static const char mconf_readme[] = N_(
 "\n"
 "Optional personality available\n"
 "------------------------------\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"
 "menu, rather than the default multimenu hierarchy, run the menuconfig\n"
 "with MENUCONFIG_MODE environment variable set to single_menu. Example:\n"
 "\n"
@@ -164,9 +163,9 @@ menu_instructions[] = N_(
        "Arrow keys navigate the menu.  "
        "<Enter> selects submenus --->.  "
        "Highlighted letters are hotkeys.  "
        "Arrow keys navigate the menu.  "
        "<Enter> selects submenus --->.  "
        "Highlighted letters are hotkeys.  "
-       "Pressing <Y> includes, <N> excludes, <M> modularizes features.  "
+       "Pressing <Y> includes, <N> excludes, <M> builds as package.  "
        "Press <Esc><Esc> to exit, <?> for Help, </> for Search.  "
        "Press <Esc><Esc> to exit, <?> for Help, </> for Search.  "
-       "Legend: [*] built-in  [ ] excluded  <M> module  < > module capable"),
+       "Legend: [*] built-in  [ ] excluded  <M> package  < > package capable"),
 radiolist_instructions[] = N_(
        "Use the arrow keys to navigate this window or "
        "press the hotkey of the item you wish to select "
 radiolist_instructions[] = N_(
        "Use the arrow keys to navigate this window or "
        "press the hotkey of the item you wish to select "
@@ -183,21 +182,21 @@ inputbox_instructions_string[] = N_(
        "Please enter a string value. "
        "Use the <TAB> key to move from the input field to the buttons below it."),
 setmod_text[] = N_(
        "Please enter a string value. "
        "Use the <TAB> key to move from the input field to the buttons below it."),
 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."),
+       "This feature depends on another which has been configured as a package.\n"
+       "As a result, this feature will be built as a package."),
 nohelp_text[] = N_(
 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"
 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"
        "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"
        "to modify that configuration.\n"
        "\n"
        "If you are uncertain, then you have probably never used alternate\n"
@@ -207,7 +206,7 @@ save_config_text[] = N_(
        "as an alternate.  Leave blank to abort."),
 save_config_help[] = N_(
        "\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"
        "configurations available on a single machine.\n"
        "\n"
        "Entering a file name here will allow you to later retrieve, modify\n"
@@ -256,10 +255,10 @@ search_help[] = N_(
        "          USB$ => find all CONFIG_ symbols ending with USB\n"
        "\n");
 
        "          USB$ => find all CONFIG_ symbols ending with USB\n"
        "\n");
 
-static char buf[4096], *bufptr = buf;
-static char input_buf[4096];
+static char buf[BUFSIZE], *bufptr = buf;
+static char input_buf[BUFSIZE];
 static char filename[PATH_MAX+1] = ".config";
 static char filename[PATH_MAX+1] = ".config";
-static char *args[1024], **argptr = args;
+static char *args[BUFSIZE], **argptr = args;
 static int indent;
 static struct termios ios_org;
 static int rows = 0, cols = 0;
 static int indent;
 static struct termios ios_org;
 static int rows = 0, cols = 0;
@@ -406,6 +405,7 @@ static void get_symbol_str(struct gstr *r, struct symbol *sym)
                                       sym_get_string_value(sym));
        for_all_prompts(sym, prop)
                get_prompt_str(r, prop);
                                       sym_get_string_value(sym));
        for_all_prompts(sym, prop)
                get_prompt_str(r, prop);
+
        hit = false;
        for_all_properties(sym, prop, P_SELECT) {
                if (!hit) {
        hit = false;
        for_all_properties(sym, prop, P_SELECT) {
                if (!hit) {
@@ -417,11 +417,29 @@ static void get_symbol_str(struct gstr *r, struct symbol *sym)
        }
        if (hit)
                str_append(r, "\n");
        }
        if (hit)
                str_append(r, "\n");
+
+       hit = false;
+       for_all_properties(sym, prop, P_DESELECT) {
+               if (!hit) {
+                       str_append(r, "  Deselects: ");
+                       hit = true;
+               } else
+                       str_printf(r, " && ");
+               expr_gstr_print(prop->expr, r);
+       }
+       if (hit)
+               str_append(r, "\n");
+
        if (sym->rev_dep.expr) {
                str_append(r, "  Selected by: ");
                expr_gstr_print(sym->rev_dep.expr, r);
                str_append(r, "\n");
        }
        if (sym->rev_dep.expr) {
                str_append(r, "  Selected by: ");
                expr_gstr_print(sym->rev_dep.expr, r);
                str_append(r, "\n");
        }
+       if (sym->rev_dep_inv.expr) {
+               str_append(r, "  Deselected by: ");
+               expr_gstr_print(sym->rev_dep_inv.expr, r);
+               str_append(r, "\n");
+       }
        str_append(r, "\n\n");
 }
 
        str_append(r, "\n\n");
 }
 
@@ -739,6 +757,8 @@ static void conf(struct menu *menu)
                if (menu == &rootmenu) {
                        cprint(":");
                        cprint("--- ");
                if (menu == &rootmenu) {
                        cprint(":");
                        cprint("--- ");
+                       cprint("D");
+                       cprint(_("    Reset to defaults"));
                        cprint("L");
                        cprint(_("    Load an Alternate Configuration File"));
                        cprint("S");
                        cprint("L");
                        cprint(_("    Load an Alternate Configuration File"));
                        cprint("S");
@@ -785,6 +805,9 @@ static void conf(struct menu *menu)
                        case 's':
                                conf_string(submenu);
                                break;
                        case 's':
                                conf_string(submenu);
                                break;
+                       case 'D':
+                               conf_reset();
+                               break;
                        case 'L':
                                conf_load();
                                break;
                        case 'L':
                                conf_load();
                                break;
@@ -884,6 +907,7 @@ static void conf_choice(struct menu *menu)
        const char *prompt = menu_get_prompt(menu);
        struct menu *child;
        struct symbol *active;
        const char *prompt = menu_get_prompt(menu);
        struct menu *child;
        struct symbol *active;
+       struct property *prop;
        int stat;
 
        active = sym_get_choice_value(menu->sym);
        int stat;
 
        active = sym_get_choice_value(menu->sym);
@@ -916,6 +940,13 @@ static void conf_choice(struct menu *menu)
                case 0:
                        if (sscanf(input_buf, "%p", &child) != 1)
                                break;
                case 0:
                        if (sscanf(input_buf, "%p", &child) != 1)
                                break;
+                       
+                       if (sym_get_tristate_value(child->sym) != yes) {
+                               for_all_properties(menu->sym, prop, P_RESET) {
+                                       if (expr_calc_value(prop->visible.expr) != no)
+                                               conf_reset();
+                               }
+                       }
                        sym_set_tristate_value(child->sym, yes);
                        return;
                case 1:
                        sym_set_tristate_value(child->sym, yes);
                        return;
                case 1:
@@ -1051,9 +1082,9 @@ int main(int ac, char **av)
        conf_parse(av[1]);
        conf_read(NULL);
 
        conf_parse(av[1]);
        conf_read(NULL);
 
-       sym = sym_lookup("KERNELVERSION", 0);
+       sym = sym_lookup("OPENWRTVERSION", 0);
        sym_calc_value(sym);
        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");
                sym_get_string_value(sym));
 
        mode = getenv("MENUCONFIG_MODE");
@@ -1070,7 +1101,7 @@ int main(int ac, char **av)
        do {
                cprint_init();
                cprint("--yesno");
        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();
                cprint("5");
                cprint("60");
                stat = exec_conf();
@@ -1079,18 +1110,18 @@ int main(int ac, char **av)
        if (stat == 0) {
                if (conf_write(NULL)) {
                        fprintf(stderr, _("\n\n"
        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"
                                "\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"
                        "\n\n"));
        } else {
                fprintf(stderr, _("\n\n"
-                       "Your kernel configuration changes were NOT saved."
+                       "Your configuration changes were NOT saved."
                        "\n\n"));
        }
 
                        "\n\n"));
        }
 
This page took 0.042786 seconds and 4 git commands to generate.