~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to scripts/kconfig/mconf.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
static const char mconf_readme[] = N_(
26
26
"Overview\n"
27
27
"--------\n"
28
 
"Some kernel features may be built directly into the kernel.\n"
29
 
"Some may be made into loadable runtime modules.  Some features\n"
30
 
"may be completely removed altogether.  There are also certain\n"
31
 
"kernel parameters which are not really features, but must be\n"
32
 
"entered in as decimal or hexadecimal numbers or possibly text.\n"
 
28
"This interface let you select features and parameters for the build.\n"
 
29
"Features can either be built-in, modularized, or ignored. Parameters\n"
 
30
"must be entered in as decimal or hexadecimal numbers or text.\n"
33
31
"\n"
34
32
"Menu items beginning with following braces represent features that\n"
35
33
"  [ ] can be built in or removed\n"
67
65
"             there is a delayed response which you may find annoying.\n"
68
66
"\n"
69
67
"   Also, the <TAB> and cursor keys will cycle between <Select>,\n"
70
 
"   <Exit> and <Help>\n"
 
68
"   <Exit> and <Help>.\n"
71
69
"\n"
72
70
"o  To get help with an item, use the cursor keys to highlight <Help>\n"
73
 
"   and Press <ENTER>.\n"
 
71
"   and press <ENTER>.\n"
74
72
"\n"
75
73
"   Shortcut: Press <H> or <?>.\n"
76
74
"\n"
 
75
"o  To toggle the display of hidden options, press <Z>.\n"
 
76
"\n"
77
77
"\n"
78
78
"Radiolists  (Choice lists)\n"
79
79
"-----------\n"
115
115
"-----------------------------\n"
116
116
"Menuconfig supports the use of alternate configuration files for\n"
117
117
"those who, for various reasons, find it necessary to switch\n"
118
 
"between different kernel configurations.\n"
 
118
"between different configurations.\n"
119
119
"\n"
120
120
"At the end of the main menu you will find two options.  One is\n"
121
121
"for saving the current configuration to a file of your choosing.\n"
148
148
"\n"
149
149
"Optional personality available\n"
150
150
"------------------------------\n"
151
 
"If you prefer to have all of the kernel options listed in a single\n"
152
 
"menu, rather than the default multimenu hierarchy, run the menuconfig\n"
153
 
"with MENUCONFIG_MODE environment variable set to single_menu. Example:\n"
 
151
"If you prefer to have all of the options listed in a single menu, rather\n"
 
152
"than the default multimenu hierarchy, run the menuconfig with\n"
 
153
"MENUCONFIG_MODE environment variable set to single_menu. Example:\n"
154
154
"\n"
155
155
"make MENUCONFIG_MODE=single_menu menuconfig\n"
156
156
"\n"
205
205
        "last retrieved.  Leave blank to abort."),
206
206
load_config_help[] = N_(
207
207
        "\n"
208
 
        "For various reasons, one may wish to keep several different kernel\n"
 
208
        "For various reasons, one may wish to keep several different\n"
209
209
        "configurations available on a single machine.\n"
210
210
        "\n"
211
211
        "If you have saved a previous configuration in a file other than the\n"
212
 
        "kernel's default, entering the name of the file here will allow you\n"
213
 
        "to modify that configuration.\n"
 
212
        "default one, entering its name here will allow you to modify that\n"
 
213
        "configuration.\n"
214
214
        "\n"
215
215
        "If you are uncertain, then you have probably never used alternate\n"
216
 
        "configuration files.  You should therefor leave this blank to abort.\n"),
 
216
        "configuration files. You should therefore leave this blank to abort.\n"),
217
217
save_config_text[] = N_(
218
218
        "Enter a filename to which this configuration should be saved "
219
219
        "as an alternate.  Leave blank to abort."),
220
220
save_config_help[] = N_(
221
221
        "\n"
222
 
        "For various reasons, one may wish to keep different kernel\n"
223
 
        "configurations available on a single machine.\n"
 
222
        "For various reasons, one may wish to keep different configurations\n"
 
223
        "available on a single machine.\n"
224
224
        "\n"
225
225
        "Entering a file name here will allow you to later retrieve, modify\n"
226
226
        "and use the current configuration as an alternate to whatever\n"
230
230
        "leave this blank.\n"),
231
231
search_help[] = N_(
232
232
        "\n"
233
 
        "Search for CONFIG_ symbols and display their relations.\n"
 
233
        "Search for symbols and display their relations.\n"
234
234
        "Regular expressions are allowed.\n"
235
235
        "Example: search for \"^FOO\"\n"
236
236
        "Result:\n"
247
247
        "Selected by: BAR\n"
248
248
        "-----------------------------------------------------------------\n"
249
249
        "o The line 'Prompt:' shows the text used in the menu structure for\n"
250
 
        "  this CONFIG_ symbol\n"
 
250
        "  this symbol\n"
251
251
        "o The 'Defined at' line tell at what file / line number the symbol\n"
252
252
        "  is defined\n"
253
253
        "o The 'Depends on:' line tell what symbols needs to be defined for\n"
263
263
        "Only relevant lines are shown.\n"
264
264
        "\n\n"
265
265
        "Search examples:\n"
266
 
        "Examples: USB  => find all CONFIG_ symbols containing USB\n"
267
 
        "          ^USB => find all CONFIG_ symbols starting with USB\n"
268
 
        "          USB$ => find all CONFIG_ symbols ending with USB\n"
 
266
        "Examples: USB  => find all symbols containing USB\n"
 
267
        "          ^USB => find all symbols starting with USB\n"
 
268
        "          USB$ => find all symbols ending with USB\n"
269
269
        "\n");
270
270
 
271
271
static int indent;
272
272
static struct menu *current_menu;
273
273
static int child_count;
274
274
static int single_menu_mode;
 
275
static int show_all_options;
275
276
 
276
277
static void conf(struct menu *menu);
277
278
static void conf_choice(struct menu *menu);
282
283
static void show_helptext(const char *title, const char *text);
283
284
static void show_help(struct menu *menu);
284
285
 
285
 
static struct gstr get_relations_str(struct symbol **sym_arr)
286
 
{
287
 
        struct symbol *sym;
288
 
        struct gstr res = str_new();
289
 
        int i;
290
 
 
291
 
        for (i = 0; sym_arr && (sym = sym_arr[i]); i++)
292
 
                get_symbol_str(&res, sym);
293
 
        if (!i)
294
 
                str_append(&res, _("No matches found.\n"));
295
 
        return res;
296
 
}
297
 
 
298
286
static char filename[PATH_MAX+1];
299
287
static void set_config_filename(const char *config_filename)
300
288
{
301
289
        static char menu_backtitle[PATH_MAX+128];
302
290
        int size;
303
 
        struct symbol *sym;
304
291
 
305
 
        sym = sym_lookup("KERNELVERSION", 0);
306
 
        sym_calc_value(sym);
307
292
        size = snprintf(menu_backtitle, sizeof(menu_backtitle),
308
 
                        _("%s - Linux Kernel v%s Configuration"),
309
 
                        config_filename, sym_get_string_value(sym));
 
293
                        "%s - %s", config_filename, rootmenu.prompt->text);
310
294
        if (size >= sizeof(menu_backtitle))
311
295
                menu_backtitle[sizeof(menu_backtitle)-1] = '\0';
312
296
        set_dialog_backtitle(menu_backtitle);
326
310
again:
327
311
        dialog_clear();
328
312
        dres = dialog_inputbox(_("Search Configuration Parameter"),
329
 
                              _("Enter CONFIG_ (sub)string to search for "
330
 
                                "(with or without \"CONFIG\")"),
 
313
                              _("Enter " CONFIG_ " (sub)string to search for "
 
314
                                "(with or without \"" CONFIG_ "\")"),
331
315
                              10, 75, "");
332
316
        switch (dres) {
333
317
        case 0:
339
323
                return;
340
324
        }
341
325
 
342
 
        /* strip CONFIG_ if necessary */
 
326
        /* strip the prefix if necessary */
343
327
        dialog_input = dialog_input_result;
344
 
        if (strncasecmp(dialog_input_result, "CONFIG_", 7) == 0)
345
 
                dialog_input += 7;
 
328
        if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0)
 
329
                dialog_input += strlen(CONFIG_);
346
330
 
347
331
        sym_arr = sym_re_search(dialog_input);
348
332
        res = get_relations_str(sym_arr);
359
343
        int type, tmp, doint = 2;
360
344
        tristate val;
361
345
        char ch;
 
346
        bool visible;
362
347
 
363
 
        if (!menu_is_visible(menu))
 
348
        /*
 
349
         * note: menu_is_visible() has side effect that it will
 
350
         * recalc the value of the symbol.
 
351
         */
 
352
        visible = menu_is_visible(menu);
 
353
        if (show_all_options && !menu_has_prompt(menu))
 
354
                return;
 
355
        else if (!show_all_options && !visible)
364
356
                return;
365
357
 
366
358
        sym = menu->sym;
619
611
                case 7:
620
612
                        search_conf();
621
613
                        break;
 
614
                case 8:
 
615
                        show_all_options = !show_all_options;
 
616
                        break;
622
617
                }
623
618
        }
624
619
}
638
633
{
639
634
        struct gstr help = str_new();
640
635
 
 
636
        help.max_width = getmaxx(stdscr) - 10;
641
637
        menu_get_ext_help(menu, &help);
642
638
 
643
639
        show_helptext(_(menu_get_prompt(menu)), str_get(&help));
832
828
                if (conf_get_changed())
833
829
                        res = dialog_yesno(NULL,
834
830
                                           _("Do you wish to save your "
835
 
                                             "new kernel configuration?\n"
 
831
                                             "new configuration?\n"
836
832
                                             "<ESC><ESC> to continue."),
837
833
                                           6, 60);
838
834
                else
844
840
        case 0:
845
841
                if (conf_write(filename)) {
846
842
                        fprintf(stderr, _("\n\n"
847
 
                                "Error during writing of the kernel configuration.\n"
848
 
                                "Your kernel configuration changes were NOT saved."
 
843
                                "Error while writing of the configuration.\n"
 
844
                                "Your configuration changes were NOT saved."
849
845
                                "\n\n"));
850
846
                        return 1;
851
847
                }
852
848
        case -1:
853
849
                printf(_("\n\n"
854
 
                        "*** End of Linux kernel configuration.\n"
855
 
                        "*** Execute 'make' to build the kernel or try 'make help'."
 
850
                        "*** End of the configuration.\n"
 
851
                        "*** Execute 'make' to start the build or try 'make help'."
856
852
                        "\n\n"));
857
853
                break;
858
854
        default:
859
855
                fprintf(stderr, _("\n\n"
860
 
                        "Your kernel configuration changes were NOT saved."
 
856
                        "Your configuration changes were NOT saved."
861
857
                        "\n\n"));
862
858
        }
863
859