author | llornkcor <llornkcor> | 2003-01-21 03:17:22 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-01-21 03:17:22 (UTC) |
commit | 39491a189517289bb0bdd88bf2d1776d25168239 (patch) (unidiff) | |
tree | 899c1255612bd50b398b8c9449b20eed0878aa15 | |
parent | 6998d9a576bcfc137ae243a7b64fe9e668e7339f (diff) | |
download | opie-39491a189517289bb0bdd88bf2d1776d25168239.zip opie-39491a189517289bb0bdd88bf2d1776d25168239.tar.gz opie-39491a189517289bb0bdd88bf2d1776d25168239.tar.bz2 |
change Linux Kernel Configuration string
-rw-r--r-- | scripts/kconfig/mconf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index eba5ff7..26a94e7 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
@@ -555,226 +555,226 @@ static void show_helptext(const char *title, const char *text) | |||
555 | } | 555 | } |
556 | 556 | ||
557 | static void show_help(struct menu *menu) | 557 | static void show_help(struct menu *menu) |
558 | { | 558 | { |
559 | const char *help; | 559 | const char *help; |
560 | char *helptext; | 560 | char *helptext; |
561 | struct symbol *sym = menu->sym; | 561 | struct symbol *sym = menu->sym; |
562 | 562 | ||
563 | help = sym->help; | 563 | help = sym->help; |
564 | if (!help) | 564 | if (!help) |
565 | help = nohelp_text; | 565 | help = nohelp_text; |
566 | if (sym->name) { | 566 | if (sym->name) { |
567 | helptext = malloc(strlen(sym->name) + strlen(help) + 16); | 567 | helptext = malloc(strlen(sym->name) + strlen(help) + 16); |
568 | sprintf(helptext, "CONFIG_%s:\n\n%s", sym->name, help); | 568 | sprintf(helptext, "CONFIG_%s:\n\n%s", sym->name, help); |
569 | show_helptext(menu_get_prompt(menu), helptext); | 569 | show_helptext(menu_get_prompt(menu), helptext); |
570 | free(helptext); | 570 | free(helptext); |
571 | } else | 571 | } else |
572 | show_helptext(menu_get_prompt(menu), help); | 572 | show_helptext(menu_get_prompt(menu), help); |
573 | } | 573 | } |
574 | 574 | ||
575 | static void show_readme(void) | 575 | static void show_readme(void) |
576 | { | 576 | { |
577 | do { | 577 | do { |
578 | cprint_init(); | 578 | cprint_init(); |
579 | cprint("--textbox"); | 579 | cprint("--textbox"); |
580 | cprint("scripts/README.Menuconfig"); | 580 | cprint("scripts/README.Menuconfig"); |
581 | cprint("%d", rows); | 581 | cprint("%d", rows); |
582 | cprint("%d", cols); | 582 | cprint("%d", cols); |
583 | } while (exec_conf() == -1); | 583 | } while (exec_conf() == -1); |
584 | } | 584 | } |
585 | 585 | ||
586 | static void conf_choice(struct menu *menu) | 586 | static void conf_choice(struct menu *menu) |
587 | { | 587 | { |
588 | const char *prompt = menu_get_prompt(menu); | 588 | const char *prompt = menu_get_prompt(menu); |
589 | struct menu *child; | 589 | struct menu *child; |
590 | struct symbol *active; | 590 | struct symbol *active; |
591 | int stat; | 591 | int stat; |
592 | 592 | ||
593 | while (1) { | 593 | while (1) { |
594 | cprint_init(); | 594 | cprint_init(); |
595 | cprint("--title"); | 595 | cprint("--title"); |
596 | cprint("%s", prompt ? prompt : "Main Menu"); | 596 | cprint("%s", prompt ? prompt : "Main Menu"); |
597 | cprint("--radiolist"); | 597 | cprint("--radiolist"); |
598 | cprint(radiolist_instructions); | 598 | cprint(radiolist_instructions); |
599 | cprint("15"); | 599 | cprint("15"); |
600 | cprint("70"); | 600 | cprint("70"); |
601 | cprint("6"); | 601 | cprint("6"); |
602 | 602 | ||
603 | current_menu = menu; | 603 | current_menu = menu; |
604 | active = sym_get_choice_value(menu->sym); | 604 | active = sym_get_choice_value(menu->sym); |
605 | for (child = menu->list; child; child = child->next) { | 605 | for (child = menu->list; child; child = child->next) { |
606 | if (!menu_is_visible(child)) | 606 | if (!menu_is_visible(child)) |
607 | continue; | 607 | continue; |
608 | cprint("%p", child); | 608 | cprint("%p", child); |
609 | cprint("%s", menu_get_prompt(child)); | 609 | cprint("%s", menu_get_prompt(child)); |
610 | cprint(child->sym == active ? "ON" : "OFF"); | 610 | cprint(child->sym == active ? "ON" : "OFF"); |
611 | } | 611 | } |
612 | 612 | ||
613 | stat = exec_conf(); | 613 | stat = exec_conf(); |
614 | switch (stat) { | 614 | switch (stat) { |
615 | case 0: | 615 | case 0: |
616 | if (sscanf(input_buf, "%p", &menu) != 1) | 616 | if (sscanf(input_buf, "%p", &menu) != 1) |
617 | break; | 617 | break; |
618 | sym_set_tristate_value(menu->sym, yes); | 618 | sym_set_tristate_value(menu->sym, yes); |
619 | return; | 619 | return; |
620 | case 1: | 620 | case 1: |
621 | show_help(menu); | 621 | show_help(menu); |
622 | break; | 622 | break; |
623 | case 255: | 623 | case 255: |
624 | return; | 624 | return; |
625 | } | 625 | } |
626 | } | 626 | } |
627 | } | 627 | } |
628 | 628 | ||
629 | static void conf_string(struct menu *menu) | 629 | static void conf_string(struct menu *menu) |
630 | { | 630 | { |
631 | const char *prompt = menu_get_prompt(menu); | 631 | const char *prompt = menu_get_prompt(menu); |
632 | int stat; | 632 | int stat; |
633 | 633 | ||
634 | while (1) { | 634 | while (1) { |
635 | cprint_init(); | 635 | cprint_init(); |
636 | cprint("--title"); | 636 | cprint("--title"); |
637 | cprint("%s", prompt ? prompt : "Main Menu"); | 637 | cprint("%s", prompt ? prompt : "Main Menu"); |
638 | cprint("--inputbox"); | 638 | cprint("--inputbox"); |
639 | switch (sym_get_type(menu->sym)) { | 639 | switch (sym_get_type(menu->sym)) { |
640 | case S_INT: | 640 | case S_INT: |
641 | cprint(inputbox_instructions_int); | 641 | cprint(inputbox_instructions_int); |
642 | break; | 642 | break; |
643 | case S_HEX: | 643 | case S_HEX: |
644 | cprint(inputbox_instructions_hex); | 644 | cprint(inputbox_instructions_hex); |
645 | break; | 645 | break; |
646 | case S_STRING: | 646 | case S_STRING: |
647 | cprint(inputbox_instructions_string); | 647 | cprint(inputbox_instructions_string); |
648 | break; | 648 | break; |
649 | default: | 649 | default: |
650 | /* panic? */; | 650 | /* panic? */; |
651 | } | 651 | } |
652 | cprint("10"); | 652 | cprint("10"); |
653 | cprint("75"); | 653 | cprint("75"); |
654 | cprint("%s", sym_get_string_value(menu->sym)); | 654 | cprint("%s", sym_get_string_value(menu->sym)); |
655 | stat = exec_conf(); | 655 | stat = exec_conf(); |
656 | switch (stat) { | 656 | switch (stat) { |
657 | case 0: | 657 | case 0: |
658 | if (sym_set_string_value(menu->sym, input_buf)) | 658 | if (sym_set_string_value(menu->sym, input_buf)) |
659 | return; | 659 | return; |
660 | show_textbox(NULL, "You have made an invalid entry.", 5, 43); | 660 | show_textbox(NULL, "You have made an invalid entry.", 5, 43); |
661 | break; | 661 | break; |
662 | case 1: | 662 | case 1: |
663 | show_help(menu); | 663 | show_help(menu); |
664 | break; | 664 | break; |
665 | case 255: | 665 | case 255: |
666 | return; | 666 | return; |
667 | } | 667 | } |
668 | } | 668 | } |
669 | } | 669 | } |
670 | 670 | ||
671 | static void conf_load(void) | 671 | static void conf_load(void) |
672 | { | 672 | { |
673 | int stat; | 673 | int stat; |
674 | 674 | ||
675 | while (1) { | 675 | while (1) { |
676 | cprint_init(); | 676 | cprint_init(); |
677 | cprint("--inputbox"); | 677 | cprint("--inputbox"); |
678 | cprint(load_config_text); | 678 | cprint(load_config_text); |
679 | cprint("11"); | 679 | cprint("11"); |
680 | cprint("55"); | 680 | cprint("55"); |
681 | cprint("%s", filename); | 681 | cprint("%s", filename); |
682 | stat = exec_conf(); | 682 | stat = exec_conf(); |
683 | switch(stat) { | 683 | switch(stat) { |
684 | case 0: | 684 | case 0: |
685 | if (!input_buf[0]) | 685 | if (!input_buf[0]) |
686 | return; | 686 | return; |
687 | if (!conf_read(input_buf)) | 687 | if (!conf_read(input_buf)) |
688 | return; | 688 | return; |
689 | show_textbox(NULL, "File does not exist!", 5, 38); | 689 | show_textbox(NULL, "File does not exist!", 5, 38); |
690 | break; | 690 | break; |
691 | case 1: | 691 | case 1: |
692 | show_helptext("Load Alternate Configuration", load_config_help); | 692 | show_helptext("Load Alternate Configuration", load_config_help); |
693 | break; | 693 | break; |
694 | case 255: | 694 | case 255: |
695 | return; | 695 | return; |
696 | } | 696 | } |
697 | } | 697 | } |
698 | } | 698 | } |
699 | 699 | ||
700 | static void conf_save(void) | 700 | static void conf_save(void) |
701 | { | 701 | { |
702 | int stat; | 702 | int stat; |
703 | 703 | ||
704 | while (1) { | 704 | while (1) { |
705 | cprint_init(); | 705 | cprint_init(); |
706 | cprint("--inputbox"); | 706 | cprint("--inputbox"); |
707 | cprint(save_config_text); | 707 | cprint(save_config_text); |
708 | cprint("11"); | 708 | cprint("11"); |
709 | cprint("55"); | 709 | cprint("55"); |
710 | cprint("%s", filename); | 710 | cprint("%s", filename); |
711 | stat = exec_conf(); | 711 | stat = exec_conf(); |
712 | switch(stat) { | 712 | switch(stat) { |
713 | case 0: | 713 | case 0: |
714 | if (!input_buf[0]) | 714 | if (!input_buf[0]) |
715 | return; | 715 | return; |
716 | if (!conf_write(input_buf)) | 716 | if (!conf_write(input_buf)) |
717 | return; | 717 | return; |
718 | show_textbox(NULL, "Can't create file! Probably a nonexistent directory.", 5, 60); | 718 | show_textbox(NULL, "Can't create file! Probably a nonexistent directory.", 5, 60); |
719 | break; | 719 | break; |
720 | case 1: | 720 | case 1: |
721 | show_helptext("Save Alternate Configuration", save_config_help); | 721 | show_helptext("Save Alternate Configuration", save_config_help); |
722 | break; | 722 | break; |
723 | case 255: | 723 | case 255: |
724 | return; | 724 | return; |
725 | } | 725 | } |
726 | } | 726 | } |
727 | } | 727 | } |
728 | 728 | ||
729 | static void conf_cleanup(void) | 729 | static void conf_cleanup(void) |
730 | { | 730 | { |
731 | tcsetattr(1, TCSAFLUSH, &ios_org); | 731 | tcsetattr(1, TCSAFLUSH, &ios_org); |
732 | unlink(".help.tmp"); | 732 | unlink(".help.tmp"); |
733 | unlink("lxdialog.scrltmp"); | 733 | unlink("lxdialog.scrltmp"); |
734 | } | 734 | } |
735 | 735 | ||
736 | int main(int ac, char **av) | 736 | int main(int ac, char **av) |
737 | { | 737 | { |
738 | struct symbol *sym; | 738 | struct symbol *sym; |
739 | char *mode; | 739 | char *mode; |
740 | int stat; | 740 | int stat; |
741 | 741 | ||
742 | conf_parse(av[1]); | 742 | conf_parse(av[1]); |
743 | conf_read(NULL); | 743 | conf_read(NULL); |
744 | 744 | ||
745 | sym = sym_lookup("KERNELRELEASE", 0); | 745 | sym = sym_lookup("KERNELRELEASE", 0); |
746 | sym_calc_value(sym); | 746 | sym_calc_value(sym); |
747 | sprintf(menu_backtitle, "Linux Kernel v%s Configuration", | 747 | sprintf(menu_backtitle, "Opie %s Configuration", |
748 | sym_get_string_value(sym)); | 748 | sym_get_string_value(sym)); |
749 | 749 | ||
750 | mode = getenv("MENUCONFIG_MODE"); | 750 | mode = getenv("MENUCONFIG_MODE"); |
751 | if (mode) { | 751 | if (mode) { |
752 | if (!strcasecmp(mode, "single_menu")) | 752 | if (!strcasecmp(mode, "single_menu")) |
753 | single_menu_mode = 1; | 753 | single_menu_mode = 1; |
754 | } | 754 | } |
755 | 755 | ||
756 | tcgetattr(1, &ios_org); | 756 | tcgetattr(1, &ios_org); |
757 | atexit(conf_cleanup); | 757 | atexit(conf_cleanup); |
758 | init_wsize(); | 758 | init_wsize(); |
759 | conf(&rootmenu); | 759 | conf(&rootmenu); |
760 | 760 | ||
761 | do { | 761 | do { |
762 | cprint_init(); | 762 | cprint_init(); |
763 | cprint("--yesno"); | 763 | cprint("--yesno"); |
764 | cprint("Do you wish to save your new configuration?"); | 764 | cprint("Do you wish to save your new configuration?"); |
765 | cprint("5"); | 765 | cprint("5"); |
766 | cprint("60"); | 766 | cprint("60"); |
767 | stat = exec_conf(); | 767 | stat = exec_conf(); |
768 | } while (stat < 0); | 768 | } while (stat < 0); |
769 | 769 | ||
770 | if (stat == 0) { | 770 | if (stat == 0) { |
771 | conf_write(NULL); | 771 | conf_write(NULL); |
772 | printf("\n\n" | 772 | printf("\n\n" |
773 | "*** End of Linux kernel configuration.\n" | 773 | "*** End of Opie configuration.\n" |
774 | "*** Check the top-level Makefile for additional configuration.\n" | 774 | "*** Check the top-level Makefile for additional configuration.\n" |
775 | "*** Next, you may run 'make bzImage', 'make bzdisk', or 'make install'.\n\n"); | 775 | "*** Next, you may run 'makee'.\n\n"); |
776 | } else | 776 | } else |
777 | printf("\n\nYour kernel configuration changes were NOT saved.\n\n"); | 777 | printf("\n\nYour Opie configuration changes were NOT saved.\n\n"); |
778 | 778 | ||
779 | return 0; | 779 | return 0; |
780 | } | 780 | } |