History log of /linux-master/scripts/kconfig/nconf.c
Revision Date Author Comments
# 4dae9cf5 02-Feb-2024 Masahiro Yamada <masahiroy@kernel.org>

kconfig: split list_head into a separate header

The struct list_head is often embedded in other structures, while other
code is used in C functions.

By separating struct list_head into its own header, other headers are no
longer required to include the entire list.h.

This is similar to the kernel space, where struct list_head is defined
in <linux/types.h> instead of <linux/list.h>.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 6c07fd84 03-Dec-2023 Masahiro Yamada <masahiroy@kernel.org>

kconfig: factor out common code shared by mconf and nconf

Separate out the duplicated code to mnconf-common.c.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 0df8e970 24-Nov-2023 Masahiro Yamada <masahiroy@kernel.org>

scripts: clean up IA-64 code

A little more janitorial work after commit cf8e8658100d ("arch: Remove
Itanium (IA-64) architecture").

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>


# 1ba67cd3 08-Aug-2023 Jesse Taube <mr.bossman075@gmail.com>

kconfig: nconf: Add search jump feature

Menuconfig has a feature where you can "press the key in the (#) prefix
to jump directly to that location. You will be returned to the current
search results after exiting this new menu."

This commit adds this feature to nconfig, with almost identical code.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 2bbb4861 01-Jun-2022 Isak Ellmer <isak01@gmail.com>

scripts: kconfig: nconf: make nconfig accept jk keybindings

Make nconfig accept jk keybindings for movement in addition to arrow
keys.

Signed-off-by: Isak Ellmer <isak01@gmail.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 8c94b430 15-Apr-2021 Mihai Moldovan <ionic@ionic.de>

kconfig: nconf: stop endless search loops

If the user selects the very first entry in a page and performs a
search-up operation, or selects the very last entry in a page and
performs a search-down operation that will not succeed (e.g., via
[/]asdfzzz[Up Arrow]), nconf will never terminate searching the page.

The reason is that in this case, the starting point will be set to -1
or n, which is then translated into (n - 1) (i.e., the last entry of
the page) or 0 (i.e., the first entry of the page) and finally the
search begins. This continues to work fine until the index reaches 0 or
(n - 1), at which point it will be decremented to -1 or incremented to
n, but not checked against the starting point right away. Instead, it's
wrapped around to the bottom or top again, after which the starting
point check occurs... and naturally fails.

My original implementation added another check for -1 before wrapping
the running index variable around, but Masahiro Yamada pointed out that
the actual issue is that the comparison point (starting point) exceeds
bounds (i.e., the [0,n-1] interval) in the first place and that,
instead, the starting point should be fixed.

This has the welcome side-effect of also fixing the case where the
starting point was n while searching down, which also lead to an
infinite loop.

OTOH, this code is now essentially all his work.

Amazingly, nobody seems to have been hit by this for 11 years - or at
the very least nobody bothered to debug and fix this.

Signed-off-by: Mihai Moldovan <ionic@ionic.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 08718745 11-Apr-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: nconf: refactor in print_in_middle()

This helper is the same as the sample code in the NCURSES HOWTO [1],
but it is over-engineering to be used for nconf.

I do not see any good reason to use the 'float' type just for the
division by 2.

All the call-sites pass a non-NULL pointer to the first argument,
so 'if (win == NULL) win = stdscr;' is dead code.

'if (startx != 0) x = startx;' is dead code because 'x' will be
overridden some lines below, by 'x = startx + (int)temp;'.

All the call-sites pass a non-zero value to the second argument,
so 'if (starty != 0)' is always true.

getyx(win, y, x) is also dead-code because both 'y' and 'x' are
overridden.

All the call-sites pass 0 to the third parameter, so 'startx' can
be removed.

All the call-sites pass a non-zero value to the fourth parameter,
so 'if (width == 0) width = 80;' is dead code.

The window will be refreshed later, so there is no need to call
refresh() in this function.

Change the type of the last parameter from 'chtype' to 'int' to be
aligned with the prototype, 'int wattrset(WINDOW *win, int attrs);'

I also slightly cleaned up the indentation style.

[1]: https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/color.html

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 0a94768c 11-Apr-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: nconf: remove meaningless wattrset() call from show_menu()

This attribute is not used because it will be overridden some lines
below:

wattrset(main_window, attr_main_menu_box);

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# ecdb733f 11-Apr-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: nconf: change set_config_filename() to void function

No one uses the return value of this function.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 93487b17 10-Apr-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: nconf: refactor attributes setup code

The current attributes setup code is strange; the array attribute[]
is set to values outside the range of the attribute_t enum.

At least,

attributes_t attributes[ATTR_MAX+1] = {0};

... should be

int attribute[ATTR_MAX+1] = {0};

Also, there is no need to hard-code the color-pair numbers in
attributes_t.

The current code is messy. Rewrite it.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 16b0e102 10-Apr-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: nconf: remove unneeded default for menu prompt

The rootmenu always has a prompt even if the 'mainmenu' statement is
missing in the top Kconfig file.

conf_parse() calls menu_add_prompt(P_MENU, "Main menu", NULL) in this
case.

So, every 'menu' has a prompt.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 2ba50da9 10-Apr-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: nconf: get rid of (void) casts from wattrset() calls

This reverts commit 10175ba65fde ("nconfig: Silence unused return values
from wattrset").

With this patch applied, recent GCC versions can cleanly build nconf
without "value computed is not used" warnings.

The wattrset() used to be implemented as a macro, like this:

#define wattrset(win,at) \
(NCURSES_OK_ADDR(win) \
? ((win)->_attrs = NCURSES_CAST(attr_t, at), \
OK) \
: ERR)

The GCC bugzilla [1] reported a false-positive -Wunused-value warning
in a similar test case. It was fixed by GCC 4.4.1.

Let's revert that commit, and see if somebody will claim the issue.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39889

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 68876c38 10-Apr-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: mconf,nconf: remove unneeded '\0' termination after snprintf()

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>


# 5ee54659 10-Apr-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: change sym_change_count to a boolean flag

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>


# 1f035a52 10-Apr-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: nconf: fix core dump when searching in empty menu

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>


# 163e0c27 31-Aug-2020 Denis Efremov <efremov@linux.com>

kconfig: remove redundant assignment prompt = prompt

Semi-automatic removing of localization macros changed the line
from "prompt = _(prompt);" to "prompt = prompt;". Drop the
reduntand assignment.

Fixes: 694c49a7c01c ("kconfig: drop localization support")
Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# ba82f52e 09-Jan-2020 Bartosz Golaszewski <bgolaszewski@baylibre.com>

kconfig: fix an "implicit declaration of function" warning

strncasecmp() & strcasecmp() functions are declared in strings.h, not
string.h. On most environments the former is implicitly included by
the latter but on some setups, building menuconfig results in the
following warning:

HOSTCC scripts/kconfig/mconf.o
scripts/kconfig/mconf.c: In function ‘search_conf’:
scripts/kconfig/mconf.c:423:6: warning: implicit declaration of function ‘strncasecmp’ [-Wimplicit-function-declaration]
if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0)
^~~~~~~~~~~
scripts/kconfig/mconf.c: In function ‘main’:
scripts/kconfig/mconf.c:1021:8: warning: implicit declaration of function ‘strcasecmp’ [-Wimplicit-function-declaration]
if (!strcasecmp(mode, "single_menu"))
^~~~~~~~~~

Fix it by explicitly including strings.h.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# baa23ec8 03-Jul-2019 Marco Ammon <marco.ammon@fau.de>

kconfig: Fix spelling of sym_is_changable

There is a spelling mistake in "changable", it is corrected to
"changeable" and all call sites are updated accordingly.

Signed-off-by: Marco Ammon <marco.ammon@fau.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 580c5b3e 10-May-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: make parent directories for the saved .config as needed

With menuconfig / nconfig, users can input any file path from the
"Save" menu, but it fails if the parent directory does not exist.

Why not create the parent directory automatically. I think this is
a user-friendly behavior.

I changed the error messages in menuconfig / nconfig.

"Nonexistent directory" is no longer the most likely reason of the
failure. Perhaps, the user specified the existing directory, or
attempted to write to the location without write permission.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 9c38f1f0 25-Mar-2019 Changbin Du <changbin.du@intel.com>

kconfig/[mn]conf: handle backspace (^H) key

Backspace is not working on some terminal emulators which do not send the
key code defined by terminfo. Terminals either send '^H' (8) or '^?' (127).
But currently only '^?' is handled. Let's also handle '^H' for those
terminals.

Signed-off-by: Changbin Du <changbin.du@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 0c874100 18-Dec-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: convert to SPDX License Identifier

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>


# 00c864f8 20-Jul-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: allow all config targets to write auto.conf if missing

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>


# 5accd7f3 04-Jul-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: handle format string before calling conf_message_callback()

As you see in mconf.c and nconf.c, conf_message_callback() hooks are
likely to end up with the boilerplate of vsnprintf(). Process the
string format before calling conf_message_callback() so that it
receives a simple string.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Dirk Gouders <dirk@gouders.net>


# 694c49a7 22-May-2018 Sam Ravnborg <sam@ravnborg.org>

kconfig: drop localization support

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>


# ad818106 22-May-2017 Randy Dunlap <rdunlap@infradead.org>

kconfig: fix sparse warnings in nconfig

Fix sparse warnings in scripts/kconfig/nconf* ('make nconfig'):

../scripts/kconfig/nconf.c:1071:32: warning: Using plain integer as NULL pointer
../scripts/kconfig/nconf.c:1238:30: warning: Using plain integer as NULL pointer
../scripts/kconfig/nconf.c:511:51: warning: Using plain integer as NULL pointer
../scripts/kconfig/nconf.c:1460:6: warning: symbol 'setup_windows' was not declared. Should it be static?
../scripts/kconfig/nconf.c:274:12: warning: symbol 'current_instructions' was not declared. Should it be static?
../scripts/kconfig/nconf.c:308:22: warning: symbol 'function_keys' was not declared. Should it be static?
../scripts/kconfig/nconf.gui.c:132:17: warning: non-ANSI function declaration of function 'set_colors'
../scripts/kconfig/nconf.gui.c:195:24: warning: Using plain integer as NULL pointer

nconf.gui.o before/after files are the same.
nconf.o before/after files are the same until the 'static' function
declarations are added.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 0eb47346 27-Nov-2016 Cheah Kok Cheong <thrust73@gmail.com>

Scripts: kconfig: nconf: fix _GNU_SOURCE redefined warning

Fix below warning when make nconfig is run initially
or after make clean.

HOSTCC scripts/kconfig/nconf.o
scripts/kconfig/nconf.c:8:0: warning: "_GNU_SOURCE" redefined
#define _GNU_SOURCE
^
<command-line>:0:0: note: this is the location of the previous definition

Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.com>


# 0a1f00a1 08-Apr-2015 Michal Marek <mmarek@suse.cz>

kconfig: Do not print status messages in make -s mode

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>


# 7eb6e340 28-May-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kbuild: trivial - remove trailing empty lines

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>


# f6eb6e46 16-Jul-2013 Yann E. MORIN <yann.morin.1998@free.fr>

kconfig/[mn]conf: shorten title in search-box

No need to repeat the 'CONFIG_' string in the title,
once is explicit enough.

Reported-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Jean Delvare <jdelvare@suse.de>


# a1ce636f 24-Jun-2013 Yann E. MORIN <yann.morin.1998@free.fr>

kconfig/[mn]conf: make it explicit in the search box that a regexp is possible

Reported-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Jean Delvare <jdelvare@suse.de>
Cc: Michal Marek <mmarek@suse.cz>


# 1278ebdb 19-May-2013 Dirk Gouders <dirk@gouders.net>

mconf/nconf: mark empty menus/menuconfigs different from non-empty ones

Submenus are sometimes empty and it would be nice if there is
something that notifies us that we should not expect any content
_before_ we enter a submenu.

A new function menu_is_empty() was introduced and empty menus and
menuconfigs are now marked by "----" as opposed to non-empty ones that
are marked by "--->".

This scheme was suggested by "Yann E. MORIN" <yann.morin.1998@free.fr>.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>


# e0b42605 13-May-2013 Dirk Gouders <dirk@gouders.net>

nconf: use function calls instead of ncurses' variables LINES and COLS

According to the documentation [1], LINES and COLS are initialized by
initscr(); it does not say anything about the behavior when windows are
resized.

Do not rely on the current implementation of ncurses that updates
these variables on resize, but use the propper function calls or macros
to get window dimensions.

The use of the variables in main() was OK, but for the sake of
consistency it was modified to use the macro getmaxyx().

[1] ncurses(3X)

Signed-off-by: Dirk Gouders <dirk@gouders.net>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[yann.morin.1998@free.fr: declare 'lines' and 'columns' on a single line]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>


# 2c68115c 01-Feb-2013 Roland Eggner <edvx1@systemanalysen.net>

kconfig: nconf: rewrite labels of function keys line

>From: Roland Eggner <edvx1@systemanalysen.net>

More reasonable labels of function keys line. Rename labels and keep menu
width, as required for fitting on COLUMNS=80 terminals:
• s/Insts/Help 2/
• s/Config/ShowAll/

Signed-off-by: Roland Eggner <edvx1@systemanalysen.net>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>


# 0b616500 01-Feb-2013 Roland Eggner <edvx1@systemanalysen.net>

kconfig: nconf: rewrite help texts

>From: Roland Eggner <edvx1@systemanalysen.net>

Rewrite all help texts. During several years lazy (incomplete) updates have
left behind a rather thick layer of dust. Intentions:
(1) Global help called by <F1> should document all _currently_ implemented
keybindings.
(2) Different help texts called by <F3> resp. <F8><F1> should be consistent
with (1) and with implementation:
• on plain menu entry
• in radiolist window
• in input windows for text, decimal or hexadecimal values
• in filename selection windows <F6> <F7>
• SymSearch specific help called by <F8> followed by <F1>
(3) More reasonable window titles:
Rename window title s/README/Global help/
Rename variable s/nconf_readme/nconf_global_help/
Rename window title s/Instructions/Short help/
(4) Consider which hints are most useful for first-time-users.

Signed-off-by: Roland Eggner <edvx1@systemanalysen.net>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[yann.morin.1998@free.fr: a few additional fixes]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>


# 9a926d43 19-Oct-2012 Yann E. MORIN <yann.morin.1998@free.fr>

kconfig: get CONFIG_ prefix from the environment

Currently, the CONFIG_ prefix is hard-coded in the kconfig frontends
executables. This means that two projects that use kconfig with
different prefixes can not share the same kconfig frontends.

Instead of hard-coding the prefix in the frontends, get it from the
environment, and revert back to hard-coded value if not found.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 337a275d 19-Oct-2012 Yann E. MORIN <yann.morin.1998@free.fr>

kconfig: remove CONFIG_ from string constants

Having the CONFIG_ prefix in string constants gets in the way of
using a run-time-defined CONFIG_ prefix.

Fix that by using temp growable strings (gstr) in which we printf
the text.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 5e609add 23-Aug-2012 Benjamin Poirier <bpoirier@suse.de>

menuconfig: Add jump keys to search results

makes it possible to jump directly to the menu for a configuration entry after
having searched for it with '/'. If this menu is not currently accessible we
jump to the nearest accessible parent instead. After exiting this menu, the
user is returned to the search results where he may jump further in or
elsewhere.

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# d68e818b 24-Jul-2012 Benjamin Poirier <bpoirier@suse.de>

nconf: add u, d command keys in scroll windows

They function just like they do in less(1).
Also correct some discrepancy between the help text and the code wrt
function keys.

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# d7c67a2e 11-Jun-2012 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>

kconfig/nconf: fix compile with ncurses reentrant API

ESCDELAY is a global variable which is replaced by getter and setter
functions with NCURSES_REENTRANT. This fixes the following error:

nconf.c: In function ‘main’:
nconf.c:1506:2: error: lvalue required as left operand of assignment

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# bb8187d3 17-May-2012 Paul Gortmaker <paul.gortmaker@windriver.com>

MCA: delete all remaining traces of microchannel bus support.

Hardware with MCA bus is limited to 386 and 486 class machines
that are now 20+ years old and typically with less than 32MB
of memory. A quick search on the internet, and you see that
even the MCA hobbyist/enthusiast community has lost interest
in the early 2000 era and never really even moved ahead from
the 2.4 kernels to the 2.6 series.

This deletes anything remaining related to CONFIG_MCA from core
kernel code and from the x86 architecture. There is no point in
carrying this any further into the future.

One complication to watch for is inadvertently scooping up
stuff relating to machine check, since there is overlap in
the TLA name space (e.g. arch/x86/boot/mca.c).

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: James Bottomley <JBottomley@Parallels.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>


# 5ea9f64f 01-Sep-2011 Cheng Renquan <crquan@gmail.com>

scripts/kconfig/nconf: dynamically alloc dialog_input_result

To support unlimited length string config items;

No check for realloc return value keeps code simple, and to be
consistent with other existing unchecked malloc in kconfig.

Signed-off-by: Cheng Renquan <crquan@gmail.com>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>


# 4920e05c 03-Aug-2011 Arnaud Lacombe <lacombar@gmail.com>

kconfig/nconf: nuke unreferenced `nohelp_text'

After commit 5416857867c9cc94aba641898c567d9707de30f1, nohelp_text' is no
longer referenced, nuke it.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# a1e80655 10-Jul-2011 Arnaud Lacombe <lacombar@gmail.com>

kconfig/nconf: remove useless conditionnal

After the test

if (!submenu || ...)
continue;

the variable `submenu' can _not_ be NULL, so do not test for this
situation.

Cc: Nir Tzachar <nir.tzachar@gmail.com>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# f98ee769 10-Jul-2011 Arnaud Lacombe <lacombar@gmail.com>

kconfig/nconf: prevent segfault on empty menu

nconf does not check the validity of the current menu when help is
requested (with either <F2>, '?' or 'h'). This leads to a NULL pointer
dereference when an empty menu is encountered.

The following reduced testcase exposes the problem:

config DEP
bool

menu "FOO"

config BAR
bool "BAR"
depends on DEP

endmenu

Issue will happen when entering menu "FOO" and requesting help.

nconf is the only front-end which do not filter the validity of the
current menu. Such filter can not really happen beforehand as other key
which does not deals with the current menu might be entered by the user,
so just bails out earlier if we encounter an invalid menu.

Cc: Nir Tzachar <nir.tzachar@gmail.com>
Cc: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Reported-by: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 54168578 10-Jul-2011 Arnaud Lacombe <lacombar@gmail.com>

kconfig/nconf: use the generic menu_get_ext_help()

nconf is the only front-end which does not use this helper, but prefer
to copy/paste the code. The test wrt. menu validity added in this
version of the code is bogus anyway as an invalid menu will get
dereferenced a few line below by calling menu_get_prompt().

For now, convert nconf to use menu_get_ext_help(), as do every other
front-end. We will deals with menu validity checks properly in a
separate commit.

Cc: Nir Tzachar <nir.tzachar@gmail.com>
Cc: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# e9882ac0 09-Jul-2011 Raghavendra D Prabhu <rprabhu@wnohang.net>

nconfig: Avoid Wunused-but-set warning

I am seeing Wunused-but-set warning while make nconfig. Looks like
active_menu is not used. Removing it fixes the warning.

Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 5a6f8d2b 01-Jun-2011 Arnaud Lacombe <lacombar@gmail.com>

kconfig: nuke LKC_DIRECT_LINK cruft

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>


# 10175ba6 06-Apr-2011 Stephen Boyd <sboyd@codeaurora.org>

nconfig: Silence unused return values from wattrset

Ignore the return value from wattrset since we ignore the return
value in nconf.gui.c as well.

scripts/kconfig/nconf.c: In function 'print_function_line':
scripts/kconfig/nconf.c:376: warning: value computed is not used
scripts/kconfig/nconf.c:380: warning: value computed is not used
scripts/kconfig/nconf.c:387: warning: value computed is not used
scripts/kconfig/nconf.c: In function 'show_menu':
scripts/kconfig/nconf.c:956: warning: value computed is not used
scripts/kconfig/nconf.c:961: warning: value computed is not used
scripts/kconfig/nconf.c:963: warning: value computed is not used
scripts/kconfig/nconf.c:965: warning: value computed is not used

Cc: Nir Tzachar <nir.tzachar@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 39177ec3 06-Jan-2011 Peter Korsgaard <jacmet@sunsite.dk>

nconf: handle comment entries within choice/endchoice

Equivalent to af6c1598 (kconfig: handle comment entries within
choice/endchoice), but for nconfig instead.

Implement support for comment entries within choice groups. Comment entries
are displayed visually distinct from normal configs, and selecting them is
a no-op.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# fe04ce0b 04-Dec-2010 Arnaud Lacombe <lacombar@gmail.com>

kbuild/nconf: fix spaces damage

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 0954828f 17-Aug-2010 Arnaud Lacombe <lacombar@gmail.com>

kconfig: replace KERNELVERSION usage by the mainmenu's prompt

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>


# 652cf982 14-Aug-2010 Arnaud Lacombe <lacombar@gmail.com>

kconfig: rephrase help texts/comments not to include the package name

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>


# ffb5957b 14-Aug-2010 Arnaud Lacombe <lacombar@gmail.com>

kconfig: allow build-time definition of the internal config prefix

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>


# 59dfa24d 20-Aug-2010 Arnaud Lacombe <lacombar@gmail.com>

kconfig: rephrase help text not to mention the internal prefix

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>


# aee08ed4 10-Sep-2010 Stephen Boyd <bebarino@gmail.com>

nconfig: Fix help for choice menus

When getting the help for a choice menu with a help section (for example
the "Choose SLAB allocator" menu) nconfig pops up a window with nothing
inside it. This is due to show_help() passing an empty string to
show_scroll_win()'s 3rd argument. The option really does have help
though, but it isn't a config symbol, so just add the help text for
the option, and don't try to add anything else like the config option
name.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Acked-by: Nir Tzachar <nir.tzachar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 42368c37 17-Aug-2010 Michal Marek <mmarek@suse.cz>

kconfig: Allow frontends to display messages themselves

Signed-off-by: Michal Marek <mmarek@suse.cz>


# a72f3e2b 08-Aug-2010 Nir Tzachar <nir.tzachar@gmail.com>

nconfig: add search support

Remove the old hotkeys feature, and replace it by an interactive string
search.
From nconfig help:

Searching: pressing '/' triggers interactive search mode.
nconfig performs a case insensitive search for the string
in the menu prompts (no regex support).
Pressing the up/down keys highlights the previous/next
matching item. Backspace removes one character from the
match string. Pressing either '/' again or ESC exits
search mode. All other keys behave normally.

Miscellaneous other changes (including Rundy's and Justin's input).

Signed-off-by: Nir Tzachar <nir.tzachar@gmail.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 866af407 02-Aug-2010 Andrej Gelenberg <andrej.gelenberg@udo.edu>

nconfig: Fix segfault when menu is empty

nconf crush with segfault if press right arrow in empty menu.

Signed-off-by: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 68c16edd 12-Jan-2010 Nir Tzachar <nir.tzachar@gmail.com>

nconfig: minor fix

This patch fixes two problems reported by Jan Engelhardt:
1) Border is now properly placed, to always be visible
2) Long menu items are properly displayed

Reported-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Nir Tzachar <nir.tzachar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 851190c9 07-Jan-2010 Michal Marek <mmarek@suse.cz>

nconfig: mark local functions as such

scripts/kconfig/nconf.gui.c:23: warning: no previous prototype for 'set_normal_colors'
scripts/kconfig/nconf.gui.c:68: warning: no previous prototype for 'normal_color_theme'
scripts/kconfig/nconf.gui.c:100: warning: no previous prototype for 'no_colors_theme'
scripts/kconfig/nconf.c:455: warning: no previous prototype for 'process_special_keys'
scripts/kconfig/nconf.c:487: warning: no previous prototype for 'get_next_hot'
scripts/kconfig/nconf.c:506: warning: no previous prototype for 'canbhot'
scripts/kconfig/nconf.c:514: warning: no previous prototype for 'is_hot'
scripts/kconfig/nconf.c:522: warning: no previous prototype for 'make_hot'
scripts/kconfig/nconf.c:582: warning: no previous prototype for 'item_make'
scripts/kconfig/nconf.c:626: warning: no previous prototype for 'item_add_str'
scripts/kconfig/nconf.c:656: warning: no previous prototype for 'item_tag'
scripts/kconfig/nconf.c:668: warning: no previous prototype for 'curses_item_index'
scripts/kconfig/nconf.c:673: warning: no previous prototype for 'item_data'
scripts/kconfig/nconf.c:684: warning: no previous prototype for 'item_is_tag'
scripts/kconfig/nconf.c:691: warning: no previous prototype for 'set_config_filename'

Signed-off-by: Michal Marek <mmarek@suse.cz>


# 692d97c3 24-Nov-2009 nir.tzachar@gmail.com <nir.tzachar@gmail.com>

kconfig: new configuration interface (nconfig)

This patch was inspired by the kernel projects page, where an ncurses
replacement for menuconfig was mentioned (by Sam Ravnborg).

Building on menuconfig, this patch implements a more modern look
interface using ncurses and ncurses' satellite libraries (menu, panel,
form). The implementation does not depend on lxdialog, which is
currently distributed with the kernel.

Signed-off-by: Nir Tzachar <nir.tzachar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>