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

Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull kconfig changes from Michal Marek:

- Error handling for make KCONFIG_ALLCONFIG=<...> all*config plus a fix
for a bug that was exposed by this

- Fix for the script/config utility.

* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
scripts/config: properly report and set string options
kbuild: all{no,yes,mod,def,rand}config only read files when instructed to.
kconfig: Add error handling to KCONFIG_ALLCONFIG

+32 -19
+9 -9
Documentation/kbuild/kconfig.txt
··· 53 53 -------------------------------------------------- 54 54 (partially based on lkml email from/by Rob Landley, re: miniconfig) 55 55 -------------------------------------------------- 56 - The allyesconfig/allmodconfig/allnoconfig/randconfig variants can 57 - also use the environment variable KCONFIG_ALLCONFIG as a flag or a 58 - filename that contains config symbols that the user requires to be 59 - set to a specific value. If KCONFIG_ALLCONFIG is used without a 60 - filename, "make *config" checks for a file named 61 - "all{yes/mod/no/def/random}.config" (corresponding to the *config command 62 - that was used) for symbol values that are to be forced. If this file 63 - is not found, it checks for a file named "all.config" to contain forced 64 - values. 56 + The allyesconfig/allmodconfig/allnoconfig/randconfig variants can also 57 + use the environment variable KCONFIG_ALLCONFIG as a flag or a filename 58 + that contains config symbols that the user requires to be set to a 59 + specific value. If KCONFIG_ALLCONFIG is used without a filename where 60 + KCONFIG_ALLCONFIG == "" or KCONFIG_ALLCONFIG == "1", "make *config" 61 + checks for a file named "all{yes/mod/no/def/random}.config" 62 + (corresponding to the *config command that was used) for symbol values 63 + that are to be forced. If this file is not found, it checks for a 64 + file named "all.config" to contain forced values. 65 65 66 66 This enables you to create "miniature" config (miniconfig) or custom 67 67 config files containing just the config symbols that you are interested
+7 -4
scripts/config
··· 107 107 ;; 108 108 109 109 --set-str) 110 - set_var "CONFIG_$ARG" "CONFIG_$ARG=\"$1\"" 110 + # sed swallows one level of escaping, so we need double-escaping 111 + set_var "CONFIG_$ARG" "CONFIG_$ARG=\"${1//\"/\\\\\"}\"" 111 112 shift 112 113 ;; 113 114 ··· 125 124 if [ $? != 0 ] ; then 126 125 echo undef 127 126 else 128 - V="${V/CONFIG_$ARG=/}" 129 - V="${V/\"/}" 130 - echo "$V" 127 + V="${V/#CONFIG_$ARG=/}" 128 + V="${V/#\"/}" 129 + V="${V/%\"/}" 130 + V="${V/\\\"/\"}" 131 + echo "${V}" 131 132 fi 132 133 fi 133 134 ;;
+16 -6
scripts/kconfig/conf.c
··· 574 574 case alldefconfig: 575 575 case randconfig: 576 576 name = getenv("KCONFIG_ALLCONFIG"); 577 - if (name && !stat(name, &tmpstat)) { 578 - conf_read_simple(name, S_DEF_USER); 577 + if (!name) 578 + break; 579 + if ((strcmp(name, "") != 0) && (strcmp(name, "1") != 0)) { 580 + if (conf_read_simple(name, S_DEF_USER)) { 581 + fprintf(stderr, 582 + _("*** Can't read seed configuration \"%s\"!\n"), 583 + name); 584 + exit(1); 585 + } 579 586 break; 580 587 } 581 588 switch (input_mode) { ··· 593 586 case randconfig: name = "allrandom.config"; break; 594 587 default: break; 595 588 } 596 - if (!stat(name, &tmpstat)) 597 - conf_read_simple(name, S_DEF_USER); 598 - else if (!stat("all.config", &tmpstat)) 599 - conf_read_simple("all.config", S_DEF_USER); 589 + if (conf_read_simple(name, S_DEF_USER) && 590 + conf_read_simple("all.config", S_DEF_USER)) { 591 + fprintf(stderr, 592 + _("*** KCONFIG_ALLCONFIG set, but no \"%s\" or \"all.config\" file found\n"), 593 + name); 594 + exit(1); 595 + } 600 596 break; 601 597 default: 602 598 break;