aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/kbuild/kconfig.txt18
-rwxr-xr-xscripts/config11
-rw-r--r--scripts/kconfig/conf.c22
3 files changed, 32 insertions, 19 deletions
diff --git a/Documentation/kbuild/kconfig.txt b/Documentation/kbuild/kconfig.txt
index 9d5f2a90dca9..a09f1a6a830c 100644
--- a/Documentation/kbuild/kconfig.txt
+++ b/Documentation/kbuild/kconfig.txt
@@ -53,15 +53,15 @@ KCONFIG_ALLCONFIG
53-------------------------------------------------- 53--------------------------------------------------
54(partially based on lkml email from/by Rob Landley, re: miniconfig) 54(partially based on lkml email from/by Rob Landley, re: miniconfig)
55-------------------------------------------------- 55--------------------------------------------------
56The allyesconfig/allmodconfig/allnoconfig/randconfig variants can 56The allyesconfig/allmodconfig/allnoconfig/randconfig variants can also
57also use the environment variable KCONFIG_ALLCONFIG as a flag or a 57use the environment variable KCONFIG_ALLCONFIG as a flag or a filename
58filename that contains config symbols that the user requires to be 58that contains config symbols that the user requires to be set to a
59set to a specific value. If KCONFIG_ALLCONFIG is used without a 59specific value. If KCONFIG_ALLCONFIG is used without a filename where
60filename, "make *config" checks for a file named 60KCONFIG_ALLCONFIG == "" or KCONFIG_ALLCONFIG == "1", "make *config"
61"all{yes/mod/no/def/random}.config" (corresponding to the *config command 61checks for a file named "all{yes/mod/no/def/random}.config"
62that was used) for symbol values that are to be forced. If this file 62(corresponding to the *config command that was used) for symbol values
63is not found, it checks for a file named "all.config" to contain forced 63that are to be forced. If this file is not found, it checks for a
64values. 64file named "all.config" to contain forced values.
65 65
66This enables you to create "miniature" config (miniconfig) or custom 66This enables you to create "miniature" config (miniconfig) or custom
67config files containing just the config symbols that you are interested 67config files containing just the config symbols that you are interested
diff --git a/scripts/config b/scripts/config
index a7c7c4b8e957..ed6653ef9702 100755
--- a/scripts/config
+++ b/scripts/config
@@ -107,7 +107,8 @@ while [ "$1" != "" ] ; do
107 ;; 107 ;;
108 108
109 --set-str) 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 shift 112 shift
112 ;; 113 ;;
113 114
@@ -124,9 +125,11 @@ while [ "$1" != "" ] ; do
124 if [ $? != 0 ] ; then 125 if [ $? != 0 ] ; then
125 echo undef 126 echo undef
126 else 127 else
127 V="${V/CONFIG_$ARG=/}" 128 V="${V/#CONFIG_$ARG=/}"
128 V="${V/\"/}" 129 V="${V/#\"/}"
129 echo "$V" 130 V="${V/%\"/}"
131 V="${V/\\\"/\"}"
132 echo "${V}"
130 fi 133 fi
131 fi 134 fi
132 ;; 135 ;;
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index f208f900ed3a..0dc4a2c779b1 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -574,8 +574,15 @@ int main(int ac, char **av)
574 case alldefconfig: 574 case alldefconfig:
575 case randconfig: 575 case randconfig:
576 name = getenv("KCONFIG_ALLCONFIG"); 576 name = getenv("KCONFIG_ALLCONFIG");
577 if (name && !stat(name, &tmpstat)) { 577 if (!name)
578 conf_read_simple(name, S_DEF_USER); 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 break; 586 break;
580 } 587 }
581 switch (input_mode) { 588 switch (input_mode) {
@@ -586,10 +593,13 @@ int main(int ac, char **av)
586 case randconfig: name = "allrandom.config"; break; 593 case randconfig: name = "allrandom.config"; break;
587 default: break; 594 default: break;
588 } 595 }
589 if (!stat(name, &tmpstat)) 596 if (conf_read_simple(name, S_DEF_USER) &&
590 conf_read_simple(name, S_DEF_USER); 597 conf_read_simple("all.config", S_DEF_USER)) {
591 else if (!stat("all.config", &tmpstat)) 598 fprintf(stderr,
592 conf_read_simple("all.config", S_DEF_USER); 599 _("*** KCONFIG_ALLCONFIG set, but no \"%s\" or \"all.config\" file found\n"),
600 name);
601 exit(1);
602 }
593 break; 603 break;
594 default: 604 default:
595 break; 605 break;