aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-04-14kconfig: mconf,nconf: remove unneeded '\0' termination after snprintf()Masahiro Yamada2-17/+6
snprintf() always terminates the destination buffer with '\0' even if the buffer is not long enough. (In this case, the last element of the buffer becomes '\0'.) The explicit termination is unneeded. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: use /boot/config-* etc. as DEFCONFIG_LIST only for native buildMasahiro Yamada1-4/+4
When the .config file is missing, 'make config', 'make menuconfig', etc. uses a file listed in DEFCONFIG_LIST, if found, as base configuration. Ususally, /boot/config-$(uname -r) exists, and is used as default. However, when you are cross-compiling the kernel, it does not make sense to use /boot/config-* on the build host. It should default to arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG). UML previously did not use DEFCONFIG_LIST at all, but it should be able to use arch/um/configs/$(KBUILD_DEFCONFIG) as a base config file. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: change sym_change_count to a boolean flagMasahiro Yamada7-24/+18
sym_change_count has no good reason to be 'int' type. sym_set_change_count() compares the old and new values after casting both of them to (bool). I do not see any practical diffrence between sym_set_change_count(1) and sym_add_change_count(1). Use the boolean flag, conf_changed. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: nconf: fix core dump when searching in empty menuMasahiro Yamada1-3/+7
The following code in get_mext_match(): index = (index + items_num) % items_num; ... makes the program crash when items_num is zero (that is, the menu is empty). A menu can be empty when all the options in it are hidden by unmet 'depends on'. For example, menu "This menu will be empty" config FOO bool "foo" depends on BROKEN endmenu If you visit this menu and press a '/' key and then another key, nconf crashes with: Floating point exception (core dumped) When the number of items is zero, it does not make sense to search in the menu. In this case, current_item() returns NULL, and item_index() ERR, but get_mext_match() does not check it. Let's make get_mext_match() just return if the menu is empty. While I am here, change items_num from 'int' to 'unsigned int' because it should never become negative. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: lxdialog: A spello fix and a punctuation addedBhaskar Chowdhury1-2/+2
s/propperly/properly/ s/thats/that\'s/ Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: streamline_config.pl: Couple of typo fixesBhaskar Chowdhury1-2/+2
s/configuraton/configuration/ s/orignal/original/ Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: use true and false for bool variableYang Li1-1/+1
fixed the following coccicheck: ./scripts/kconfig/confdata.c:36:9-10: WARNING: return of 0/1 in function 'is_dir' with return type bool Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: change "modules" from sub-option to first-level attributeMasahiro Yamada7-16/+8
Now "modules" is the only member of the "option" property. Remove "option", and move "modules" to the top level property. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: remove allnoconfig_y optionMasahiro Yamada6-20/+1
Now that the only user, CONFIG_EMBEDDED has stopped using this option, remove it entirely. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: do not use allnoconfig_y optionMasahiro Yamada1-1/+2
allnoconfig_y is an ugly hack that sets a symbol to 'y' by allnoconfig. allnoconfig does not mean a minimal set of CONFIG options because a bunch of prompts are hidden by 'if EMBEDDED' or 'if EXPERT', but I do not like to hack Kconfig this way. Use the pre-existing feature, KCONFIG_ALLCONFIG, to provide a one liner config fragment. CONFIG_EMBEDDED=y is still forced when allnoconfig is invoked as a part of tinyconfig. No change in the .config file produced by 'make tinyconfig'. The output of 'make allnoconfig' will be changed; we will get CONFIG_EMBEDDED=n because allnoconfig literally sets all symbols to n. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: move default KBUILD_DEFCONFIG back to scripts/kconfig/MakefileMasahiro Yamada1-0/+4
This is a partial revert of commit 2a86f6612164 ("kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST"). Now that the reference to $(DEFCONFIG_LIST) was removed from init/Kconfig, the default KBUILD_DEFCONFIG can go back home. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: change defconfig_list option to environment variableMasahiro Yamada9-29/+42
"defconfig_list" is a weird option that defines a static symbol that declares the list of base config files in case the .config does not exist yet. This is quite different from other normal symbols; we just abused the "string" type and the "default" properties to list out the input files. They must be fixed values since these are searched for and loaded in the parse stage. It is an ugly hack, and should not exist in the first place. Providing this feature as an environment variable is a saner approach. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: move JUMP_NB to mconf.cMasahiro Yamada2-2/+2
This macro is only used in mconf.c. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: move conf_set_all_new_symbols() to conf.cMasahiro Yamada3-187/+193
This function is only used in conf.c. Move it there together with the randomize_choice_values() helper. Define 'enum conf_def_mode' locally in conf.c as well. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-03-25kconfig: move conf_rewrite_mod_or_yes() to conf.cMasahiro Yamada3-16/+15
This function is only used in conf.c. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-03-25kconfig: remove assignment for Kconfig fileMasahiro Yamada1-2/+1
Pass av[optind] to conf_parse() directly. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-03-25kconfig: add help messages for --help (-h) and --silent (-s)Masahiro Yamada1-3/+7
Add missing options and make the help message more readable. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-03-25kconfig: add long options --help and --silentMasahiro Yamada1-0/+2
They are long options for -h and -s, respectively. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-03-25kconfig: refactor option parse codeMasahiro Yamada1-48/+43
The current option parse code is clumsy. The 's' option is separately handled in an if-conditional due to the following code: input_mode = (enum input_mode)opt; If 's' is moved to the switch statement, the invalid value 's' would be assigned to the input_mode. Another potential problem is that we are mixing 'enum input_mode' and ASCII characters. They could overwrap if we add more input modes. To separate them out, set the flag field of long options to a pointer of input_mode_opt. For mode select options, getopt_long() returns 0, which never causes overwrap with ASCII characters that represent short options. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-03-25kconfig: split randconfig setup code into set_randconfig_seed()Masahiro Yamada1-23/+31
This code is too big to be placed in the switch statement. Move the code into a new helper function. I slightly refactor the code without changing the behavior. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-02-24kconfig: unify rule of config, menuconfig, nconfig, gconfig, xconfigMasahiro Yamada1-22/+14
Unify the similar build rules. This supports 'make build_config', which builds scripts/kconfig/conf but does not invoke it. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-02-24kconfig: omit --oldaskconfig option for 'make config'Masahiro Yamada2-1/+2
scripts/kconfig/conf.c line 39 defines the default of input_mode as oldaskconfig. Hence, 'make config' works in the same way even without the --oldaskconfig option given. Note this in the help message. This will be helpful to unify build rules in Makefile in the next commit. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-02-24kconfig: fix 'invalid option' for help optionMasahiro Yamada1-2/+2
scripts/kconfig/conf supports -? option to show the help message. This is not wired up to Makefile, so nobody would notice this, but it also shows 'invalid option' message. $ ./scripts/kconfig/conf -? ./scripts/kconfig/conf: invalid option -- '?' Usage: ./scripts/kconfig/conf [-s] [option] <kconfig-file> [option] is _one_ of the following: --listnewconfig List new options --helpnewconfig List new options and help text --oldaskconfig Start a new configuration using a line-oriented program ... The reason is the '?' is missing in the short option list passed to getopt_long(). While I fixed this issue, I also changed the option '?' to 'h'. I prefer -h (or --help, if a long option is also desired). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-02-24kconfig: remove dead code in conf_askvalue()Masahiro Yamada1-15/+1
conf_askvalue() is only called for oldconfig, syncconfig, and oldaskconfig. If it is called for other cases, it is a bug. So, the code after the switch statement is unreachable. Remove the dead code, and clean up the switch statement. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-02-24kconfig: clean up nested if-conditionals in check_conf()Masahiro Yamada1-26/+29
Unify the outer two if-conditionals into one. This decreases the indent level by one. Also, change the if-else blocks: if (input_mode == listnewconfig) { ... } else if (input_mode == helpnewconfig) { ... } else { ... } into the switch statement. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-02-24kconfig: Remove duplicate call to sym_get_string_value()Mickaël Salaün1-1/+1
Use the saved returned value of sym_get_string_value() instead of calling it twice. Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com> Link: https://lore.kernel.org/r/20210215181511.2840674-2-mic@digikod.net Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-01-27kconfig: mconf: fix HOSTCC callEnrico Weigelt, metux IT consult1-1/+1
Commit c0f975af1745 ("kconfig: Support building mconf with vendor sysroot ncurses") introduces a bug when HOSTCC contains parameters: the whole command line is treated as the program name (with spaces in it). Therefore, we have to remove the quotes. Fixes: c0f975af1745 ("kconfig: Support building mconf with vendor sysroot ncurses") Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-01-04kconfig: remove 'kvmconfig' and 'xenconfig' shorthandsMasahiro Yamada1-10/+0
Linux 5.10 is out. Remove the 'kvmconfig' and 'xenconfig' shorthands as previously announced. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-01-04kconfig: Support building mconf with vendor sysroot ncursesJohn Millikin1-1/+3
Changes the final fallback path in the ncurses locator for mconf to support host compilers with a non-default sysroot. This is similar to the hardcoded search for ncurses under '/usr/include', but can support compilers that keep their default header and library directories elsewhere. For nconfig, do nothing because the only vendor compiler I'm aware of with this layout (Apple Clang) ships an ncurses version that's too old for nconfig anyway. Signed-off-by: John Millikin <john@john-millikin.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-12-21kconfig: fix return value of do_error_if()Masahiro Yamada1-1/+1
$(error-if,...) is expanded to an empty string. Currently, it relies on eval_clause() returning xstrdup("") when all attempts for expansion fail, but the correct implementation is to make do_error_if() return xstrdup(""). Fixes: 1d6272e6fe43 ("kconfig: add 'info', 'warning-if', and 'error-if' built-in functions") Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-12-08kconfig: clean up header inclusionBoris Kolpackov4-3/+2
- Add missing includes. - Remove no longer necessary includes. Signed-off-by: Boris Kolpackov <boris@codesynthesis.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-12-08kconfig: qconf: show Qt version in the About dialogMasahiro Yamada1-3/+6
You can get the Qt version by running "pkg-config --modversion Qt5Core" or something, but this might be useful to get the runtime Qt version more easily. Go to the menu "Help" -> "About", then you can see it. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-12-08kconfig: make lkc.h self-sufficient #include-wiseBoris Kolpackov1-0/+4
Signed-off-by: Boris Kolpackov <boris@codesynthesis.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-12-08kconfig: qconf: convert to Qt5 new signal/slot connection syntaxMasahiro Yamada1-58/+78
Now that the Qt4 support was dropped, we can use the new connection syntax supported by Qt5. It provides compile-time checking of the validity of the connection. Previously, the connection between signals and slots were checked only run-time. Commit d85de3399f97 ("kconfig: qconf: fix signal connection to invalid slots") fixed wrong slots. This change makes it possible to catch such mistakes easily. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Tested-by: Boris Kolpackov <boris@codesynthesis.com>
2020-12-08kconfig: qconf: use a variable to pass packages to pkg-configMasahiro Yamada1-1/+1
The variable, PKG, is defined at the beginning of this script. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-12-08kconfig: qconf: drop Qt4 supportMasahiro Yamada1-10/+2
It is possible to keep this compatible with both Qt4 and Qt5, but it is questionable if it is worth the efforts; it would require us to test this on both of them, and prevent us from using new features in Qt5. Qt5 was released in 2012, and now widely available. Drop the Qt4 support. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-10-22Merge tag 'kconfig-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuildLinus Torvalds2-275/+170
Pull Kconfig updates from Masahiro Yamada: - Remove unused or useless code from qconf - Allow to edit "int", "hex", "string" options in place, and remove the separate edit box from qconf * tag 'kconfig-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kconfig: qconf: create QApplication after option checks kconfig: qconf: remove Y, M, N columns kconfig: qconf: remove ConfigView class kconfig: qconf: move setShowName/Range() to ConfigList from ConfigView kconfig: qconf: remove ConfigLineEdit class kconfig: qconf: allow to edit "int", "hex", "string" menus in-place kconfig: qconf: show data column all the time kconfig: qconf: move ConfigView::updateList(All) to ConfigList class kconfig: qconf: remove unused ConfigItem::okRename() kconfig: qconf: update the intro message to match to the current code kconfig: qconf: reformat the intro message
2020-10-22Merge tag 'kbuild-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuildLinus Torvalds1-8/+8
Pull Kbuild updates from Masahiro Yamada: - Support 'make compile_commands.json' to generate the compilation database more easily, avoiding stale entries - Support 'make clang-analyzer' and 'make clang-tidy' for static checks using clang-tidy - Preprocess scripts/modules.lds.S to allow CONFIG options in the module linker script - Drop cc-option tests from compiler flags supported by our minimal GCC/Clang versions - Use always 12-digits commit hash for CONFIG_LOCALVERSION_AUTO=y - Use sha1 build id for both BFD linker and LLD - Improve deb-pkg for reproducible builds and rootless builds - Remove stale, useless scripts/namespace.pl - Turn -Wreturn-type warning into error - Fix build error of deb-pkg when CONFIG_MODULES=n - Replace 'hostname' command with more portable 'uname -n' - Various Makefile cleanups * tag 'kbuild-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (34 commits) kbuild: Use uname for LINUX_COMPILE_HOST detection kbuild: Only add -fno-var-tracking-assignments for old GCC versions kbuild: remove leftover comment for filechk utility treewide: remove DISABLE_LTO kbuild: deb-pkg: clean up package name variables kbuild: deb-pkg: do not build linux-headers package if CONFIG_MODULES=n kbuild: enforce -Werror=return-type scripts: remove namespace.pl builddeb: Add support for all required debian/rules targets builddeb: Enable rootless builds builddeb: Pass -n to gzip for reproducible packages kbuild: split the build log of kallsyms kbuild: explicitly specify the build id style scripts/setlocalversion: make git describe output more reliable kbuild: remove cc-option test of -Werror=date-time kbuild: remove cc-option test of -fno-stack-check kbuild: remove cc-option test of -fno-strict-overflow kbuild: move CFLAGS_{KASAN,UBSAN,KCSAN} exports to relevant Makefiles kbuild: remove redundant CONFIG_KASAN check from scripts/Makefile.kasan kbuild: do not create built-in objects for external module builds ...
2020-09-25kconfig: qconf: create QApplication after option checksMasahiro Yamada1-1/+2
'scripts/kconfig/qconf -h' just calls usage() and exits, with QApplication unused. There is no need to construct QApplication so early. Do it after the parse stage. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Tested-by: Randy Dunlap <rdunlap@infradead.org>
2020-09-25kconfig: qconf: remove Y, M, N columnsMasahiro Yamada2-61/+4
There are so many ways to toggle bool / tristate options. I do not know how useful these columns are. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-09-25kconfig: qconf: remove ConfigView classMasahiro Yamada2-47/+17
Now that ConfigView only contains ConfigList, we can remove ConfigView and just use ConfigList. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-09-25kconfig: qconf: move setShowName/Range() to ConfigList from ConfigViewMasahiro Yamada2-33/+32
ConfigView::setShowName/Range() only get access to the 'list' member. Move them to the more relevant ConfigList class. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-09-25kconfig: qconf: remove ConfigLineEdit classMasahiro Yamada2-57/+0
Now that "int", "hex", "string" menus are edited in-place, this class is no longer needed. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-09-25kconfig: qconf: allow to edit "int", "hex", "string" menus in-placeMasahiro Yamada2-17/+91
Previously, when you double-clicked the "int", "hex", or "string" menus, a line-edit gadget showed up to allow you to input the value, which looked clumsy. Also, it was buggy; the editor opened even if the config option was not editable. For example, just try to double-click CC_VERSION_TEXT, which has no prompt. This commit sub-classes QStyleItemDelegate to allow users to edit "int", "hex", "string" menus in-place. Just double-click (or press the F2 key) in the data column. Then, an editor widget is placed on top of the item view. The two methods are overridden: createEditor - process only when the data column is being accessed and the menu is visible. Otherwise, return nullptr to disallow editing. setModelData - take the new data from the editor, and set it to the addressed symbol. If it was successful, update all the list windows. Otherwise, (the reason for the failure is possibly the input data was out of range), set the old value back to the editor. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-09-25kconfig: qconf: show data column all the timeMasahiro Yamada2-32/+2
The next commit will allow users to edit "int", "hex", "string" menus in-place from the data column. The data column should be always displayed. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-09-25kconfig: qconf: move ConfigView::updateList(All) to ConfigList classMasahiro Yamada2-42/+39
ConfigView::updateList() iterates over all views, and then calls updateList() against for its ConfigList instance. This means there is no point to implement it in the ConfigView class. Move and rename as follows: ConfigView::updateList() -> ConfigList::updateListForAll() ConfigView::updateListAll() -> ConfigList::updateListAllForAll() I used QList to contain all ConfigList instances. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-09-25kconfig: qconf: remove unused ConfigItem::okRename()Masahiro Yamada2-9/+0
Commit 76538660fb08 ("Port xconfig to Qt5 - Remove custom ListView classes.") removed the original implementation, where ConfigItem::okRename() overrode Q3ListViewItem::okRename(). Commit 59e564408f88 ("Port xconfig to Qt5 - Put back some of the old implementation.") restored the empty stub, but it seems useless. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-09-25kconfig: qconf: update the intro message to match to the current codeMasahiro Yamada1-4/+4
I do not think "Although there is no cross reference yet ..." is valid any longer. The cross reference is supported via hyperlinks enabled by the "show Debug Info" option. Update the message. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Tested-by: Randy Dunlap <rdunlap@infradead.org>
2020-09-25kconfig: qconf: reformat the intro messageMasahiro Yamada1-11/+18
The introduction message displayed by 'Help -> Introduction' does not look nice due to excessive new lines. Reformat the message. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Tested-by: Randy Dunlap <rdunlap@infradead.org>
2020-09-20kconfig: qconf: revive help message in the info viewMasahiro Yamada1-3/+8
Since commit 68fd110b3e7e ("kconfig: qconf: remove redundant help in the info view"), the help message is no longer displayed. I intended to drop duplicated "Symbol:", "Type:", but precious info about help and reverse dependencies was lost too. Revive it now. "defined at" is contained in menu_get_ext_help(), so I made sure to not display it twice. Fixes: 68fd110b3e7e ("kconfig: qconf: remove redundant help in the info view") Reported-by: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>