MCPcopy Create free account
hub / github.com/coreboot/coreboot / main

Function main

util/kconfig/conf.c:718–927  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

716}
717
718int main(int ac, char **av)
719{
720 const char *progname = av[0];
721 int opt;
722 const char *name, *defconfig_file = NULL /* gcc uninit */;
723 int no_conf_write = 0;
724
725 tty_stdio = isatty(0) && isatty(1);
726
727 while ((opt = getopt_long(ac, av, "hs", long_opts, NULL)) != -1) {
728 switch (opt) {
729 case 'h':
730 conf_usage(progname);
731 exit(1);
732 break;
733 case 's':
734 conf_set_message_callback(NULL);
735 break;
736 case 0:
737 input_mode = input_mode_opt;
738 switch (input_mode) {
739 case syncconfig:
740 /*
741 * syncconfig is invoked during the build stage.
742 * Suppress distracting
743 * "configuration written to ..."
744 */
745 conf_set_message_callback(NULL);
746 sync_kconfig = 1;
747 break;
748 case defconfig:
749 case savedefconfig:
750 defconfig_file = optarg;
751 break;
752 case randconfig:
753 set_randconfig_seed();
754 break;
755 default:
756 break;
757 }
758 default:
759 break;
760 }
761 }
762 if (ac == optind) {
763 fprintf(stderr, "%s: Kconfig file missing\n", av[0]);
764 conf_usage(progname);
765 exit(1);
766 }
767 conf_parse(av[optind]);
768 //zconfdump(stdout);
769
770 switch (input_mode) {
771 case defconfig:
772 if (conf_read(defconfig_file)) {
773 fprintf(stderr,
774 "***\n"
775 "*** Can't find default configuration \"%s\"!\n"

Callers

nothing calls this directly

Calls 15

getopt_longFunction · 0.85
conf_usageFunction · 0.85
exitFunction · 0.85
set_randconfig_seedFunction · 0.85
fprintfFunction · 0.85
conf_readFunction · 0.85
conf_read_simpleFunction · 0.85
conf_errorsFunction · 0.85
conf_get_changedFunction · 0.85
conf_set_all_new_symbolsFunction · 0.85
conf_rewrite_tristatesFunction · 0.85

Tested by

no test coverage detected