Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'kconfig-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kconfig updates from Masahiro Yamada:

- Change 'option defconfig' to the environment variable
KCONFIG_DEFCONFIG_LIST

- Refactor tinyconfig without using allnoconfig_y

- Remove 'option allnoconfig_y' syntax

- Change 'option modules' to 'modules'

- Do not use /boot/config-* etc. as base config for cross-compilation

- Fix a search bug in nconf

- Various code cleanups

* tag 'kconfig-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (34 commits)
kconfig: refactor .gitignore
kconfig: highlight xconfig 'comment' lines with '***'
kconfig: highlight gconfig 'comment' lines with '***'
kconfig: gconf: remove unused code
kconfig: remove unused PACKAGE definition
kconfig: nconf: stop endless search loops
kconfig: split menu.c out of parser.y
kconfig: nconf: refactor in print_in_middle()
kconfig: nconf: remove meaningless wattrset() call from show_menu()
kconfig: nconf: change set_config_filename() to void function
kconfig: nconf: refactor attributes setup code
kconfig: nconf: remove unneeded default for menu prompt
kconfig: nconf: get rid of (void) casts from wattrset() calls
kconfig: nconf: fix NORMAL attributes
kconfig: mconf,nconf: remove unneeded '\0' termination after snprintf()
kconfig: use /boot/config-* etc. as DEFCONFIG_LIST only for native build
kconfig: change sym_change_count to a boolean flag
kconfig: nconf: fix core dump when searching in empty menu
kconfig: lxdialog: A spello fix and a punctuation added
kconfig: streamline_config.pl: Couple of typo fixes
...

+574 -664
+4 -19
Documentation/kbuild/kconfig-language.rst
··· 223 223 the indentation level, this means it ends at the first line which has 224 224 a smaller indentation than the first line of the help text. 225 225 226 - - misc options: "option" <symbol>[=<value>] 227 - 228 - Various less common options can be defined via this option syntax, 229 - which can modify the behaviour of the menu entry and its config 230 - symbol. These options are currently possible: 231 - 232 - - "defconfig_list" 233 - This declares a list of default entries which can be used when 234 - looking for the default configuration (which is used when the main 235 - .config doesn't exists yet.) 236 - 237 - - "modules" 238 - This declares the symbol to be used as the MODULES symbol, which 239 - enables the third modular state for all config symbols. 240 - At most one symbol may have the "modules" option set. 241 - 242 - - "allnoconfig_y" 243 - This declares the symbol as one that should have the value y when 244 - using "allnoconfig". Used for symbols that hide other symbols. 226 + - module attribute: "modules" 227 + This declares the symbol to be used as the MODULES symbol, which 228 + enables the third modular state for all config symbols. 229 + At most one symbol may have the "modules" option set. 245 230 246 231 Menu dependencies 247 232 -----------------
+8
Documentation/kbuild/kconfig.rst
··· 41 41 This environment variable can be used to specify a default kernel config 42 42 file name to override the default name of ".config". 43 43 44 + KCONFIG_DEFCONFIG_LIST 45 + ---------------------- 46 + 47 + This environment variable specifies a list of config files which can be used 48 + as a base configuration in case the .config does not exist yet. Entries in 49 + the list are separated with whitespaces to each other, and the first one 50 + that exists is used. 51 + 44 52 KCONFIG_OVERWRITECONFIG 45 53 ----------------------- 46 54 If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not
+5 -3
Makefile
··· 404 404 SRCARCH := sh 405 405 endif 406 406 407 + export cross_compiling := 408 + ifneq ($(SRCARCH),$(SUBARCH)) 409 + cross_compiling := 1 410 + endif 411 + 407 412 KCONFIG_CONFIG ?= .config 408 413 export KCONFIG_CONFIG 409 - 410 - # Default file for 'make defconfig'. This may be overridden by arch-Makefile. 411 - export KBUILD_DEFCONFIG := defconfig 412 414 413 415 # SHELL used by kbuild 414 416 CONFIG_SHELL := sh
+1 -11
init/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - config DEFCONFIG_LIST 3 - string 4 - depends on !UML 5 - option defconfig_list 6 - default "/lib/modules/$(shell,uname -r)/.config" 7 - default "/etc/kernel-config" 8 - default "/boot/config-$(shell,uname -r)" 9 - default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)" 10 - 11 2 config CC_VERSION_TEXT 12 3 string 13 4 default "$(CC_VERSION_TEXT)" ··· 1796 1805 1797 1806 config EMBEDDED 1798 1807 bool "Embedded system" 1799 - option allnoconfig_y 1800 1808 select EXPERT 1801 1809 help 1802 1810 This option should be enabled if compiling the kernel for ··· 2070 2080 2071 2081 menuconfig MODULES 2072 2082 bool "Enable loadable module support" 2073 - option modules 2083 + modules 2074 2084 help 2075 2085 Kernel modules are small pieces of compiled code which can 2076 2086 be inserted in the running kernel, rather than being
+1
kernel/configs/tiny-base.config
··· 1 + CONFIG_EMBEDDED=y
+3 -10
scripts/kconfig/.gitignore
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 + /conf 3 + /[gmnq]conf 4 + /[gmnq]conf-cfg 2 5 /qconf-moc.cc 3 - *conf-cfg 4 - 5 - # 6 - # configuration programs 7 - # 8 - conf 9 - mconf 10 - nconf 11 - qconf 12 - gconf
+18 -3
scripts/kconfig/Makefile
··· 9 9 Kconfig := Kconfig 10 10 endif 11 11 12 + ifndef KBUILD_DEFCONFIG 13 + KBUILD_DEFCONFIG := defconfig 14 + endif 15 + 12 16 ifeq ($(quiet),silent_) 13 17 silent := -s 14 18 endif 19 + 20 + export KCONFIG_DEFCONFIG_LIST := 21 + ifndef cross_compiling 22 + kernel-release := $(shell uname -r) 23 + KCONFIG_DEFCONFIG_LIST += \ 24 + /lib/modules/$(kernel-release)/.config \ 25 + /etc/kernel-config \ 26 + /boot/config-$(kernel-release) 27 + endif 28 + KCONFIG_DEFCONFIG_LIST += arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) 15 29 16 30 # We need this, in case the user has it in its environment 17 31 unexport CONFIG_ ··· 102 88 103 89 PHONY += tinyconfig 104 90 tinyconfig: 105 - $(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config 91 + $(Q)KCONFIG_ALLCONFIG=kernel/configs/tiny-base.config $(MAKE) -f $(srctree)/Makefile allnoconfig 92 + $(Q)$(MAKE) -f $(srctree)/Makefile tiny.config 106 93 107 94 # CHECK: -o cache_dir=<path> working? 108 95 PHONY += testconfig ··· 143 128 144 129 # =========================================================================== 145 130 # object files used by all kconfig flavours 146 - common-objs := confdata.o expr.o lexer.lex.o parser.tab.o preprocess.o \ 147 - symbol.o util.o 131 + common-objs := confdata.o expr.o lexer.lex.o menu.o parser.tab.o \ 132 + preprocess.o symbol.o util.o 148 133 149 134 $(obj)/lexer.lex.o: $(obj)/parser.tab.h 150 135 HOSTCFLAGS_lexer.lex.o := -I $(srctree)/$(src)
+288 -75
scripts/kconfig/conf.c
··· 37 37 mod2yesconfig, 38 38 }; 39 39 static enum input_mode input_mode = oldaskconfig; 40 - 40 + static int input_mode_opt; 41 41 static int indent = 1; 42 42 static int tty_stdio; 43 43 static int sync_kconfig; ··· 80 80 81 81 if (!tty_stdio) 82 82 printf("%s", str); 83 + } 84 + 85 + static void set_randconfig_seed(void) 86 + { 87 + unsigned int seed; 88 + char *env; 89 + bool seed_set = false; 90 + 91 + env = getenv("KCONFIG_SEED"); 92 + if (env && *env) { 93 + char *endp; 94 + 95 + seed = strtol(env, &endp, 0); 96 + if (*endp == '\0') 97 + seed_set = true; 98 + } 99 + 100 + if (!seed_set) { 101 + struct timeval now; 102 + 103 + /* 104 + * Use microseconds derived seed, compensate for systems where it may 105 + * be zero. 106 + */ 107 + gettimeofday(&now, NULL); 108 + seed = (now.tv_sec + 1) * (now.tv_usec + 1); 109 + } 110 + 111 + printf("KCONFIG_SEED=0x%X\n", seed); 112 + srand(seed); 113 + } 114 + 115 + static bool randomize_choice_values(struct symbol *csym) 116 + { 117 + struct property *prop; 118 + struct symbol *sym; 119 + struct expr *e; 120 + int cnt, def; 121 + 122 + /* 123 + * If choice is mod then we may have more items selected 124 + * and if no then no-one. 125 + * In both cases stop. 126 + */ 127 + if (csym->curr.tri != yes) 128 + return false; 129 + 130 + prop = sym_get_choice_prop(csym); 131 + 132 + /* count entries in choice block */ 133 + cnt = 0; 134 + expr_list_for_each_sym(prop->expr, e, sym) 135 + cnt++; 136 + 137 + /* 138 + * find a random value and set it to yes, 139 + * set the rest to no so we have only one set 140 + */ 141 + def = rand() % cnt; 142 + 143 + cnt = 0; 144 + expr_list_for_each_sym(prop->expr, e, sym) { 145 + if (def == cnt++) { 146 + sym->def[S_DEF_USER].tri = yes; 147 + csym->def[S_DEF_USER].val = sym; 148 + } else { 149 + sym->def[S_DEF_USER].tri = no; 150 + } 151 + sym->flags |= SYMBOL_DEF_USER; 152 + /* clear VALID to get value calculated */ 153 + sym->flags &= ~SYMBOL_VALID; 154 + } 155 + csym->flags |= SYMBOL_DEF_USER; 156 + /* clear VALID to get value calculated */ 157 + csym->flags &= ~SYMBOL_VALID; 158 + 159 + return true; 160 + } 161 + 162 + enum conf_def_mode { 163 + def_default, 164 + def_yes, 165 + def_mod, 166 + def_y2m, 167 + def_m2y, 168 + def_no, 169 + def_random 170 + }; 171 + 172 + static bool conf_set_all_new_symbols(enum conf_def_mode mode) 173 + { 174 + struct symbol *sym, *csym; 175 + int i, cnt; 176 + /* 177 + * can't go as the default in switch-case below, otherwise gcc whines 178 + * about -Wmaybe-uninitialized 179 + */ 180 + int pby = 50; /* probability of bool = y */ 181 + int pty = 33; /* probability of tristate = y */ 182 + int ptm = 33; /* probability of tristate = m */ 183 + bool has_changed = false; 184 + 185 + if (mode == def_random) { 186 + int n, p[3]; 187 + char *env = getenv("KCONFIG_PROBABILITY"); 188 + 189 + n = 0; 190 + while (env && *env) { 191 + char *endp; 192 + int tmp = strtol(env, &endp, 10); 193 + 194 + if (tmp >= 0 && tmp <= 100) { 195 + p[n++] = tmp; 196 + } else { 197 + errno = ERANGE; 198 + perror("KCONFIG_PROBABILITY"); 199 + exit(1); 200 + } 201 + env = (*endp == ':') ? endp + 1 : endp; 202 + if (n >= 3) 203 + break; 204 + } 205 + switch (n) { 206 + case 1: 207 + pby = p[0]; 208 + ptm = pby / 2; 209 + pty = pby - ptm; 210 + break; 211 + case 2: 212 + pty = p[0]; 213 + ptm = p[1]; 214 + pby = pty + ptm; 215 + break; 216 + case 3: 217 + pby = p[0]; 218 + pty = p[1]; 219 + ptm = p[2]; 220 + break; 221 + } 222 + 223 + if (pty + ptm > 100) { 224 + errno = ERANGE; 225 + perror("KCONFIG_PROBABILITY"); 226 + exit(1); 227 + } 228 + } 229 + 230 + for_all_symbols(i, sym) { 231 + if (sym_has_value(sym) || sym->flags & SYMBOL_VALID) 232 + continue; 233 + switch (sym_get_type(sym)) { 234 + case S_BOOLEAN: 235 + case S_TRISTATE: 236 + has_changed = true; 237 + switch (mode) { 238 + case def_yes: 239 + sym->def[S_DEF_USER].tri = yes; 240 + break; 241 + case def_mod: 242 + sym->def[S_DEF_USER].tri = mod; 243 + break; 244 + case def_no: 245 + sym->def[S_DEF_USER].tri = no; 246 + break; 247 + case def_random: 248 + sym->def[S_DEF_USER].tri = no; 249 + cnt = rand() % 100; 250 + if (sym->type == S_TRISTATE) { 251 + if (cnt < pty) 252 + sym->def[S_DEF_USER].tri = yes; 253 + else if (cnt < pty + ptm) 254 + sym->def[S_DEF_USER].tri = mod; 255 + } else if (cnt < pby) 256 + sym->def[S_DEF_USER].tri = yes; 257 + break; 258 + default: 259 + continue; 260 + } 261 + if (!(sym_is_choice(sym) && mode == def_random)) 262 + sym->flags |= SYMBOL_DEF_USER; 263 + break; 264 + default: 265 + break; 266 + } 267 + 268 + } 269 + 270 + sym_clear_all_valid(); 271 + 272 + /* 273 + * We have different type of choice blocks. 274 + * If curr.tri equals to mod then we can select several 275 + * choice symbols in one block. 276 + * In this case we do nothing. 277 + * If curr.tri equals yes then only one symbol can be 278 + * selected in a choice block and we set it to yes, 279 + * and the rest to no. 280 + */ 281 + if (mode != def_random) { 282 + for_all_symbols(i, csym) { 283 + if ((sym_is_choice(csym) && !sym_has_value(csym)) || 284 + sym_is_choice_value(csym)) 285 + csym->flags |= SYMBOL_NEED_SET_CHOICE_VALUES; 286 + } 287 + } 288 + 289 + for_all_symbols(i, csym) { 290 + if (sym_has_value(csym) || !sym_is_choice(csym)) 291 + continue; 292 + 293 + sym_calc_value(csym); 294 + if (mode == def_random) 295 + has_changed |= randomize_choice_values(csym); 296 + else { 297 + set_all_choice_values(csym); 298 + has_changed = true; 299 + } 300 + } 301 + 302 + return has_changed; 303 + } 304 + 305 + static void conf_rewrite_mod_or_yes(enum conf_def_mode mode) 306 + { 307 + struct symbol *sym; 308 + int i; 309 + tristate old_val = (mode == def_y2m) ? yes : mod; 310 + tristate new_val = (mode == def_y2m) ? mod : yes; 311 + 312 + for_all_symbols(i, sym) { 313 + if (sym_get_type(sym) == S_TRISTATE && 314 + sym->def[S_DEF_USER].tri == old_val) 315 + sym->def[S_DEF_USER].tri = new_val; 316 + } 317 + sym_clear_all_valid(); 83 318 } 84 319 85 320 static int conf_askvalue(struct symbol *sym, const char *def) ··· 679 444 } 680 445 681 446 static struct option long_opts[] = { 682 - {"oldaskconfig", no_argument, NULL, oldaskconfig}, 683 - {"oldconfig", no_argument, NULL, oldconfig}, 684 - {"syncconfig", no_argument, NULL, syncconfig}, 685 - {"defconfig", required_argument, NULL, defconfig}, 686 - {"savedefconfig", required_argument, NULL, savedefconfig}, 687 - {"allnoconfig", no_argument, NULL, allnoconfig}, 688 - {"allyesconfig", no_argument, NULL, allyesconfig}, 689 - {"allmodconfig", no_argument, NULL, allmodconfig}, 690 - {"alldefconfig", no_argument, NULL, alldefconfig}, 691 - {"randconfig", no_argument, NULL, randconfig}, 692 - {"listnewconfig", no_argument, NULL, listnewconfig}, 693 - {"helpnewconfig", no_argument, NULL, helpnewconfig}, 694 - {"olddefconfig", no_argument, NULL, olddefconfig}, 695 - {"yes2modconfig", no_argument, NULL, yes2modconfig}, 696 - {"mod2yesconfig", no_argument, NULL, mod2yesconfig}, 447 + {"help", no_argument, NULL, 'h'}, 448 + {"silent", no_argument, NULL, 's'}, 449 + {"oldaskconfig", no_argument, &input_mode_opt, oldaskconfig}, 450 + {"oldconfig", no_argument, &input_mode_opt, oldconfig}, 451 + {"syncconfig", no_argument, &input_mode_opt, syncconfig}, 452 + {"defconfig", required_argument, &input_mode_opt, defconfig}, 453 + {"savedefconfig", required_argument, &input_mode_opt, savedefconfig}, 454 + {"allnoconfig", no_argument, &input_mode_opt, allnoconfig}, 455 + {"allyesconfig", no_argument, &input_mode_opt, allyesconfig}, 456 + {"allmodconfig", no_argument, &input_mode_opt, allmodconfig}, 457 + {"alldefconfig", no_argument, &input_mode_opt, alldefconfig}, 458 + {"randconfig", no_argument, &input_mode_opt, randconfig}, 459 + {"listnewconfig", no_argument, &input_mode_opt, listnewconfig}, 460 + {"helpnewconfig", no_argument, &input_mode_opt, helpnewconfig}, 461 + {"olddefconfig", no_argument, &input_mode_opt, olddefconfig}, 462 + {"yes2modconfig", no_argument, &input_mode_opt, yes2modconfig}, 463 + {"mod2yesconfig", no_argument, &input_mode_opt, mod2yesconfig}, 697 464 {NULL, 0, NULL, 0} 698 465 }; 699 466 700 467 static void conf_usage(const char *progname) 701 468 { 702 - 703 - printf("Usage: %s [-s] [option] <kconfig-file>\n", progname); 704 - printf("[option] is _one_ of the following:\n"); 469 + printf("Usage: %s [options] <kconfig-file>\n", progname); 470 + printf("\n"); 471 + printf("Generic options:\n"); 472 + printf(" -h, --help Print this message and exit.\n"); 473 + printf(" -s, --silent Do not print log.\n"); 474 + printf("\n"); 475 + printf("Mode options:\n"); 705 476 printf(" --listnewconfig List new options\n"); 706 477 printf(" --helpnewconfig List new options and help text\n"); 707 478 printf(" --oldaskconfig Start a new configuration using a line-oriented program\n"); ··· 737 496 tty_stdio = isatty(0) && isatty(1); 738 497 739 498 while ((opt = getopt_long(ac, av, "hs", long_opts, NULL)) != -1) { 740 - if (opt == 's') { 741 - conf_set_message_callback(NULL); 742 - continue; 743 - } 744 - input_mode = (enum input_mode)opt; 745 499 switch (opt) { 746 - case syncconfig: 747 - /* 748 - * syncconfig is invoked during the build stage. 749 - * Suppress distracting "configuration written to ..." 750 - */ 751 - conf_set_message_callback(NULL); 752 - sync_kconfig = 1; 753 - break; 754 - case defconfig: 755 - case savedefconfig: 756 - defconfig_file = optarg; 757 - break; 758 - case randconfig: 759 - { 760 - struct timeval now; 761 - unsigned int seed; 762 - char *seed_env; 763 - 764 - /* 765 - * Use microseconds derived seed, 766 - * compensate for systems where it may be zero 767 - */ 768 - gettimeofday(&now, NULL); 769 - seed = (unsigned int)((now.tv_sec + 1) * (now.tv_usec + 1)); 770 - 771 - seed_env = getenv("KCONFIG_SEED"); 772 - if( seed_env && *seed_env ) { 773 - char *endp; 774 - int tmp = (int)strtol(seed_env, &endp, 0); 775 - if (*endp == '\0') { 776 - seed = tmp; 777 - } 778 - } 779 - fprintf( stderr, "KCONFIG_SEED=0x%X\n", seed ); 780 - srand(seed); 781 - break; 782 - } 783 - case oldaskconfig: 784 - case oldconfig: 785 - case allnoconfig: 786 - case allyesconfig: 787 - case allmodconfig: 788 - case alldefconfig: 789 - case listnewconfig: 790 - case helpnewconfig: 791 - case olddefconfig: 792 - case yes2modconfig: 793 - case mod2yesconfig: 794 - break; 795 500 case 'h': 796 501 conf_usage(progname); 797 502 exit(1); 503 + break; 504 + case 's': 505 + conf_set_message_callback(NULL); 506 + break; 507 + case 0: 508 + input_mode = input_mode_opt; 509 + switch (input_mode) { 510 + case syncconfig: 511 + /* 512 + * syncconfig is invoked during the build stage. 513 + * Suppress distracting 514 + * "configuration written to ..." 515 + */ 516 + conf_set_message_callback(NULL); 517 + sync_kconfig = 1; 518 + break; 519 + case defconfig: 520 + case savedefconfig: 521 + defconfig_file = optarg; 522 + break; 523 + case randconfig: 524 + set_randconfig_seed(); 525 + break; 526 + default: 527 + break; 528 + } 529 + default: 798 530 break; 799 531 } 800 532 } ··· 776 562 conf_usage(progname); 777 563 exit(1); 778 564 } 779 - name = av[optind]; 780 - conf_parse(name); 565 + conf_parse(av[optind]); 781 566 //zconfdump(stdout); 782 567 783 568 switch (input_mode) {
+42 -220
scripts/kconfig/confdata.c
··· 33 33 struct stat st; 34 34 35 35 if (stat(path, &st)) 36 - return 0; 36 + return false; 37 37 38 38 return S_ISDIR(st.st_mode); 39 39 } ··· 355 355 if (name) { 356 356 in = zconf_fopen(name); 357 357 } else { 358 - struct property *prop; 358 + char *env; 359 359 360 360 name = conf_get_configname(); 361 361 in = zconf_fopen(name); 362 362 if (in) 363 363 goto load; 364 - sym_add_change_count(1); 365 - if (!sym_defconfig_list) 364 + conf_set_changed(true); 365 + 366 + env = getenv("KCONFIG_DEFCONFIG_LIST"); 367 + if (!env) 366 368 return 1; 367 369 368 - for_all_defaults(sym_defconfig_list, prop) { 369 - if (expr_calc_value(prop->visible.expr) == no || 370 - prop->expr->type != E_SYMBOL) 371 - continue; 372 - sym_calc_value(prop->expr->left.sym); 373 - name = sym_get_string_value(prop->expr->left.sym); 374 - in = zconf_fopen(name); 370 + while (1) { 371 + bool is_last; 372 + 373 + while (isspace(*env)) 374 + env++; 375 + 376 + if (!*env) 377 + break; 378 + 379 + p = env; 380 + while (*p && !isspace(*p)) 381 + p++; 382 + 383 + is_last = (*p == '\0'); 384 + 385 + *p = '\0'; 386 + 387 + in = zconf_fopen(env); 375 388 if (in) { 376 389 conf_message("using defaults found in %s", 377 - name); 390 + env); 378 391 goto load; 379 392 } 393 + 394 + if (is_last) 395 + break; 396 + 397 + env = p + 1; 380 398 } 381 399 } 382 400 if (!in) ··· 439 421 if (def == S_DEF_USER) { 440 422 sym = sym_find(line + 2 + strlen(CONFIG_)); 441 423 if (!sym) { 442 - sym_add_change_count(1); 424 + conf_set_changed(true); 443 425 continue; 444 426 } 445 427 } else { ··· 482 464 */ 483 465 conf_touch_dep(line + strlen(CONFIG_)); 484 466 else 485 - sym_add_change_count(1); 467 + conf_set_changed(true); 486 468 continue; 487 469 } 488 470 ··· 530 512 int conf_unsaved = 0; 531 513 int i; 532 514 533 - sym_set_change_count(0); 515 + conf_set_changed(false); 534 516 535 517 if (conf_read_simple(name, S_DEF_USER)) { 536 518 sym_calc_value(modules_sym); ··· 588 570 } 589 571 } 590 572 591 - sym_add_change_count(conf_warnings || conf_unsaved); 573 + if (conf_warnings || conf_unsaved) 574 + conf_set_changed(true); 592 575 593 576 return 0; 594 577 } ··· 934 915 if (is_same(name, tmpname)) { 935 916 conf_message("No change to %s", name); 936 917 unlink(tmpname); 937 - sym_set_change_count(0); 918 + conf_set_changed(false); 938 919 return 0; 939 920 } 940 921 ··· 946 927 947 928 conf_message("configuration written to %s", name); 948 929 949 - sym_set_change_count(0); 930 + conf_set_changed(false); 950 931 951 932 return 0; 952 933 } ··· 1114 1095 return 0; 1115 1096 } 1116 1097 1117 - static int sym_change_count; 1098 + static bool conf_changed; 1118 1099 static void (*conf_changed_callback)(void); 1119 1100 1120 - void sym_set_change_count(int count) 1101 + void conf_set_changed(bool val) 1121 1102 { 1122 - int _sym_change_count = sym_change_count; 1123 - sym_change_count = count; 1124 - if (conf_changed_callback && 1125 - (bool)_sym_change_count != (bool)count) 1103 + if (conf_changed_callback && conf_changed != val) 1126 1104 conf_changed_callback(); 1127 - } 1128 1105 1129 - void sym_add_change_count(int count) 1130 - { 1131 - sym_set_change_count(count + sym_change_count); 1106 + conf_changed = val; 1132 1107 } 1133 1108 1134 1109 bool conf_get_changed(void) 1135 1110 { 1136 - return sym_change_count; 1111 + return conf_changed; 1137 1112 } 1138 1113 1139 1114 void conf_set_changed_callback(void (*fn)(void)) 1140 1115 { 1141 1116 conf_changed_callback = fn; 1142 - } 1143 - 1144 - static bool randomize_choice_values(struct symbol *csym) 1145 - { 1146 - struct property *prop; 1147 - struct symbol *sym; 1148 - struct expr *e; 1149 - int cnt, def; 1150 - 1151 - /* 1152 - * If choice is mod then we may have more items selected 1153 - * and if no then no-one. 1154 - * In both cases stop. 1155 - */ 1156 - if (csym->curr.tri != yes) 1157 - return false; 1158 - 1159 - prop = sym_get_choice_prop(csym); 1160 - 1161 - /* count entries in choice block */ 1162 - cnt = 0; 1163 - expr_list_for_each_sym(prop->expr, e, sym) 1164 - cnt++; 1165 - 1166 - /* 1167 - * find a random value and set it to yes, 1168 - * set the rest to no so we have only one set 1169 - */ 1170 - def = (rand() % cnt); 1171 - 1172 - cnt = 0; 1173 - expr_list_for_each_sym(prop->expr, e, sym) { 1174 - if (def == cnt++) { 1175 - sym->def[S_DEF_USER].tri = yes; 1176 - csym->def[S_DEF_USER].val = sym; 1177 - } 1178 - else { 1179 - sym->def[S_DEF_USER].tri = no; 1180 - } 1181 - sym->flags |= SYMBOL_DEF_USER; 1182 - /* clear VALID to get value calculated */ 1183 - sym->flags &= ~SYMBOL_VALID; 1184 - } 1185 - csym->flags |= SYMBOL_DEF_USER; 1186 - /* clear VALID to get value calculated */ 1187 - csym->flags &= ~(SYMBOL_VALID); 1188 - 1189 - return true; 1190 1117 } 1191 1118 1192 1119 void set_all_choice_values(struct symbol *csym) ··· 1153 1188 csym->flags |= SYMBOL_DEF_USER; 1154 1189 /* clear VALID to get value calculated */ 1155 1190 csym->flags &= ~(SYMBOL_VALID | SYMBOL_NEED_SET_CHOICE_VALUES); 1156 - } 1157 - 1158 - bool conf_set_all_new_symbols(enum conf_def_mode mode) 1159 - { 1160 - struct symbol *sym, *csym; 1161 - int i, cnt, pby, pty, ptm; /* pby: probability of bool = y 1162 - * pty: probability of tristate = y 1163 - * ptm: probability of tristate = m 1164 - */ 1165 - 1166 - pby = 50; pty = ptm = 33; /* can't go as the default in switch-case 1167 - * below, otherwise gcc whines about 1168 - * -Wmaybe-uninitialized */ 1169 - if (mode == def_random) { 1170 - int n, p[3]; 1171 - char *env = getenv("KCONFIG_PROBABILITY"); 1172 - n = 0; 1173 - while( env && *env ) { 1174 - char *endp; 1175 - int tmp = strtol( env, &endp, 10 ); 1176 - if( tmp >= 0 && tmp <= 100 ) { 1177 - p[n++] = tmp; 1178 - } else { 1179 - errno = ERANGE; 1180 - perror( "KCONFIG_PROBABILITY" ); 1181 - exit( 1 ); 1182 - } 1183 - env = (*endp == ':') ? endp+1 : endp; 1184 - if( n >=3 ) { 1185 - break; 1186 - } 1187 - } 1188 - switch( n ) { 1189 - case 1: 1190 - pby = p[0]; ptm = pby/2; pty = pby-ptm; 1191 - break; 1192 - case 2: 1193 - pty = p[0]; ptm = p[1]; pby = pty + ptm; 1194 - break; 1195 - case 3: 1196 - pby = p[0]; pty = p[1]; ptm = p[2]; 1197 - break; 1198 - } 1199 - 1200 - if( pty+ptm > 100 ) { 1201 - errno = ERANGE; 1202 - perror( "KCONFIG_PROBABILITY" ); 1203 - exit( 1 ); 1204 - } 1205 - } 1206 - bool has_changed = false; 1207 - 1208 - for_all_symbols(i, sym) { 1209 - if (sym_has_value(sym) || (sym->flags & SYMBOL_VALID)) 1210 - continue; 1211 - switch (sym_get_type(sym)) { 1212 - case S_BOOLEAN: 1213 - case S_TRISTATE: 1214 - has_changed = true; 1215 - switch (mode) { 1216 - case def_yes: 1217 - sym->def[S_DEF_USER].tri = yes; 1218 - break; 1219 - case def_mod: 1220 - sym->def[S_DEF_USER].tri = mod; 1221 - break; 1222 - case def_no: 1223 - if (sym->flags & SYMBOL_ALLNOCONFIG_Y) 1224 - sym->def[S_DEF_USER].tri = yes; 1225 - else 1226 - sym->def[S_DEF_USER].tri = no; 1227 - break; 1228 - case def_random: 1229 - sym->def[S_DEF_USER].tri = no; 1230 - cnt = rand() % 100; 1231 - if (sym->type == S_TRISTATE) { 1232 - if (cnt < pty) 1233 - sym->def[S_DEF_USER].tri = yes; 1234 - else if (cnt < (pty+ptm)) 1235 - sym->def[S_DEF_USER].tri = mod; 1236 - } else if (cnt < pby) 1237 - sym->def[S_DEF_USER].tri = yes; 1238 - break; 1239 - default: 1240 - continue; 1241 - } 1242 - if (!(sym_is_choice(sym) && mode == def_random)) 1243 - sym->flags |= SYMBOL_DEF_USER; 1244 - break; 1245 - default: 1246 - break; 1247 - } 1248 - 1249 - } 1250 - 1251 - sym_clear_all_valid(); 1252 - 1253 - /* 1254 - * We have different type of choice blocks. 1255 - * If curr.tri equals to mod then we can select several 1256 - * choice symbols in one block. 1257 - * In this case we do nothing. 1258 - * If curr.tri equals yes then only one symbol can be 1259 - * selected in a choice block and we set it to yes, 1260 - * and the rest to no. 1261 - */ 1262 - if (mode != def_random) { 1263 - for_all_symbols(i, csym) { 1264 - if ((sym_is_choice(csym) && !sym_has_value(csym)) || 1265 - sym_is_choice_value(csym)) 1266 - csym->flags |= SYMBOL_NEED_SET_CHOICE_VALUES; 1267 - } 1268 - } 1269 - 1270 - for_all_symbols(i, csym) { 1271 - if (sym_has_value(csym) || !sym_is_choice(csym)) 1272 - continue; 1273 - 1274 - sym_calc_value(csym); 1275 - if (mode == def_random) 1276 - has_changed |= randomize_choice_values(csym); 1277 - else { 1278 - set_all_choice_values(csym); 1279 - has_changed = true; 1280 - } 1281 - } 1282 - 1283 - return has_changed; 1284 - } 1285 - 1286 - void conf_rewrite_mod_or_yes(enum conf_def_mode mode) 1287 - { 1288 - struct symbol *sym; 1289 - int i; 1290 - tristate old_val = (mode == def_y2m) ? yes : mod; 1291 - tristate new_val = (mode == def_y2m) ? mod : yes; 1292 - 1293 - for_all_symbols(i, sym) { 1294 - if (sym_get_type(sym) == S_TRISTATE && 1295 - sym->def[S_DEF_USER].tri == old_val) 1296 - sym->def[S_DEF_USER].tri = new_val; 1297 - } 1298 - sym_clear_all_valid(); 1299 1191 }
-6
scripts/kconfig/expr.h
··· 156 156 /* choice values need to be set before calculating this symbol value */ 157 157 #define SYMBOL_NEED_SET_CHOICE_VALUES 0x100000 158 158 159 - /* Set symbol to y if allnoconfig; used for symbols that hide others */ 160 - #define SYMBOL_ALLNOCONFIG_Y 0x200000 161 - 162 159 #define SYMBOL_MAXLENGTH 256 163 160 #define SYMBOL_HASHSIZE 9973 164 161 ··· 278 281 int index; 279 282 }; 280 283 281 - #define JUMP_NB 9 282 - 283 284 extern struct file *file_list; 284 285 extern struct file *current_file; 285 286 struct file *lookup_file(const char *name); 286 287 287 288 extern struct symbol symbol_yes, symbol_no, symbol_mod; 288 289 extern struct symbol *modules_sym; 289 - extern struct symbol *sym_defconfig_list; 290 290 extern int cdebug; 291 291 struct expr *expr_alloc_symbol(struct symbol *sym); 292 292 struct expr *expr_alloc_one(enum expr_type type, struct expr *ce);
+6 -9
scripts/kconfig/gconf.c
··· 3 3 * Copyright (C) 2002-2003 Romain Lievin <roms@tilp.info> 4 4 */ 5 5 6 - #ifdef HAVE_CONFIG_H 7 - # include <config.h> 8 - #endif 9 - 10 6 #include <stdlib.h> 11 7 #include "lkc.h" 12 8 #include "images.h" ··· 1044 1048 g_free(row[i]); 1045 1049 bzero(row, sizeof(row)); 1046 1050 1051 + ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; 1052 + 1047 1053 row[COL_OPTION] = 1048 - g_strdup_printf("%s %s", menu_get_prompt(menu), 1054 + g_strdup_printf("%s %s %s %s", 1055 + ptype == P_COMMENT ? "***" : "", 1056 + menu_get_prompt(menu), 1057 + ptype == P_COMMENT ? "***" : "", 1049 1058 sym && !sym_has_value(sym) ? "(NEW)" : ""); 1050 1059 1051 1060 if (opt_mode == OPT_ALL && !menu_is_visible(menu)) ··· 1061 1060 else 1062 1061 row[COL_COLOR] = g_strdup("Black"); 1063 1062 1064 - ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; 1065 1063 switch (ptype) { 1066 1064 case P_MENU: 1067 1065 row[COL_PIXBUF] = (gchar *) xpm_menu; ··· 1451 1451 gtk_set_locale(); 1452 1452 gtk_init(&ac, &av); 1453 1453 glade_init(); 1454 - 1455 - //add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps"); 1456 - //add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps"); 1457 1454 1458 1455 /* Determine GUI path */ 1459 1456 env = getenv(SRCTREE);
+9
scripts/kconfig/internal.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + #ifndef INTERNAL_H 3 + #define INTERNAL_H 4 + 5 + struct menu; 6 + 7 + extern struct menu *current_menu, *current_entry; 8 + 9 + #endif /* INTERNAL_H */
-3
scripts/kconfig/lexer.l
··· 91 91 [ \t]* /* whitespaces */ 92 92 \\\n /* escaped new line */ 93 93 \n return T_EOL; 94 - "allnoconfig_y" return T_ALLNOCONFIG_Y; 95 94 "bool" return T_BOOL; 96 95 "choice" return T_CHOICE; 97 96 "comment" return T_COMMENT; ··· 98 99 "def_bool" return T_DEF_BOOL; 99 100 "def_tristate" return T_DEF_TRISTATE; 100 101 "default" return T_DEFAULT; 101 - "defconfig_list" return T_DEFCONFIG_LIST; 102 102 "depends" return T_DEPENDS; 103 103 "endchoice" return T_ENDCHOICE; 104 104 "endif" return T_ENDIF; ··· 112 114 "menuconfig" return T_MENUCONFIG; 113 115 "modules" return T_MODULES; 114 116 "on" return T_ON; 115 - "option" return T_OPTION; 116 117 "optional" return T_OPTIONAL; 117 118 "prompt" return T_PROMPT; 118 119 "range" return T_RANGE;
-21
scripts/kconfig/lkc.h
··· 20 20 21 21 #define SRCTREE "srctree" 22 22 23 - #ifndef PACKAGE 24 - #define PACKAGE "linux" 25 - #endif 26 - 27 23 #ifndef CONFIG_ 28 24 #define CONFIG_ "CONFIG_" 29 25 #endif ··· 29 33 } 30 34 #undef CONFIG_ 31 35 #define CONFIG_ CONFIG_prefix() 32 - 33 - enum conf_def_mode { 34 - def_default, 35 - def_yes, 36 - def_mod, 37 - def_y2m, 38 - def_m2y, 39 - def_no, 40 - def_random 41 - }; 42 36 43 37 extern int yylineno; 44 38 void zconfdump(FILE *out); ··· 41 55 42 56 /* confdata.c */ 43 57 const char *conf_get_configname(void); 44 - void sym_set_change_count(int count); 45 - void sym_add_change_count(int count); 46 - bool conf_set_all_new_symbols(enum conf_def_mode mode); 47 - void conf_rewrite_mod_or_yes(enum conf_def_mode mode); 48 58 void set_all_choice_values(struct symbol *csym); 49 59 50 60 /* confdata.c and expr.c */ ··· 89 107 struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); 90 108 void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep); 91 109 void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep); 92 - void menu_add_option_modules(void); 93 - void menu_add_option_defconfig_list(void); 94 - void menu_add_option_allnoconfig_y(void); 95 110 void menu_finalize(struct menu *parent); 96 111 void menu_set_type(int type); 97 112
+1
scripts/kconfig/lkc_proto.h
··· 8 8 int conf_write_defconfig(const char *name); 9 9 int conf_write(const char *name); 10 10 int conf_write_autoconf(int overwrite); 11 + void conf_set_changed(bool val); 11 12 bool conf_get_changed(void); 12 13 void conf_set_changed_callback(void (*fn)(void)); 13 14 void conf_set_message_callback(void (*fn)(const char *s));
+2 -2
scripts/kconfig/lxdialog/util.c
··· 363 363 /* 364 364 * Print a string of text in a window, automatically wrap around to the 365 365 * next line if the string is too long to fit on one line. Newline 366 - * characters '\n' are propperly processed. We start on a new line 366 + * characters '\n' are properly processed. We start on a new line 367 367 * if there is no room for at least 4 nonblanks following a double-space. 368 368 */ 369 369 void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x) ··· 541 541 * lxdialog suggest <ESC> <ESC> which is correctly translated to two 542 542 * times esc. But then we need to ignore the second esc to avoid stepping 543 543 * out one menu too much. Filter away all escaped key sequences since 544 - * keypad(FALSE) turn off ncurses support for escape sequences - and thats 544 + * keypad(FALSE) turn off ncurses support for escape sequences - and that's 545 545 * needed to make notimeout() do as expected. 546 546 */ 547 547 int on_key_esc(WINDOW *win)
+6 -9
scripts/kconfig/mconf.c
··· 22 22 #include "lkc.h" 23 23 #include "lxdialog/dialog.h" 24 24 25 + #define JUMP_NB 9 26 + 25 27 static const char mconf_readme[] = 26 28 "Overview\n" 27 29 "--------\n" ··· 299 297 static void set_config_filename(const char *config_filename) 300 298 { 301 299 static char menu_backtitle[PATH_MAX+128]; 302 - int size; 303 300 304 - size = snprintf(menu_backtitle, sizeof(menu_backtitle), 305 - "%s - %s", config_filename, rootmenu.prompt->text); 306 - if (size >= sizeof(menu_backtitle)) 307 - menu_backtitle[sizeof(menu_backtitle)-1] = '\0'; 301 + snprintf(menu_backtitle, sizeof(menu_backtitle), "%s - %s", 302 + config_filename, rootmenu.prompt->text); 308 303 set_dialog_backtitle(menu_backtitle); 309 304 310 - size = snprintf(filename, sizeof(filename), "%s", config_filename); 311 - if (size >= sizeof(filename)) 312 - filename[sizeof(filename)-1] = '\0'; 305 + snprintf(filename, sizeof(filename), "%s", config_filename); 313 306 } 314 307 315 308 struct subtitle_part { ··· 905 908 return; 906 909 if (!conf_read(dialog_input_result)) { 907 910 set_config_filename(dialog_input_result); 908 - sym_set_change_count(1); 911 + conf_set_changed(true); 909 912 return; 910 913 } 911 914 show_textbox(NULL, "File does not exist!", 5, 38);
+1 -22
scripts/kconfig/menu.c
··· 9 9 #include <string.h> 10 10 11 11 #include "lkc.h" 12 + #include "internal.h" 12 13 13 14 static const char nohelp_text[] = "There is no help available for this option."; 14 15 ··· 210 209 void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep) 211 210 { 212 211 menu_add_prop(type, expr_alloc_symbol(sym), dep); 213 - } 214 - 215 - void menu_add_option_modules(void) 216 - { 217 - if (modules_sym) 218 - zconf_error("symbol '%s' redefines option 'modules' already defined by symbol '%s'", 219 - current_entry->sym->name, modules_sym->name); 220 - modules_sym = current_entry->sym; 221 - } 222 - 223 - void menu_add_option_defconfig_list(void) 224 - { 225 - if (!sym_defconfig_list) 226 - sym_defconfig_list = current_entry->sym; 227 - else if (sym_defconfig_list != current_entry->sym) 228 - zconf_error("trying to redefine defconfig symbol"); 229 - sym_defconfig_list->flags |= SYMBOL_NO_WRITE; 230 - } 231 - 232 - void menu_add_option_allnoconfig_y(void) 233 - { 234 - current_entry->sym->flags |= SYMBOL_ALLNOCONFIG_Y; 235 212 } 236 213 237 214 static int menu_validate_number(struct symbol *sym, struct symbol *sym2)
+26 -32
scripts/kconfig/nconf.c
··· 268 268 static MENU *curses_menu; 269 269 static ITEM *curses_menu_items[MAX_MENU_ITEMS]; 270 270 static struct mitem k_menu_items[MAX_MENU_ITEMS]; 271 - static int items_num; 271 + static unsigned int items_num; 272 272 static int global_exit; 273 273 /* the currently selected button */ 274 274 static const char *current_instructions = menu_instructions; ··· 370 370 int lines = getmaxy(stdscr); 371 371 372 372 for (i = 0; i < function_keys_num; i++) { 373 - (void) wattrset(main_window, attributes[FUNCTION_HIGHLIGHT]); 373 + wattrset(main_window, attr_function_highlight); 374 374 mvwprintw(main_window, lines-3, offset, 375 375 "%s", 376 376 function_keys[i].key_str); 377 - (void) wattrset(main_window, attributes[FUNCTION_TEXT]); 377 + wattrset(main_window, attr_function_text); 378 378 offset += strlen(function_keys[i].key_str); 379 379 mvwprintw(main_window, lines-3, 380 380 offset, "%s", 381 381 function_keys[i].func); 382 382 offset += strlen(function_keys[i].func) + skip; 383 383 } 384 - (void) wattrset(main_window, attributes[NORMAL]); 384 + wattrset(main_window, attr_normal); 385 385 } 386 386 387 387 /* help */ ··· 496 496 /* return the index of the matched item, or -1 if no such item exists */ 497 497 static int get_mext_match(const char *match_str, match_f flag) 498 498 { 499 - int match_start = item_index(current_item(curses_menu)); 500 - int index; 499 + int match_start, index; 500 + 501 + /* Do not search if the menu is empty (i.e. items_num == 0) */ 502 + match_start = item_index(current_item(curses_menu)); 503 + if (match_start == ERR) 504 + return -1; 501 505 502 506 if (flag == FIND_NEXT_MATCH_DOWN) 503 507 ++match_start; 504 508 else if (flag == FIND_NEXT_MATCH_UP) 505 509 --match_start; 506 510 511 + match_start = (match_start + items_num) % items_num; 507 512 index = match_start; 508 - index = (index + items_num) % items_num; 509 513 while (true) { 510 514 char *str = k_menu_items[index].str; 511 515 if (strcasestr(str, match_str) != NULL) ··· 631 627 632 628 static char filename[PATH_MAX+1]; 633 629 static char menu_backtitle[PATH_MAX+128]; 634 - static const char *set_config_filename(const char *config_filename) 630 + static void set_config_filename(const char *config_filename) 635 631 { 636 - int size; 632 + snprintf(menu_backtitle, sizeof(menu_backtitle), "%s - %s", 633 + config_filename, rootmenu.prompt->text); 637 634 638 - size = snprintf(menu_backtitle, sizeof(menu_backtitle), 639 - "%s - %s", config_filename, rootmenu.prompt->text); 640 - if (size >= sizeof(menu_backtitle)) 641 - menu_backtitle[sizeof(menu_backtitle)-1] = '\0'; 642 - 643 - size = snprintf(filename, sizeof(filename), "%s", config_filename); 644 - if (size >= sizeof(filename)) 645 - filename[sizeof(filename)-1] = '\0'; 646 - return menu_backtitle; 635 + snprintf(filename, sizeof(filename), "%s", config_filename); 647 636 } 648 637 649 638 /* return = 0 means we are successful. ··· 953 956 current_instructions = instructions; 954 957 955 958 clear(); 956 - (void) wattrset(main_window, attributes[NORMAL]); 957 - print_in_middle(stdscr, 1, 0, getmaxx(stdscr), 959 + print_in_middle(stdscr, 1, getmaxx(stdscr), 958 960 menu_backtitle, 959 - attributes[MAIN_HEADING]); 961 + attr_main_heading); 960 962 961 - (void) wattrset(main_window, attributes[MAIN_MENU_BOX]); 963 + wattrset(main_window, attr_main_menu_box); 962 964 box(main_window, 0, 0); 963 - (void) wattrset(main_window, attributes[MAIN_MENU_HEADING]); 965 + wattrset(main_window, attr_main_menu_heading); 964 966 mvwprintw(main_window, 0, 3, " %s ", prompt); 965 - (void) wattrset(main_window, attributes[NORMAL]); 967 + wattrset(main_window, attr_normal); 966 968 967 969 set_menu_items(curses_menu, curses_menu_items); 968 970 ··· 1064 1068 static void conf(struct menu *menu) 1065 1069 { 1066 1070 struct menu *submenu = NULL; 1067 - const char *prompt = menu_get_prompt(menu); 1068 1071 struct symbol *sym; 1069 1072 int res; 1070 1073 int current_index = 0; ··· 1081 1086 if (!child_count) 1082 1087 break; 1083 1088 1084 - show_menu(prompt ? prompt : "Main Menu", 1085 - menu_instructions, 1086 - current_index, &last_top_row); 1089 + show_menu(menu_get_prompt(menu), menu_instructions, 1090 + current_index, &last_top_row); 1087 1091 keypad((menu_win(curses_menu)), TRUE); 1088 1092 while (!global_exit) { 1089 1093 if (match_state.in_search) { ··· 1398 1404 return; 1399 1405 if (!conf_read(dialog_input_result)) { 1400 1406 set_config_filename(dialog_input_result); 1401 - sym_set_change_count(1); 1407 + conf_set_changed(true); 1402 1408 return; 1403 1409 } 1404 1410 btn_dialog(main_window, "File does not exist!", 0); ··· 1517 1523 menu_opts_on(curses_menu, O_NONCYCLIC); 1518 1524 menu_opts_on(curses_menu, O_IGNORECASE); 1519 1525 set_menu_mark(curses_menu, " "); 1520 - set_menu_fore(curses_menu, attributes[MAIN_MENU_FORE]); 1521 - set_menu_back(curses_menu, attributes[MAIN_MENU_BACK]); 1522 - set_menu_grey(curses_menu, attributes[MAIN_MENU_GREY]); 1526 + set_menu_fore(curses_menu, attr_main_menu_fore); 1527 + set_menu_back(curses_menu, attr_main_menu_back); 1528 + set_menu_grey(curses_menu, attr_main_menu_grey); 1523 1529 1524 1530 set_config_filename(conf_get_configname()); 1525 1531 setup_windows();
+113 -163
scripts/kconfig/nconf.gui.c
··· 7 7 #include "nconf.h" 8 8 #include "lkc.h" 9 9 10 - /* a list of all the different widgets we use */ 11 - attributes_t attributes[ATTR_MAX+1] = {0}; 10 + int attr_normal; 11 + int attr_main_heading; 12 + int attr_main_menu_box; 13 + int attr_main_menu_fore; 14 + int attr_main_menu_back; 15 + int attr_main_menu_grey; 16 + int attr_main_menu_heading; 17 + int attr_scrollwin_text; 18 + int attr_scrollwin_heading; 19 + int attr_scrollwin_box; 20 + int attr_dialog_text; 21 + int attr_dialog_menu_fore; 22 + int attr_dialog_menu_back; 23 + int attr_dialog_box; 24 + int attr_input_box; 25 + int attr_input_heading; 26 + int attr_input_text; 27 + int attr_input_field; 28 + int attr_function_text; 29 + int attr_function_highlight; 12 30 13 - /* available colors: 14 - COLOR_BLACK 0 15 - COLOR_RED 1 16 - COLOR_GREEN 2 17 - COLOR_YELLOW 3 18 - COLOR_BLUE 4 19 - COLOR_MAGENTA 5 20 - COLOR_CYAN 6 21 - COLOR_WHITE 7 22 - */ 23 - static void set_normal_colors(void) 24 - { 25 - init_pair(NORMAL, -1, -1); 26 - init_pair(MAIN_HEADING, COLOR_MAGENTA, -1); 31 + #define COLOR_ATTR(_at, _fg, _bg, _hl) \ 32 + { .attr = &(_at), .has_color = true, .color_fg = _fg, .color_bg = _bg, .highlight = _hl } 33 + #define NO_COLOR_ATTR(_at, _hl) \ 34 + { .attr = &(_at), .has_color = false, .highlight = _hl } 35 + #define COLOR_DEFAULT -1 27 36 28 - /* FORE is for the selected item */ 29 - init_pair(MAIN_MENU_FORE, -1, -1); 30 - /* BACK for all the rest */ 31 - init_pair(MAIN_MENU_BACK, -1, -1); 32 - init_pair(MAIN_MENU_GREY, -1, -1); 33 - init_pair(MAIN_MENU_HEADING, COLOR_GREEN, -1); 34 - init_pair(MAIN_MENU_BOX, COLOR_YELLOW, -1); 37 + struct nconf_attr_param { 38 + int *attr; 39 + bool has_color; 40 + int color_fg; 41 + int color_bg; 42 + int highlight; 43 + }; 35 44 36 - init_pair(SCROLLWIN_TEXT, -1, -1); 37 - init_pair(SCROLLWIN_HEADING, COLOR_GREEN, -1); 38 - init_pair(SCROLLWIN_BOX, COLOR_YELLOW, -1); 45 + static const struct nconf_attr_param color_theme_params[] = { 46 + COLOR_ATTR(attr_normal, COLOR_DEFAULT, COLOR_DEFAULT, A_NORMAL), 47 + COLOR_ATTR(attr_main_heading, COLOR_MAGENTA, COLOR_DEFAULT, A_BOLD | A_UNDERLINE), 48 + COLOR_ATTR(attr_main_menu_box, COLOR_YELLOW, COLOR_DEFAULT, A_NORMAL), 49 + COLOR_ATTR(attr_main_menu_fore, COLOR_DEFAULT, COLOR_DEFAULT, A_REVERSE), 50 + COLOR_ATTR(attr_main_menu_back, COLOR_DEFAULT, COLOR_DEFAULT, A_NORMAL), 51 + COLOR_ATTR(attr_main_menu_grey, COLOR_DEFAULT, COLOR_DEFAULT, A_NORMAL), 52 + COLOR_ATTR(attr_main_menu_heading, COLOR_GREEN, COLOR_DEFAULT, A_BOLD), 53 + COLOR_ATTR(attr_scrollwin_text, COLOR_DEFAULT, COLOR_DEFAULT, A_NORMAL), 54 + COLOR_ATTR(attr_scrollwin_heading, COLOR_GREEN, COLOR_DEFAULT, A_BOLD), 55 + COLOR_ATTR(attr_scrollwin_box, COLOR_YELLOW, COLOR_DEFAULT, A_BOLD), 56 + COLOR_ATTR(attr_dialog_text, COLOR_DEFAULT, COLOR_DEFAULT, A_BOLD), 57 + COLOR_ATTR(attr_dialog_menu_fore, COLOR_RED, COLOR_DEFAULT, A_STANDOUT), 58 + COLOR_ATTR(attr_dialog_menu_back, COLOR_YELLOW, COLOR_DEFAULT, A_NORMAL), 59 + COLOR_ATTR(attr_dialog_box, COLOR_YELLOW, COLOR_DEFAULT, A_BOLD), 60 + COLOR_ATTR(attr_input_box, COLOR_YELLOW, COLOR_DEFAULT, A_NORMAL), 61 + COLOR_ATTR(attr_input_heading, COLOR_GREEN, COLOR_DEFAULT, A_BOLD), 62 + COLOR_ATTR(attr_input_text, COLOR_DEFAULT, COLOR_DEFAULT, A_NORMAL), 63 + COLOR_ATTR(attr_input_field, COLOR_DEFAULT, COLOR_DEFAULT, A_UNDERLINE), 64 + COLOR_ATTR(attr_function_text, COLOR_YELLOW, COLOR_DEFAULT, A_REVERSE), 65 + COLOR_ATTR(attr_function_highlight, COLOR_DEFAULT, COLOR_DEFAULT, A_BOLD), 66 + { /* sentinel */ } 67 + }; 39 68 40 - init_pair(DIALOG_TEXT, -1, -1); 41 - init_pair(DIALOG_BOX, COLOR_YELLOW, -1); 42 - init_pair(DIALOG_MENU_BACK, COLOR_YELLOW, -1); 43 - init_pair(DIALOG_MENU_FORE, COLOR_RED, -1); 44 - 45 - init_pair(INPUT_BOX, COLOR_YELLOW, -1); 46 - init_pair(INPUT_HEADING, COLOR_GREEN, -1); 47 - init_pair(INPUT_TEXT, -1, -1); 48 - init_pair(INPUT_FIELD, -1, -1); 49 - 50 - init_pair(FUNCTION_HIGHLIGHT, -1, -1); 51 - init_pair(FUNCTION_TEXT, COLOR_YELLOW, -1); 52 - } 53 - 54 - /* available attributes: 55 - A_NORMAL Normal display (no highlight) 56 - A_STANDOUT Best highlighting mode of the terminal. 57 - A_UNDERLINE Underlining 58 - A_REVERSE Reverse video 59 - A_BLINK Blinking 60 - A_DIM Half bright 61 - A_BOLD Extra bright or bold 62 - A_PROTECT Protected mode 63 - A_INVIS Invisible or blank mode 64 - A_ALTCHARSET Alternate character set 65 - A_CHARTEXT Bit-mask to extract a character 66 - COLOR_PAIR(n) Color-pair number n 67 - */ 68 - static void normal_color_theme(void) 69 - { 70 - /* automatically add color... */ 71 - #define mkattr(name, attr) do { \ 72 - attributes[name] = attr | COLOR_PAIR(name); } while (0) 73 - mkattr(NORMAL, NORMAL); 74 - mkattr(MAIN_HEADING, A_BOLD | A_UNDERLINE); 75 - 76 - mkattr(MAIN_MENU_FORE, A_REVERSE); 77 - mkattr(MAIN_MENU_BACK, A_NORMAL); 78 - mkattr(MAIN_MENU_GREY, A_NORMAL); 79 - mkattr(MAIN_MENU_HEADING, A_BOLD); 80 - mkattr(MAIN_MENU_BOX, A_NORMAL); 81 - 82 - mkattr(SCROLLWIN_TEXT, A_NORMAL); 83 - mkattr(SCROLLWIN_HEADING, A_BOLD); 84 - mkattr(SCROLLWIN_BOX, A_BOLD); 85 - 86 - mkattr(DIALOG_TEXT, A_BOLD); 87 - mkattr(DIALOG_BOX, A_BOLD); 88 - mkattr(DIALOG_MENU_FORE, A_STANDOUT); 89 - mkattr(DIALOG_MENU_BACK, A_NORMAL); 90 - 91 - mkattr(INPUT_BOX, A_NORMAL); 92 - mkattr(INPUT_HEADING, A_BOLD); 93 - mkattr(INPUT_TEXT, A_NORMAL); 94 - mkattr(INPUT_FIELD, A_UNDERLINE); 95 - 96 - mkattr(FUNCTION_HIGHLIGHT, A_BOLD); 97 - mkattr(FUNCTION_TEXT, A_REVERSE); 98 - } 99 - 100 - static void no_colors_theme(void) 101 - { 102 - /* automatically add highlight, no color */ 103 - #define mkattrn(name, attr) { attributes[name] = attr; } 104 - 105 - mkattrn(NORMAL, NORMAL); 106 - mkattrn(MAIN_HEADING, A_BOLD | A_UNDERLINE); 107 - 108 - mkattrn(MAIN_MENU_FORE, A_STANDOUT); 109 - mkattrn(MAIN_MENU_BACK, A_NORMAL); 110 - mkattrn(MAIN_MENU_GREY, A_NORMAL); 111 - mkattrn(MAIN_MENU_HEADING, A_BOLD); 112 - mkattrn(MAIN_MENU_BOX, A_NORMAL); 113 - 114 - mkattrn(SCROLLWIN_TEXT, A_NORMAL); 115 - mkattrn(SCROLLWIN_HEADING, A_BOLD); 116 - mkattrn(SCROLLWIN_BOX, A_BOLD); 117 - 118 - mkattrn(DIALOG_TEXT, A_NORMAL); 119 - mkattrn(DIALOG_BOX, A_BOLD); 120 - mkattrn(DIALOG_MENU_FORE, A_STANDOUT); 121 - mkattrn(DIALOG_MENU_BACK, A_NORMAL); 122 - 123 - mkattrn(INPUT_BOX, A_BOLD); 124 - mkattrn(INPUT_HEADING, A_BOLD); 125 - mkattrn(INPUT_TEXT, A_NORMAL); 126 - mkattrn(INPUT_FIELD, A_UNDERLINE); 127 - 128 - mkattrn(FUNCTION_HIGHLIGHT, A_BOLD); 129 - mkattrn(FUNCTION_TEXT, A_REVERSE); 130 - } 69 + static const struct nconf_attr_param no_color_theme_params[] = { 70 + NO_COLOR_ATTR(attr_normal, A_NORMAL), 71 + NO_COLOR_ATTR(attr_main_heading, A_BOLD | A_UNDERLINE), 72 + NO_COLOR_ATTR(attr_main_menu_box, A_NORMAL), 73 + NO_COLOR_ATTR(attr_main_menu_fore, A_STANDOUT), 74 + NO_COLOR_ATTR(attr_main_menu_back, A_NORMAL), 75 + NO_COLOR_ATTR(attr_main_menu_grey, A_NORMAL), 76 + NO_COLOR_ATTR(attr_main_menu_heading, A_BOLD), 77 + NO_COLOR_ATTR(attr_scrollwin_text, A_NORMAL), 78 + NO_COLOR_ATTR(attr_scrollwin_heading, A_BOLD), 79 + NO_COLOR_ATTR(attr_scrollwin_box, A_BOLD), 80 + NO_COLOR_ATTR(attr_dialog_text, A_NORMAL), 81 + NO_COLOR_ATTR(attr_dialog_menu_fore, A_STANDOUT), 82 + NO_COLOR_ATTR(attr_dialog_menu_back, A_NORMAL), 83 + NO_COLOR_ATTR(attr_dialog_box, A_BOLD), 84 + NO_COLOR_ATTR(attr_input_box, A_BOLD), 85 + NO_COLOR_ATTR(attr_input_heading, A_BOLD), 86 + NO_COLOR_ATTR(attr_input_text, A_NORMAL), 87 + NO_COLOR_ATTR(attr_input_field, A_UNDERLINE), 88 + NO_COLOR_ATTR(attr_function_text, A_REVERSE), 89 + NO_COLOR_ATTR(attr_function_highlight, A_BOLD), 90 + { /* sentinel */ } 91 + }; 131 92 132 93 void set_colors(void) 133 94 { 134 - start_color(); 135 - use_default_colors(); 136 - set_normal_colors(); 95 + const struct nconf_attr_param *p; 96 + int pair = 0; 97 + 137 98 if (has_colors()) { 138 - normal_color_theme(); 99 + start_color(); 100 + use_default_colors(); 101 + p = color_theme_params; 139 102 } else { 140 - /* give defaults */ 141 - no_colors_theme(); 103 + p = no_color_theme_params; 104 + } 105 + 106 + for (; p->attr; p++) { 107 + int attr = p->highlight; 108 + 109 + if (p->has_color) { 110 + pair++; 111 + init_pair(pair, p->color_fg, p->color_bg); 112 + attr |= COLOR_PAIR(pair); 113 + } 114 + 115 + *p->attr = attr; 142 116 } 143 117 } 144 118 145 - 146 119 /* this changes the windows attributes !!! */ 147 - void print_in_middle(WINDOW *win, 148 - int starty, 149 - int startx, 150 - int width, 151 - const char *string, 152 - chtype color) 153 - { int length, x, y; 154 - float temp; 155 - 156 - 157 - if (win == NULL) 158 - win = stdscr; 159 - getyx(win, y, x); 160 - if (startx != 0) 161 - x = startx; 162 - if (starty != 0) 163 - y = starty; 164 - if (width == 0) 165 - width = 80; 166 - 167 - length = strlen(string); 168 - temp = (width - length) / 2; 169 - x = startx + (int)temp; 170 - (void) wattrset(win, color); 171 - mvwprintw(win, y, x, "%s", string); 172 - refresh(); 120 + void print_in_middle(WINDOW *win, int y, int width, const char *str, int attrs) 121 + { 122 + wattrset(win, attrs); 123 + mvwprintw(win, y, (width - strlen(str)) / 2, "%s", str); 173 124 } 174 125 175 126 int get_line_no(const char *text) ··· 245 294 msg_win = derwin(win, win_rows-2, msg_width, 1, 246 295 1+(total_width+2-msg_width)/2); 247 296 248 - set_menu_fore(menu, attributes[DIALOG_MENU_FORE]); 249 - set_menu_back(menu, attributes[DIALOG_MENU_BACK]); 297 + set_menu_fore(menu, attr_dialog_menu_fore); 298 + set_menu_back(menu, attr_dialog_menu_back); 250 299 251 - (void) wattrset(win, attributes[DIALOG_BOX]); 300 + wattrset(win, attr_dialog_box); 252 301 box(win, 0, 0); 253 302 254 303 /* print message */ 255 - (void) wattrset(msg_win, attributes[DIALOG_TEXT]); 304 + wattrset(msg_win, attr_dialog_text); 256 305 fill_window(msg_win, msg); 257 306 258 307 set_menu_win(menu, win); ··· 356 405 form_win = derwin(win, 1, prompt_width, prompt_lines+3, 2); 357 406 keypad(form_win, TRUE); 358 407 359 - (void) wattrset(form_win, attributes[INPUT_FIELD]); 408 + wattrset(form_win, attr_input_field); 360 409 361 - (void) wattrset(win, attributes[INPUT_BOX]); 410 + wattrset(win, attr_input_box); 362 411 box(win, 0, 0); 363 - (void) wattrset(win, attributes[INPUT_HEADING]); 412 + wattrset(win, attr_input_heading); 364 413 if (title) 365 414 mvwprintw(win, 0, 3, "%s", title); 366 415 367 416 /* print message */ 368 - (void) wattrset(prompt_win, attributes[INPUT_TEXT]); 417 + wattrset(prompt_win, attr_input_text); 369 418 fill_window(prompt_win, prompt); 370 419 371 420 mvwprintw(form_win, 0, 0, "%*s", prompt_width, " "); ··· 527 576 528 577 /* create the pad */ 529 578 pad = newpad(total_lines+10, total_cols+10); 530 - (void) wattrset(pad, attributes[SCROLLWIN_TEXT]); 579 + wattrset(pad, attr_scrollwin_text); 531 580 fill_window(pad, text); 532 581 533 582 win_lines = min(total_lines+4, lines-2); ··· 542 591 win = newwin(win_lines, win_cols, y, x); 543 592 keypad(win, TRUE); 544 593 /* show the help in the help window, and show the help panel */ 545 - (void) wattrset(win, attributes[SCROLLWIN_BOX]); 594 + wattrset(win, attr_scrollwin_box); 546 595 box(win, 0, 0); 547 - (void) wattrset(win, attributes[SCROLLWIN_HEADING]); 596 + wattrset(win, attr_scrollwin_heading); 548 597 mvwprintw(win, 0, 3, " %s ", title); 549 598 panel = new_panel(win); 550 599 ··· 555 604 text_cols, 0); 556 605 print_in_middle(win, 557 606 text_lines+2, 558 - 0, 559 607 text_cols, 560 608 "<OK>", 561 - attributes[DIALOG_MENU_FORE]); 609 + attr_dialog_menu_fore); 562 610 wrefresh(win); 563 611 564 612 res = wgetch(win);
+21 -30
scripts/kconfig/nconf.h
··· 32 32 typeof(b) _b = b;\ 33 33 _a < _b ? _a : _b; }) 34 34 35 - typedef enum { 36 - NORMAL = 1, 37 - MAIN_HEADING, 38 - MAIN_MENU_BOX, 39 - MAIN_MENU_FORE, 40 - MAIN_MENU_BACK, 41 - MAIN_MENU_GREY, 42 - MAIN_MENU_HEADING, 43 - SCROLLWIN_TEXT, 44 - SCROLLWIN_HEADING, 45 - SCROLLWIN_BOX, 46 - DIALOG_TEXT, 47 - DIALOG_MENU_FORE, 48 - DIALOG_MENU_BACK, 49 - DIALOG_BOX, 50 - INPUT_BOX, 51 - INPUT_HEADING, 52 - INPUT_TEXT, 53 - INPUT_FIELD, 54 - FUNCTION_TEXT, 55 - FUNCTION_HIGHLIGHT, 56 - ATTR_MAX 57 - } attributes_t; 58 - extern attributes_t attributes[]; 35 + extern int attr_normal; 36 + extern int attr_main_heading; 37 + extern int attr_main_menu_box; 38 + extern int attr_main_menu_fore; 39 + extern int attr_main_menu_back; 40 + extern int attr_main_menu_grey; 41 + extern int attr_main_menu_heading; 42 + extern int attr_scrollwin_text; 43 + extern int attr_scrollwin_heading; 44 + extern int attr_scrollwin_box; 45 + extern int attr_dialog_text; 46 + extern int attr_dialog_menu_fore; 47 + extern int attr_dialog_menu_back; 48 + extern int attr_dialog_box; 49 + extern int attr_input_box; 50 + extern int attr_input_heading; 51 + extern int attr_input_text; 52 + extern int attr_input_field; 53 + extern int attr_function_text; 54 + extern int attr_function_highlight; 59 55 60 56 typedef enum { 61 57 F_HELP = 1, ··· 68 72 void set_colors(void); 69 73 70 74 /* this changes the windows attributes !!! */ 71 - void print_in_middle(WINDOW *win, 72 - int starty, 73 - int startx, 74 - int width, 75 - const char *string, 76 - chtype color); 75 + void print_in_middle(WINDOW *win, int y, int width, const char *str, int attrs); 77 76 int get_line_length(const char *line); 78 77 int get_line_no(const char *text); 79 78 const char *get_line(const char *text, int line_no);
+8 -19
scripts/kconfig/parser.y
··· 12 12 #include <stdbool.h> 13 13 14 14 #include "lkc.h" 15 + #include "internal.h" 15 16 16 17 #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt) 17 18 ··· 29 28 30 29 struct symbol *symbol_hash[SYMBOL_HASHSIZE]; 31 30 32 - static struct menu *current_menu, *current_entry; 31 + struct menu *current_menu, *current_entry; 33 32 34 33 %} 35 34 ··· 46 45 %token <string> T_HELPTEXT 47 46 %token <string> T_WORD 48 47 %token <string> T_WORD_QUOTE 49 - %token T_ALLNOCONFIG_Y 50 48 %token T_BOOL 51 49 %token T_CHOICE 52 50 %token T_CLOSE_PAREN ··· 53 53 %token T_COMMENT 54 54 %token T_CONFIG 55 55 %token T_DEFAULT 56 - %token T_DEFCONFIG_LIST 57 56 %token T_DEF_BOOL 58 57 %token T_DEF_TRISTATE 59 58 %token T_DEPENDS ··· 70 71 %token T_MODULES 71 72 %token T_ON 72 73 %token T_OPEN_PAREN 73 - %token T_OPTION 74 74 %token T_OPTIONAL 75 75 %token T_PLUS_EQUAL 76 76 %token T_PROMPT ··· 216 218 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); 217 219 }; 218 220 219 - config_option: T_OPTION T_MODULES T_EOL 221 + config_option: T_MODULES T_EOL 220 222 { 221 - menu_add_option_modules(); 222 - }; 223 - 224 - config_option: T_OPTION T_DEFCONFIG_LIST T_EOL 225 - { 226 - menu_add_option_defconfig_list(); 227 - }; 228 - 229 - config_option: T_OPTION T_ALLNOCONFIG_Y T_EOL 230 - { 231 - menu_add_option_allnoconfig_y(); 223 + if (modules_sym) 224 + zconf_error("symbol '%s' redefines option 'modules' already defined by symbol '%s'", 225 + current_entry->sym->name, modules_sym->name); 226 + modules_sym = current_entry->sym; 232 227 }; 233 228 234 229 /* choice entry */ ··· 508 517 } 509 518 if (yynerrs) 510 519 exit(1); 511 - sym_set_change_count(1); 520 + conf_set_changed(true); 512 521 } 513 522 514 523 static bool zconf_endtoken(const char *tokenname, ··· 714 723 } 715 724 } 716 725 } 717 - 718 - #include "menu.c"
+1
scripts/kconfig/qconf.cc
··· 122 122 goto set_prompt; 123 123 case P_COMMENT: 124 124 setIcon(promptColIdx, QIcon()); 125 + prompt = "*** " + prompt + " ***"; 125 126 goto set_prompt; 126 127 default: 127 128 ;
+2 -2
scripts/kconfig/streamline_config.pl
··· 21 21 # 1. Boot up the kernel that you want to stream line the config on. 22 22 # 2. Change directory to the directory holding the source of the 23 23 # kernel that you just booted. 24 - # 3. Copy the configuraton file to this directory as .config 24 + # 3. Copy the configuration file to this directory as .config 25 25 # 4. Have all your devices that you need modules for connected and 26 26 # operational (make sure that their corresponding modules are loaded) 27 27 # 5. Run this script redirecting the output to some other file ··· 481 481 # The idea is we look at all the configs that select it. If one 482 482 # is already in our list of configs to enable, then there's nothing 483 483 # else to do. If there isn't, we pick the first config that was 484 - # enabled in the orignal config and use that. 484 + # enabled in the original config and use that. 485 485 sub parse_config_selects 486 486 { 487 487 my ($config, $p) = @_;
+1 -2
scripts/kconfig/symbol.c
··· 35 35 .flags = SYMBOL_VALID, 36 36 }; 37 37 38 - struct symbol *sym_defconfig_list; 39 38 struct symbol *modules_sym; 40 39 static tristate modules_val; 41 40 ··· 472 473 473 474 for_all_symbols(i, sym) 474 475 sym->flags &= ~SYMBOL_VALID; 475 - sym_add_change_count(1); 476 + conf_set_changed(true); 476 477 sym_calc_value(modules_sym); 477 478 } 478 479
+1 -1
scripts/kconfig/tests/choice/Kconfig
··· 2 2 3 3 config MODULES 4 4 bool "Enable loadable module support" 5 - option modules 5 + modules 6 6 default y 7 7 8 8 choice
+1 -1
scripts/kconfig/tests/choice_value_with_m_dep/Kconfig
··· 2 2 3 3 config MODULES 4 4 def_bool y 5 - option modules 5 + modules 6 6 7 7 config DEP 8 8 tristate
+4
scripts/kconfig/tests/conftest.py
··· 53 53 # Override 'srctree' environment to make the test as the top directory 54 54 extra_env['srctree'] = self._test_dir 55 55 56 + # Clear KCONFIG_DEFCONFIG_LIST to keep unit tests from being affected 57 + # by the user's environment. 58 + extra_env['KCONFIG_DEFCONFIG_LIST'] = '' 59 + 56 60 # Run Kconfig in a temporary directory. 57 61 # This directory is automatically removed when done. 58 62 with tempfile.TemporaryDirectory() as temp_dir:
+1 -1
scripts/kconfig/tests/inter_choice/Kconfig
··· 2 2 3 3 config MODULES 4 4 def_bool y 5 - option modules 5 + modules 6 6 7 7 choice 8 8 prompt "Choice"