summaryrefslogtreecommitdiff
path: root/scripts/kconfig/conf.c
AgeCommit message (Collapse)Author
2019-02-27kbuild: move ".config not found!" message from Kconfig to MakefileMasahiro Yamada
If you run "make" in a pristine source tree, currently Kbuild will start to build Kconfig to let it show the error message. It would be more straightforward to check it in Makefile and let it fail immediately. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-12-28kconfig: convert to SPDX License IdentifierMasahiro Yamada
All files in lxdialog/ are licensed under GPL-2.0+, and the rest are under GPL-2.0. I added GPL-2.0 tags to test scripts in tests/. Documentation/process/license-rules.rst does not suggest anything about the flex/bison files. Because flex does not accept the C++ comment style at the very top of a file, I used the C style for zconf.l, and so for zconf.y for consistency. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-11-02kconfig: remove oldnoconfig targetMasahiro Yamada
As commit 312ee68752fa ("kconfig: announce removal of oldnoconfig if used") announced, it is time for the removal. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-08-22kconfig: suppress "configuration written to .config" for syncconfigMasahiro Yamada
The top-level Makefile invokes "make syncconfig" when necessary. Then, Kconfig displays the following message when .config is updated. # # configuration written to .config # It is distracting because "make syncconfig" happens during the build stage, and does nothing important in most cases. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-25kconfig: allow all config targets to write auto.conf if missingMasahiro Yamada
Currently, only syncconfig creates or updates include/config/auto.conf and some other files. Other config targets create or update only the .config file. When you configure and build the kernel from a pristine source tree, any config target is followed by syncconfig in the build stage since include/config/auto.conf is missing. We are moving compiler tests from Makefile to Kconfig. It means that parsing Kconfig files will be more costly since Kconfig invokes the compiler commands internally. Thus, we want to avoid invoking Kconfig twice (one for *config to create the .config, and one for syncconfig to synchronize the auto.conf). If auto.conf does not exist, we can generate all configuration files in the first configuration stage, which will save the syncconfig in the build stage. Please note this should be done only when auto.conf is missing. If *config blindly did this, time stamp files under include/config/ would be unnecessarily touched, triggering unneeded rebuild of objects. I assume a scenario like this: 1. You have a source tree that has already been built with CONFIG_FOO disabled 2. Run "make menuconfig" to enable CONFIG_FOO 3. CONFIG_FOO turns out to be unnecessary. Run "make menuconfig" again to disable CONFIG_FOO 4. Run "make" In this case, include/config/foo.h should not be touched since there is no change in CONFIG_FOO. The sync process should be delayed until the user really attempts to build the kernel. This commit has another motivation; I want to suppress the 'No such file or directory' warning from the 'include' directive. The top-level Makefile includes auto.conf with '-include' directive, like this: ifeq ($(dot-config),1) -include include/config/auto.conf endif This looks strange because auto.conf is mandatory when dot-config is 1. I guess only the reason of using '-include' is to suppress the warning 'include/config/auto.conf: No such file or directory' when building from a clean tree. However, this has a side-effect; Make considers the files included by '-include' are optional. Hence, Make continues to build even if it fails to generate include/config/auto.conf. I will change this in the next commit, but the warning message is annoying. (At least, kbuild test robot reports it as a regression.) With this commit, Kconfig will generate all configuration files together with the .config and I guess it is a solution good enough to suppress the warning. Note: GNU Make 4.2 or later does not display the warning from the 'include' directive if include files are successfully generated. See GNU Make commit 87a5f98d248f ("[SV 102] Don't show unnecessary include file errors.") However, older GNU Make versions are still widely used. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-07-25kconfig: make syncconfig update .config regardless of sym_change_countMasahiro Yamada
syncconfig updates the .config only when sym_change_count > 0, i.e. any change in config symbols has been detected. Not only symbols but also comments are contained in the .config file. If only comments are updated, they are not fed back to the .config, then the stale comments are left-over. Of course, this is just a matter of comments, but why not fix it. I see some scenarios where this happens. Scenario A: 1. You have a source tree that has already been configured. 2. Linus increments the version number in the top-level Makefile (i.e. he commits a new release) 3. You pull it, and run 'make' 4. syncconfig is invoked because the environment variable, KERNELVERSION is updated, but the .config is not updated since no config symbol is changed. 5. The .config file contains a kernel version in the top line: # Automatically generated file; DO NOT EDIT. # Linux/arm64 4.18.0-rc2 Kernel Configuration ... which points to a previous version. Scenario B: 1. You have a source tree that has already been configured. 2. You upgrade the compiler, but it still has the same version number. This may happen if you regularly build the latest compiler from the source code. 3. You run 'make' 4. syncconfig is invoked because the environment variable, CC_VERSION_TEXT is updated, but the .config is not updated since no config symbol is changed. 5. The .config file contains the version string of the compiler: # # Compiler: aarch64-linux-gcc (GCC) 9.0.0 20180628 (experimental) # ... which carries the information of the old compiler. If KCONFIG_NOSILENTUPDATE is set, syncconfig is not allowed to update the .config file. Otherwise, it is fine to update it regardless of sym_change_count. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-05-28kconfig: drop localization supportSam Ravnborg
The localization support is broken and appears unused. There is no google hits on the update-po-config target. And there is no recent (5 years) activity related to the localization. So lets just drop this as it is no longer used. Suggested-by: Ulf Magnusson <ulfalizer@gmail.com> Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-04-13kconfig: extend output of 'listnewconfig'Don Zickus
We at Red Hat/Fedora have generally tried to have a per file breakdown of every config option we set. This makes it easy for us to add new options when they are exposed and keep a changelog of why they were set. A Fedora example is here: https://src.fedoraproject.org/cgit/rpms/kernel.git/tree/configs/fedora/generic Using various merge scripts, we build up a config file and run it through 'make listnewconfig' and 'make oldnoconfig'. The idea is to print out new config options that haven't been manually set and use the default until a patch is posted to set it properly. To speed things up, it would be nice to make it easier to generate a patch to post the default setting. The output of 'make listnewconfig' has two issues that limit us: - it doesn't provide the default value - it doesn't provide the new 'choice' options that get flagged in 'oldconfig' This patch extends 'listnewconfig' to address the above two issues. This allows us to run a script make listnewconfig | rhconfig-tool -o patches; git send-email patches/ The output of 'make listnewconfig': CONFIG_NET_EMATCH_IPT CONFIG_IPVLAN CONFIG_ICE CONFIG_NET_VENDOR_NI CONFIG_IEEE802154_MCR20A CONFIG_IR_IMON_DECODER CONFIG_IR_IMON_RAW The new output of 'make listnewconfig': CONFIG_KERNEL_XZ=n CONFIG_KERNEL_LZO=n CONFIG_NET_EMATCH_IPT=n CONFIG_IPVLAN=n CONFIG_ICE=n CONFIG_NET_VENDOR_NI=y CONFIG_IEEE802154_MCR20A=n CONFIG_IR_IMON_DECODER=n CONFIG_IR_IMON_RAW=n Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-03-26kconfig: rename silentoldconfig to syncconfigMasahiro Yamada
As commit cedd55d49dee ("kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's help") mentioned, 'silentoldconfig' is a historical misnomer. That commit removed it from help and docs since it is an internal interface. If so, it should be allowed to rename it to something more intuitive. 'syncconfig' is the one I came up with because it updates the .config if necessary, then synchronize include/generated/autoconf.h and include/config/* with it. You should not manually invoke 'silentoldcofig'. Display warning if used in case existing scripts are doing wrong. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-03-26kconfig: hide irrelevant sub-menus for oldconfigMasahiro Yamada
Historically, "make oldconfig" has changed its behavior several times, quieter or louder. (I attached the history below.) Currently, it is not as quiet as it should be. This commit addresses it. Test Case --------- ---------------------------(Kconfig)---------------------------- menu "menu" config FOO bool "foo" menu "sub menu" config BAR bool "bar" endmenu endmenu menu "sibling menu" config BAZ bool "baz" endmenu ---------------------------------------------------------------- ---------------------------(.config)---------------------------- CONFIG_BAR=y CONFIG_BAZ=y ---------------------------------------------------------------- With the Kconfig and .config above, "make silentoldconfig" and "make oldconfig" work differently, like follows: $ make silentoldconfig scripts/kconfig/conf --silentoldconfig Kconfig * * Restart config... * * * menu * foo (FOO) [N/y/?] (NEW) y # # configuration written to .config # $ make oldconfig scripts/kconfig/conf --oldconfig Kconfig * * Restart config... * * * menu * foo (FOO) [N/y/?] (NEW) y * * sub menu * bar (BAR) [Y/n/?] y # # configuration written to .config # Both hide "sibling node" since it is irrelevant. The difference is that silentoldconfig hides "sub menu" whereas oldconfig does not. The behavior of silentoldconfig is preferred since the "sub menu" does not contain any new symbol. The root cause is in conf(). There are three input modes that can call conf(); oldaskconfig, oldconfig, and silentoldconfig. Everytime conf() encounters a menu entry, it calls check_conf() to check if it contains new symbols. If no new symbol is found, the menu is just skipped. Currently, this happens only when input_mode == silentoldconfig. The oldaskconfig enters into the check_conf() loop as silentoldconfig, so oldaskconfig works likewise for the second loop or later, but it never happens for oldconfig. So, irrelevant sub-menus are shown for oldconfig. Change the test condition to "input_mode != oldaskconfig". This is false only for the first loop of oldaskconfig; it must ask the user all symbols, so no need to call check_conf(). History of oldconfig -------------------- [0] Originally, "make oldconfig" was as loud as "make config" (It showed the entire .config file) [1] Commit cd9140e1e73a ("kconfig: make oldconfig is now less chatty") made oldconfig quieter, but it was still less quieter than silentoldconfig. (oldconfig did not hide sub-menus) [2] Commit 204c96f60904 ("kconfig: fix silentoldconfig") changed the input_mode of oldconfig to "ask_silent" from "ask_new". So, oldconfig really became as quiet as silentoldconfig. (oldconfig hided irrelevant sub-menus) [3] Commit 4062f1a4c030 ("kconfig: use long options in conf") made oldconfig as loud as [0] due to misconversion. [4] Commit 14828349719a ("kconfig: fix make oldconfig") addressed the misconversion of [3], but it made oldconfig quieter only to the same level as [1], not [2]. This commit is restoring the behavior of [2]. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-03-26kconfig: remove redundant input_mode test for check_conf() loopMasahiro Yamada
check_conf() never increments conf_cnt for listnewconfig, so conf_cnt is always zero. In other words, conf_cnt is not zero, "input_mode != listnewconfig" is met. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-03-26kconfig: remove unneeded input_mode test in conf()Masahiro Yamada
conf() is never called for listnewconfig / olddefconfig. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-03-26kconfig: do not call check_conf() for olddefconfigMasahiro Yamada
check_conf() traverses the menu tree, but it is completely no-op for olddefconfig because the following if-else block does nothing. if (input_mode == listnewconfig) { ... } else if (input_mode != olddefconfig) { ... } As the help message says, olddefconfig automatically sets new symbols to their default value. There is no room for manual intervention. So, calling check_conf() for olddefconfig is odd in the first place. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-02-09kconfig: send error messages to stderrMasahiro Yamada
These messages should be directed to stderr. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-02-09kconfig: echo stdin to stdout if either is redirectedMasahiro Yamada
If stdio is not tty, conf_askvalue() puts additional new line to prevent prompts from being concatenated into a single line. This care is missing in conf_choice(), so a 'choice' prompt and the next prompt are shown in the same line. Move the code into xfgets() to cater to all cases. To improve this more, let's echo stdin to stdout. This clarifies what keys were input from stdio and the stdout looks like as if it were from tty. I removed the isatty(2) check since stderr is unrelated here. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-02-09kconfig: remove check_stdin()Masahiro Yamada
Except silentoldconfig, valid_stdin is 1, so check_stdin() is no-op. oldconfig and silentoldconfig work almost in the same way except that the latter generates additional files under include/. Both ask users for input for new symbols. I do not know why only silentoldconfig requires stdio be tty. $ rm -f .config; touch .config $ yes "" | make oldconfig > stdout $ rm -f .config; touch .config $ yes "" | make silentoldconfig > stdout make[1]: *** [silentoldconfig] Error 1 make: *** [silentoldconfig] Error 2 $ tail -n 4 stdout Console input/output is redirected. Run 'make oldconfig' to update configuration. scripts/kconfig/Makefile:40: recipe for target 'silentoldconfig' failed Makefile:507: recipe for target 'silentoldconfig' failed Redirection is useful, for example, for testing where we want to give particular key inputs from a test file, then check the result. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-02-09kconfig: show '?' prompt even if no help text is availableMasahiro Yamada
'make config', 'make oldconfig', etc. always receive '?' as a valid input and show useful information even if no help text is available. ------------------------>8------------------------ foo (FOO) [N/y] (NEW) ? There is no help available for this option. Symbol: FOO [=n] Type : bool Prompt: foo Defined at Kconfig:1 ------------------------>8------------------------ However, '?' is not shown in the prompt if its help text is missing. Let's show '?' all the time so that the prompt and the behavior match. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-01-28kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's helpMarc Herbert
As explained by Michal Marek at https://lkml.org/lkml/2011/8/31/189 silentoldconfig has become a misnomer. It has become an internal interface so remove it from "make help" and Documentation/ to stop confusing people using it as seen for instance at https://chromium-review.googlesource.com/835632 Don't remove it from kconfig/Makefile yet not to break any (other) tool using it. On the other hand, correct and expand its description in the help of the (internal) scripts/kconfig/conf.c Signed-off-by: Marc Herbert <marc.herbert@intel.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-01-22kconfig: make xfgets() really staticMasahiro Yamada
Sparse reports: warning: symbol 'xfgets' was not declared. Should it be static? It is declared as static, but it is missing in the definition part. Move the definition up and remove the forward declaration. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-01-22kconfig: make input_mode staticMasahiro Yamada
Sparse reports: warning: symbol 'input_mode' was not declared. Should it be static? Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-12-10kconfig: allow kconfig to handle longer path namesMarkus Mayer
The current (arbitrary) limit of 128 characters for path names has proven too short for Android builds, as longer path names are used there. Change conf.c, so it can handle path lengths up to PATH_MAX characters. Signed-off-by: Markus Mayer <mmayer@broadcom.com> Signed-off-by: Michal Marek <mmarek@suse.com>
2015-04-09kconfig: Do not print status messages in make -s modeMichal Marek
Add an -s option to the various frontends and pass it when make -s is used. Also, use $(kecho) instead of @echo in the Makefile. Signed-off-by: Michal Marek <mmarek@suse.cz>
2014-06-10kbuild: trivial - use tabs for code indent where possibleMasahiro Yamada
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2013-06-24kconfig: loop as long as we changed some symbols in randconfigYann E. MORIN
Because of choice-in-a-choice constructs, it can happen that not all symbols are assigned a value during randconfig, leading in rare cases to this situation: ---8<--- choice-in-choice.in choice bool "A/B/C" config A bool "A" config B bool "B" if B choice bool "E/F" config E bool "E" config F bool "F" endchoice endif # B config C bool "C" endchoice ---8<--- $ ./scripts/kconfig/conf --randconfig choice-in-choice.in [--SNIP--] $ ./scripts/kconfig/conf --silentoldconfig choice-in-choice.in </dev/null [--SNIP--] A/B/C 1. A (A) > 2. B (B) 3. C (C) choice[1-3]: 2 E/F > 1. E (E) (NEW) 2. F (F) (NEW) choice[1-2]: aborted! Console input/output is redirected. Run 'make oldconfig' to update configuration. Fix this by looping in randconfig for as long as some symbol gets assigned a value. Note: this was spotted with the USB EHCI Debug Device Gadget (USB_G_DBGP), which uses this choice-in-a-choice construct, and exhibits this problem. The example above is just a stripped-down minimalist test-case. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-06-18kconfig/conf: print the seed used to initialise the RNG for randconfigYann E. MORIN
... so the user has a chance to reproduce a test-case. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-06-18kconfig/conf: accept a base-16 seed for randconfigYann E. MORIN
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-04-25kconfig: allow specifying the seed for randconfigYann E. MORIN
For reproducibility, it can be useful to be able to specify the seed to use to seed the RNG. Add a new KCONFIG_SEED environment variable which can be set to the seed to use: $ make KCONFIG_SEED=42 randconfig $ sha1sum .config 70a128c8dcc61303069e1be352cce64114dfcbca .config $ make KCONFIG_SEED=42 randconfig $ sha1sum .config 70a128c8dcc61303069e1be352cce64114dfcbca .config It's very usefull for eg. debugging the kconfig parser. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-02-19kbuild: Fix missing '\n' for NEW symbols in yes "" | make oldconfig >conf.newBen Hutchings
According to Documentation/kbuild/kconfig.txt, the commands: yes "" | make oldconfig >conf.new grep "(NEW)" conf.new should list the new config symbols with their default values. However, currently there is no line break after each new symbol. When kconfig is interactive the user will type a new-line at this point, but when non-interactive kconfig must print it. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Reference: http://bugs.debian.org/636029 [regid23@nt1.in: Adjusted Ben's work to apply cleanly to this tree] Reported-and-tested-by: Regid Ichira <regid23@nt1.in> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-09-27kconfig: replace 'oldnoconfig' with 'olddefconfig', and keep the old name as ↵Adam Lee
an alias As 67d34a6a391369269a2e5dba8a5f42cc4cd50231 said, 'oldnoconfig' doesn't set new symbols to 'n', but instead sets it to their default values. So, this patch replaces 'oldnoconfig' with 'olddefconfig', stop making people confused, and keep the old name 'oldnoconfig' as an alias, because people already are dependent on its behavior with the counter-intuitive name. Signed-off-by: Adam Lee <adam8157@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-08-31kconfig: document oldnoconfig to what it really does in conf.cAdam Lee
As 67d34a6a391369269a2e5dba8a5f42cc4cd50231 said, the make target 'oldnoconfig' is a misnomer. It doesn't set new symbols to 'n', but instead sets it to their default values. This patch fixes the document in conf.c, and will submit another patch to replace 'oldnoconfig' to 'olddefconfig' Signed-off-by: Adam Lee <adam8157@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-05-07kbuild: all{no,yes,mod,def,rand}config only read files when instructed to.Eric W. Biederman
Prevent subtle surprises to both people working on the kconfig code and people using make allnoconfig allyesconfig allmoconfig and randconfig by only attempting to read a config file if KCONFIG_ALLCONFIG is set. Common sense suggests attempting to read the extra config files does not make sense unless requested. The documentation says the code won't attempt to read the extra config files unless requested. Current usage does not appear to include people depending on the code reading the config files without the variable being set So do the simple thing and stop reading config files when passed all{no,yes,mod,def,rand}config unless KCONFIG_ALLCONFIG environment variable is set. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-05-05kconfig: Add error handling to KCONFIG_ALLCONFIGEric W. Biederman
- Only try to read the file specified if KCONFIG_ALL_CONFIG is set to something other than the empty string or "1". - Don't use stat to check the name passed to conf_read_simple so that zconf_fopen can find the file in the current directory or in SRCTREE removing a extremely source of confusing failure, where KCONFIG_ALL_CONFIG was not interpreted with respect to the directory make was called in. - If conf_read_simple fails complain clearly and stop processing. Allowing the simple debugging of typos. - Clearly document the behavior so it is clear to users which values are treated as flags and which values are treated as filenames. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-07-02kconfig/conf: mark xfgets() privateArnaud Lacombe
This function has not much reason to be public. In the mean time, convert declaration from K&R C to ISO C. Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-07-02kconfig/conf: add command line options' descriptionArnaud Lacombe
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-07-02kconfig/conf: reduce the scope of `defconfig_file'Arnaud Lacombe
This variable is not used outside of main() so there is not much reason keeping it global. Ensure it is initialized as gcc has no way to know that normal execution path expect only one option switch to be given on the command line (except when we request help). As a result, we always initialize `defconfig_file' before using it. Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-06kconfig: nuke LKC_DIRECT_LINK cruftArnaud Lacombe
This interface is not (and has never been ?) used by any frontend, just get rid of it. Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-06-06kconfig: annotate non-trivial fall-troughArnaud Lacombe
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-04-24kconfig: Avoid buffer underrun in choice inputBen Hutchings
Commit 40aee729b350 ('kconfig: fix default value for choice input') fixed some cases where kconfig would select the wrong option from a choice with a single valid option and thus enter an infinite loop. However, this broke the test for user input of the form 'N?', because when kconfig selects the single valid option the input is zero-length and the test will read the byte before the input buffer. If this happens to contain '?' (as it will in a mips build on Debian unstable today) then kconfig again enters an infinite loop. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: stable@kernel.org [2.6.17+] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-12-15kconfig/conf: merge duplicate switch's caseArnaud Lacombe
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-12Merge branch 'kbuild/rc-fixes' into kbuild/kconfigMichal Marek
We need to revert the temporary hack in 71ebc01, hence the merge.
2010-10-09kbuild: fix oldnoconfig to do the right thingKyle McMartin
Commit 861b4ea4 broke oldnoconfig when removed the oldnoconfig checks on if (input_mode == nonint_oldconfig || input_mode == oldnoconfig) { if (input_mode == nonint_oldconfig && sym->name && !sym_is_choice_value(sym)) { to avoid oldnoconfig chugging through the else stanza. Fix that to restore expected behaviour (which I've confirmed in the Fedora kernel build that the configs end up looking the same.) Signed-off-by: Kyle McMartin <kyle@redhat.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-09-19kconfig: rephrase help texts/comments not to include the package nameArnaud Lacombe
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com> Reviewed-by: Randy Dunlap <rdunlap@xenotime.net> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-19kconfig: allow build-time definition of the internal config prefixArnaud Lacombe
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Michal Marek <mmarek@suse.cz>
2010-09-08kbuild: fix oldnoconfig to do the right thingKyle McMartin
Commit 861b4ea4 broke oldnoconfig when removed the oldnoconfig checks on if (input_mode == nonint_oldconfig || input_mode == oldnoconfig) { if (input_mode == nonint_oldconfig && sym->name && !sym_is_choice_value(sym)) { to avoid oldnoconfig chugging through the else stanza. Fix that to restore expected behaviour (which I've confirmed in the Fedora kernel build that the configs end up looking the same.) Signed-off-by: Kyle McMartin <kyle@redhat.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-31kbuild: use getopt_long(), not its _only() variantArnaud Lacombe
NetBSD lacks getopt_long_only() whereas getopt_long() works just fine. Signed-off-by: Arnaud Lacombe <lacombar@gmail.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-13Merge branch 'kconfig' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: kconfig: Fix warning: ignoring return value of 'fgets' kconfig: Fix warning: ignoring return value of 'fwrite' nconfig: Fix segfault when menu is empty kconfig: fix tristate choice with minimal config kconfig: fix savedefconfig for tristate choices
2010-08-13kconfig: Fix warning: ignoring return value of 'fgets'Jean Sacren
This fix facilitates fgets() either it returns on success or on error or when end of file occurs. Signed-off-by: Jean Sacren <sakiwit@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-06kconfig: fix make oldconfigSam Ravnborg
Linus wrote: This seems to make "make oldconfig" a _lot_ more verbose than it used to be. In a very annoying way. I just did a quick git bisect. It's introduced by commit 4062f1a4c030 ("kconfig: use long options in conf") by Sam Ravnborg. Apparently that thing is totally buggy, and doesn't just change the option names, but actively breaks them. The old behaviour (from years ago) were reintroduced by accident. Fix this so we are back to the version that are silent if there is nothing to ask about. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Michal Marek <mmarek@suse.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-03kconfig: add savedefconfigSam Ravnborg
savedefconfig will save a minimal config to a file named "defconfig". The config symbols are saved in the same order as they appear in the menu structure so it should be possible to map them to the relevant menus if desired. The implementation was tested against several minimal configs for arm which was created using brute-force. There was one regression related to default numbers which had their valid range further limited by another symbol. Sample: config FOO int "foo" default 4 config BAR int "bar" range 0 FOO If FOO is set to 3 then BAR cannot take a value higher than 3. But the current implementation will set BAR equal to 4. This is seldomly used and the final configuration is OK, and the fix was non-trivial. So it was documented in the code and left as is. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-08-03kconfig: add alldefconfigSam Ravnborg
alldefconfig create a configuration with all values set to their default value (form the Kconfig files). This may be useful when we try to use more sensible default values and may also be used in combination with the minimal defconfigs. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>