Lines Matching +full:cpu +full:- +full:cfg
1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
135 while ((ch = getopt(argc, argv, "Cd:gI:mps:Vvx:")) != -1)
155 ipath->path = optarg;
180 argc -= optind;
204 while (len > 1 && destdir[len - 1] == '/')
205 destdir[--len] = '\0';
217 * Ensure that required elements (machine, cpu, ident) are present.
228 printf("cpu type must be specified\n");
289 if (stat(pwd, &lg) != -1 && stat(srcdir, &phy) != -1 &&
301 "usage: config [-CgmpV] [-d destdir] [-s srcdir] sysname\n");
302 fprintf(stderr, " config -x kernel\n");
461 configfile_dynamic(std::ostringstream &cfg)
471 cfg << "options\t" << OPT_AUTOGEN << lend;
472 cfg << "ident\t" << ident << lend;
473 cfg << "machine\t" << machinename << lend;
475 cfg << "cpu\t" << cput->cpu_name << lend;
477 cfg << "makeoptions\t" << ol->op_name << '=' <<
478 ol->op_value << lend;
480 if (strncmp(ol->op_name, "DEV_", 4) == 0)
482 cfg << "options\t" << ol->op_name;
483 if (ol->op_value != NULL) {
484 cfg << '=';
485 for (i = 0; i < strlen(ol->op_value); i++) {
486 if (ol->op_value[i] == '"')
487 cfg << '\\' << ol->op_value[i];
489 cfg << ol->op_value[i];
493 cfg << lend;
499 cfg << "device\t" << d->d_name << lend;
507 configfile_filebased(std::ostringstream &cfg)
519 cff = fopen(cf->cfg_path, "r");
521 warn("Couldn't open file %s", cf->cfg_path);
526 cfg << "\\n\\\n";
528 cfg << '\\' << i;
530 cfg << i;
540 std::ostringstream cfg;
553 configfile_filebased(cfg);
555 configfile_dynamic(cfg);
558 cfg.flush();
569 fprintf(fo, "%s", cfg.str().c_str());
578 * moveifchanged --
655 remember(fl->f_fn);
664 len = strlen(dp->d_name);
665 /* Skip non-headers */
666 if (len < 2 || dp->d_name[len - 2] != '.' ||
667 dp->d_name[len - 1] != 'h')
670 if (strchr(dp->d_name, '_') &&
671 strncmp(dp->d_name, "opt_", 4) != 0)
674 for (hl = htab; hl != NULL; hl = hl->h_next) {
675 if (eq(dp->d_name, hl->h_name)) {
681 printf("Removing stale header: %s\n", dp->d_name);
682 p = path(dp->d_name);
683 if (unlink(p) == -1)
684 warn("unlink %s", dp->d_name);
705 for (hl = htab; hl != NULL; hl = hl->h_next) {
706 if (eq(s, hl->h_name)) {
714 hl->h_name = s;
715 hl->h_next = htab;
722 * elfdump -a, which output is parsed by some UNIX tools...
734 if (r == -1)
737 if (error == -1)
749 asprintf(&cmd, "/usr/bin/elfdump -c %s | grep -A 8 kern_conf"
750 "| tail -5 | cut -d ' ' -f 2 | paste - - - - -", file);
761 if (size > SIZE_MAX - off || off + size > (size_t)st.st_size)
775 assert(i == size - 1 &&