summaryrefslogtreecommitdiff
path: root/scripts/kconfig/mconf.c
Unidiff
Diffstat (limited to 'scripts/kconfig/mconf.c') (more/less context) (show whitespace changes)
-rw-r--r--scripts/kconfig/mconf.c56
1 files changed, 39 insertions, 17 deletions
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 6d82718..b9cf25f 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -48,20 +48,20 @@ inputbox_instructions_string[] =
48setmod_text[] = 48setmod_text[] =
49 "This feature depends on another which has been configured as a module.\n" 49 "This feature depends on another which has been configured as a module.\n"
50 "As a result, this feature will be built as a module.", 50 "As a result, this feature will be built as a module.",
51nohelp_text[] = 51nohelp_text[] =
52 "There is no help available for this kernel option.\n", 52 "There is no help available for this option.\n",
53load_config_text[] = 53load_config_text[] =
54 "Enter the name of the configuration file you wish to load. " 54 "Enter the name of the configuration file you wish to load. "
55 "Accept the name shown to restore the configuration you " 55 "Accept the name shown to restore the configuration you "
56 "last retrieved. Leave blank to abort.", 56 "last retrieved. Leave blank to abort.",
57load_config_help[] = 57load_config_help[] =
58 "\n" 58 "\n"
59 "For various reasons, one may wish to keep several different kernel\n" 59 "For various reasons, one may wish to keep several different \n"
60 "configurations available on a single machine.\n" 60 "configurations available on a single machine.\n"
61 "\n" 61 "\n"
62 "If you have saved a previous configuration in a file other than the\n" 62 "If you have saved a previous configuration in a file other than the\n"
63 "kernel's default, entering the name of the file here will allow you\n" 63 "default, entering the name of the file here will allow you\n"
64 "to modify that configuration.\n" 64 "to modify that configuration.\n"
65 "\n" 65 "\n"
66 "If you are uncertain, then you have probably never used alternate\n" 66 "If you are uncertain, then you have probably never used alternate\n"
67 "configuration files. You should therefor leave this blank to abort.\n", 67 "configuration files. You should therefor leave this blank to abort.\n",
@@ -69,9 +69,9 @@ save_config_text[] =
69 "Enter a filename to which this configuration should be saved " 69 "Enter a filename to which this configuration should be saved "
70 "as an alternate. Leave blank to abort.", 70 "as an alternate. Leave blank to abort.",
71save_config_help[] = 71save_config_help[] =
72 "\n" 72 "\n"
73 "For various reasons, one may wish to keep different kernel\n" 73 "For various reasons, one may wish to keep different\n"
74 "configurations available on a single machine.\n" 74 "configurations available on a single machine.\n"
75 "\n" 75 "\n"
76 "Entering a file name here will allow you to later retrieve, modify\n" 76 "Entering a file name here will allow you to later retrieve, modify\n"
77 "and use the current configuration as an alternate to whatever\n" 77 "and use the current configuration as an alternate to whatever\n"
@@ -146,14 +146,19 @@ static void init_wsize(void)
146} 146}
147 147
148static void cprint_init(void) 148static void cprint_init(void)
149{ 149{
150 char *env = getenv("LXDIALOG");
150 bufptr = buf; 151 bufptr = buf;
151 argptr = args; 152 argptr = args;
152 memset(args, 0, sizeof(args)); 153 memset(args, 0, sizeof(args));
153 indent = 0; 154 indent = 0;
154 child_count = 0; 155 child_count = 0;
156 if(env != NULL) {
157 cprint(env);
158 } else {
155 cprint("./scripts/lxdialog/lxdialog"); 159 cprint("./scripts/lxdialog/lxdialog");
160 }
156 cprint("--backtitle"); 161 cprint("--backtitle");
157 cprint(menu_backtitle); 162 cprint(menu_backtitle);
158} 163}
159 164
@@ -301,13 +306,10 @@ static void build_conf(struct menu *menu)
301 if (single_menu_mode) { 306 if (single_menu_mode) {
302 cprint1("%s%*c%s", 307 cprint1("%s%*c%s",
303 menu->data ? "-->" : "++>", 308 menu->data ? "-->" : "++>",
304 indent + 1, ' ', prompt); 309 indent + 1, ' ', prompt);
305 } else { 310 } else
306 if (menu->parent != &rootmenu) 311 cprint1(" %*c%s --->", indent + 1, ' ', prompt);
307 cprint1(" %*c", indent + 1, ' ');
308 cprint1("%s --->", prompt);
309 }
310 312
311 cprint_done(); 313 cprint_done();
312 if (single_menu_mode && menu->data) 314 if (single_menu_mode && menu->data)
313 goto conf_childs; 315 goto conf_childs;
@@ -372,8 +374,13 @@ static void build_conf(struct menu *menu)
372 return; 374 return;
373 } 375 }
374 cprint_done(); 376 cprint_done();
375 } else { 377 } else {
378 if (menu == current_menu) {
379 cprint(":%p", menu);
380 cprint("---%*c%s", indent + 1, ' ', menu_get_prompt(menu));
381 goto conf_childs;
382 }
376 child_count++; 383 child_count++;
377 val = sym_get_tristate_value(sym); 384 val = sym_get_tristate_value(sym);
378 if (sym_is_choice_value(sym) && val == yes) { 385 if (sym_is_choice_value(sym) && val == yes) {
379 cprint(":%p", menu); 386 cprint(":%p", menu);
@@ -381,33 +388,46 @@ static void build_conf(struct menu *menu)
381 } else { 388 } else {
382 switch (type) { 389 switch (type) {
383 case S_BOOLEAN: 390 case S_BOOLEAN:
384 cprint("t%p", menu); 391 cprint("t%p", menu);
392 if (sym_is_changable(sym))
385 cprint1("[%c]", val == no ? ' ' : '*'); 393 cprint1("[%c]", val == no ? ' ' : '*');
394 else
395 cprint1("---");
386 break; 396 break;
387 case S_TRISTATE: 397 case S_TRISTATE:
388 cprint("t%p", menu); 398 cprint("t%p", menu);
389 switch (val) { 399 switch (val) {
390 case yes: ch = '*'; break; 400 case yes: ch = '*'; break;
391 case mod: ch = 'M'; break; 401 case mod: ch = 'M'; break;
392 default: ch = ' '; break; 402 default: ch = ' '; break;
393 } 403 }
404 if (sym_is_changable(sym))
394 cprint1("<%c>", ch); 405 cprint1("<%c>", ch);
406 else
407 cprint1("---");
395 break; 408 break;
396 default: 409 default:
397 cprint("s%p", menu); 410 cprint("s%p", menu);
398 tmp = cprint1("(%s)", sym_get_string_value(sym)); 411 tmp = cprint1("(%s)", sym_get_string_value(sym));
399 tmp = indent - tmp + 4; 412 tmp = indent - tmp + 4;
400 if (tmp < 0) 413 if (tmp < 0)
401 tmp = 0; 414 tmp = 0;
402 cprint1("%*c%s%s", tmp, ' ', menu_get_prompt(menu), 415 cprint1("%*c%s%s", tmp, ' ', menu_get_prompt(menu),
403 sym_has_value(sym) ? "" : " (NEW)"); 416 (sym_has_value(sym) || !sym_is_changable(sym)) ?
417 "" : " (NEW)");
404 cprint_done(); 418 cprint_done();
405 goto conf_childs; 419 goto conf_childs;
406 } 420 }
407 } 421 }
408 cprint1("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu), 422 cprint1("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu),
409 sym_has_value(sym) ? "" : " (NEW)"); 423 (sym_has_value(sym) || !sym_is_changable(sym)) ?
424 "" : " (NEW)");
425 if (menu->prompt->type == P_MENU) {
426 cprint1(" --->");
427 cprint_done();
428 return;
429 }
410 cprint_done(); 430 cprint_done();
411 } 431 }
412 432
413conf_childs: 433conf_childs:
@@ -483,8 +503,10 @@ static void conf(struct menu *menu)
483 break; 503 break;
484 case 't': 504 case 't':
485 if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes) 505 if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)
486 conf_choice(submenu); 506 conf_choice(submenu);
507 else if (submenu->prompt->type == P_MENU)
508 conf(submenu);
487 break; 509 break;
488 case 's': 510 case 's':
489 conf_string(submenu); 511 conf_string(submenu);
490 break; 512 break;
@@ -743,10 +765,9 @@ int main(int ac, char **av)
743 conf_read(NULL); 765 conf_read(NULL);
744 766
745 sym = sym_lookup("KERNELRELEASE", 0); 767 sym = sym_lookup("KERNELRELEASE", 0);
746 sym_calc_value(sym); 768 sym_calc_value(sym);
747 sprintf(menu_backtitle, "Opie %s Configuration", 769 sprintf(menu_backtitle, "Build Configuration");
748 sym_get_string_value(sym));
749 770
750 mode = getenv("MENUCONFIG_MODE"); 771 mode = getenv("MENUCONFIG_MODE");
751 if (mode) { 772 if (mode) {
752 if (!strcasecmp(mode, "single_menu")) 773 if (!strcasecmp(mode, "single_menu"))
@@ -769,12 +790,13 @@ int main(int ac, char **av)
769 790
770 if (stat == 0) { 791 if (stat == 0) {
771 conf_write(NULL); 792 conf_write(NULL);
772 printf("\n\n" 793 printf("\n\n"
773 "*** End of Opie configuration.\n" 794 "*** End of configuration.\n"
774 "*** Check the top-level Makefile for additional configuration.\n" 795 "\n\n");
775 "*** Next, you may run 'make'.\n\n");
776 } else 796 } else
777 printf("\n\nYour Opie configuration changes were NOT saved.\n\n"); 797 printf("\n\n"
798 "Your configuration changes were NOT saved."
799 "\n\n");
778 800
779 return 0; 801 return 0;
780} 802}