aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 11:34:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 11:34:25 -0400
commit5b4197845ad1a33bc57da7ee5ea41de58c2f86bf (patch)
tree87139e25612c78431584f953053ae81ead30b27b
parenta22a0fdba4191473581f86c9dd5361cf581521d3 (diff)
parente062781397e5bebc6c1b8dd4bf466136e13ae4c5 (diff)
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kconfig updates from Michal Marek: "This is the kconfig part of kbuild for v3.12-rc1: - post-3.11 search code fixes and micro-optimizations - CONFIG_MODULES is no longer a special case; this is needed to eventually fix the bug that using KCONFIG_ALLCONFIG breaks allmodconfig - long long is used to store hex and int values - make silentoldconfig no longer warns when a symbol changes from tristate to bool (it's a job for make oldconfig) - scripts/diffconfig updated to work with newer Pythons - scripts/config does not rely on GNU sed extensions" * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: kconfig: do not allow more than one symbol to have 'option modules' kconfig: regenerate bison parser kconfig: do not special-case 'MODULES' symbol diffconfig: Update script to support python versions 2.5 through 3.3 diffconfig: Gracefully exit if the default config files are not present modules: do not depend on kconfig to set 'modules' option to symbol MODULES kconfig: silence warning when parsing auto.conf when a symbol has changed type scripts/config: use sed's POSIX interface kconfig: switch to "long long" for sanity kconfig: simplify symbol-search code kconfig: don't allocate n+1 elements in temporary array kconfig: minor style fixes in symbol-search code kconfig/[mn]conf: shorten title in search-box kconfig: avoid multiple calls to strlen Documentation/kconfig: more concise and straightforward search explanation
-rw-r--r--Documentation/kbuild/kconfig-language.txt1
-rw-r--r--Documentation/kbuild/kconfig.txt8
-rw-r--r--init/Kconfig1
-rwxr-xr-xscripts/config44
-rwxr-xr-xscripts/diffconfig33
-rw-r--r--scripts/kconfig/confdata.c11
-rw-r--r--scripts/kconfig/mconf.c4
-rw-r--r--scripts/kconfig/menu.c11
-rw-r--r--scripts/kconfig/nconf.c4
-rw-r--r--scripts/kconfig/symbol.c68
-rw-r--r--scripts/kconfig/zconf.tab.c_shipped562
-rw-r--r--scripts/kconfig/zconf.y11
12 files changed, 413 insertions, 345 deletions
diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt
index c858f8419eba..c420676c6fe3 100644
--- a/Documentation/kbuild/kconfig-language.txt
+++ b/Documentation/kbuild/kconfig-language.txt
@@ -147,6 +147,7 @@ applicable everywhere (see syntax).
147 - "modules" 147 - "modules"
148 This declares the symbol to be used as the MODULES symbol, which 148 This declares the symbol to be used as the MODULES symbol, which
149 enables the third modular state for all config symbols. 149 enables the third modular state for all config symbols.
150 At most one symbol may have the "modules" option set.
150 151
151 - "env"=<value> 152 - "env"=<value>
152 This imports the environment variable into Kconfig. It behaves like 153 This imports the environment variable into Kconfig. It behaves like
diff --git a/Documentation/kbuild/kconfig.txt b/Documentation/kbuild/kconfig.txt
index e349f293cc98..8ef6dbb6a462 100644
--- a/Documentation/kbuild/kconfig.txt
+++ b/Documentation/kbuild/kconfig.txt
@@ -175,11 +175,9 @@ Searching in menuconfig:
175 /^hotplug 175 /^hotplug
176 176
177 When searching, symbols are sorted thus: 177 When searching, symbols are sorted thus:
178 - exact match first: an exact match is when the search matches 178 - first, exact matches, sorted alphabetically (an exact match
179 the complete symbol name; 179 is when the search matches the complete symbol name);
180 - alphabetical order: when two symbols do not match exactly, 180 - then, other matches, sorted alphabetically.
181 they are sorted in alphabetical order (in the user's current
182 locale).
183 For example: ^ATH.K matches: 181 For example: ^ATH.K matches:
184 ATH5K ATH9K ATH5K_AHB ATH5K_DEBUG [...] ATH6KL ATH6KL_DEBUG 182 ATH5K ATH9K ATH5K_AHB ATH5K_DEBUG [...] ATH6KL ATH6KL_DEBUG
185 [...] ATH9K_AHB ATH9K_BTCOEX_SUPPORT ATH9K_COMMON [...] 183 [...] ATH9K_AHB ATH9K_BTCOEX_SUPPORT ATH9K_COMMON [...]
diff --git a/init/Kconfig b/init/Kconfig
index bfa9e13c9a93..18bd9e3d3274 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1670,6 +1670,7 @@ config BASE_SMALL
1670 1670
1671menuconfig MODULES 1671menuconfig MODULES
1672 bool "Enable loadable module support" 1672 bool "Enable loadable module support"
1673 option modules
1673 help 1674 help
1674 Kernel modules are small pieces of compiled code which can 1675 Kernel modules are small pieces of compiled code which can
1675 be inserted in the running kernel, rather than being 1676 be inserted in the running kernel, rather than being
diff --git a/scripts/config b/scripts/config
index 567120a87c39..2283be2bb62c 100755
--- a/scripts/config
+++ b/scripts/config
@@ -62,15 +62,52 @@ checkarg() {
62 fi 62 fi
63} 63}
64 64
65txt_append() {
66 local anchor="$1"
67 local insert="$2"
68 local infile="$3"
69 local tmpfile="$infile.swp"
70
71 # sed append cmd: 'a\' + newline + text + newline
72 cmd="$(printf "a\\%b$insert" "\n")"
73
74 sed -e "/$anchor/$cmd" "$infile" >"$tmpfile"
75 # replace original file with the edited one
76 mv "$tmpfile" "$infile"
77}
78
79txt_subst() {
80 local before="$1"
81 local after="$2"
82 local infile="$3"
83 local tmpfile="$infile.swp"
84
85 sed -e "s/$before/$after/" "$infile" >"$tmpfile"
86 # replace original file with the edited one
87 mv "$tmpfile" "$infile"
88}
89
90txt_delete() {
91 local text="$1"
92 local infile="$2"
93 local tmpfile="$infile.swp"
94
95 sed -e "/$text/d" "$infile" >"$tmpfile"
96 # replace original file with the edited one
97 mv "$tmpfile" "$infile"
98}
99
65set_var() { 100set_var() {
66 local name=$1 new=$2 before=$3 101 local name=$1 new=$2 before=$3
67 102
68 name_re="^($name=|# $name is not set)" 103 name_re="^($name=|# $name is not set)"
69 before_re="^($before=|# $before is not set)" 104 before_re="^($before=|# $before is not set)"
70 if test -n "$before" && grep -Eq "$before_re" "$FN"; then 105 if test -n "$before" && grep -Eq "$before_re" "$FN"; then
71 sed -ri "/$before_re/a $new" "$FN" 106 txt_append "^$before=" "$new" "$FN"
107 txt_append "^# $before is not set" "$new" "$FN"
72 elif grep -Eq "$name_re" "$FN"; then 108 elif grep -Eq "$name_re" "$FN"; then
73 sed -ri "s:$name_re.*:$new:" "$FN" 109 txt_subst "^$name=.*" "$new" "$FN"
110 txt_subst "^# $name is not set" "$new" "$FN"
74 else 111 else
75 echo "$new" >>"$FN" 112 echo "$new" >>"$FN"
76 fi 113 fi
@@ -79,7 +116,8 @@ set_var() {
79undef_var() { 116undef_var() {
80 local name=$1 117 local name=$1
81 118
82 sed -ri "/^($name=|# $name is not set)/d" "$FN" 119 txt_delete "^$name=" "$FN"
120 txt_delete "^# $name is not set" "$FN"
83} 121}
84 122
85if [ "$1" = "--file" ]; then 123if [ "$1" = "--file" ]; then
diff --git a/scripts/diffconfig b/scripts/diffconfig
index b91f3e34d44d..6d672836e187 100755
--- a/scripts/diffconfig
+++ b/scripts/diffconfig
@@ -10,7 +10,7 @@
10import sys, os 10import sys, os
11 11
12def usage(): 12def usage():
13 print """Usage: diffconfig [-h] [-m] [<config1> <config2>] 13 print("""Usage: diffconfig [-h] [-m] [<config1> <config2>]
14 14
15Diffconfig is a simple utility for comparing two .config files. 15Diffconfig is a simple utility for comparing two .config files.
16Using standard diff to compare .config files often includes extraneous and 16Using standard diff to compare .config files often includes extraneous and
@@ -33,7 +33,7 @@ Example usage:
33 EXT2_FS y -> n 33 EXT2_FS y -> n
34 LOG_BUF_SHIFT 14 -> 16 34 LOG_BUF_SHIFT 14 -> 16
35 PRINTK_TIME n -> y 35 PRINTK_TIME n -> y
36""" 36""")
37 sys.exit(0) 37 sys.exit(0)
38 38
39# returns a dictionary of name/value pairs for config items in the file 39# returns a dictionary of name/value pairs for config items in the file
@@ -54,23 +54,23 @@ def print_config(op, config, value, new_value):
54 if merge_style: 54 if merge_style:
55 if new_value: 55 if new_value:
56 if new_value=="n": 56 if new_value=="n":
57 print "# CONFIG_%s is not set" % config 57 print("# CONFIG_%s is not set" % config)
58 else: 58 else:
59 print "CONFIG_%s=%s" % (config, new_value) 59 print("CONFIG_%s=%s" % (config, new_value))
60 else: 60 else:
61 if op=="-": 61 if op=="-":
62 print "-%s %s" % (config, value) 62 print("-%s %s" % (config, value))
63 elif op=="+": 63 elif op=="+":
64 print "+%s %s" % (config, new_value) 64 print("+%s %s" % (config, new_value))
65 else: 65 else:
66 print " %s %s -> %s" % (config, value, new_value) 66 print(" %s %s -> %s" % (config, value, new_value))
67 67
68def main(): 68def main():
69 global merge_style 69 global merge_style
70 70
71 # parse command line args 71 # parse command line args
72 if ("-h" in sys.argv or "--help" in sys.argv): 72 if ("-h" in sys.argv or "--help" in sys.argv):
73 usage() 73 usage()
74 74
75 merge_style = 0 75 merge_style = 0
76 if "-m" in sys.argv: 76 if "-m" in sys.argv:
@@ -79,23 +79,27 @@ def main():