[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK7LNASAvkNTwTfVZm29Q=oGGc3-oHwW4FSm=8NSROp5V1A-tw@mail.gmail.com>
Date: Thu, 13 Jul 2023 00:35:36 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Randy Dunlap <rdunlap@...radead.org>
Cc: linux-kernel@...r.kernel.org, linux-kbuild@...r.kernel.org
Subject: Re: [PATCH] kconfig: tell the kconfig symbol of the restart reason
On Tue, Jul 4, 2023 at 2:52 PM Randy Dunlap <rdunlap@...radead.org> wrote:
>
> When running 'make oldconfig' or 'make olddefconfig' without waiting
olddefconfig is not interactive in the first place.
'make config', 'make oldconfig', 'make syncconfig' are affected.
> for prompts, it can be useful to know the restart reason so that it
> can be fixed manually.
>
> This is usually when the prompt value is a number or a string,
> i.e., something other than y/m/n.
I do not understand what you mean.
Please give me some examples to see why this is useful.
BTW, "due to symbol ..." is not the reason for the restart.
It shows the first CONFIG option shown after the restart.
>
> Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
> Cc: Masahiro Yamada <masahiroy@...nel.org>
> Cc: linux-kbuild@...r.kernel.org
> ---
> Can the test for sym->name be omitted?
Not all symbols have a name.
For example, 'choice' may not have a name.
[test code]
choice
prompt "A or B"
depends on FOO
config A
bool "A"
config B
bool "B"
endchoice
config FOO
bool "foo"
If you omit, sym->name test,
"due to symbol: (null)" will be displayed.
Not a crash, but users will be misguided.
foo (FOO) [N/y/?] (NEW) y
*
* Restart config...
* due to symbol: (null)
*
*
* Linux/x86 6.5.0-rc1 Kernel Configuration
*
A or B
> 1. A (A) (NEW)
2. B (B) (NEW)
> scripts/kconfig/conf.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff -- a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
> --- a/scripts/kconfig/conf.c
> +++ b/scripts/kconfig/conf.c
> @@ -652,8 +652,12 @@ static void check_conf(struct menu *menu
> printf("-----\n");
> break;
> default:
> - if (!conf_cnt++)
> - printf("*\n* Restart config...\n*\n");
> + if (!conf_cnt++) {
> + printf("*\n* Restart config...\n");
> + if (sym->name)
> + printf("* due to symbol: %s\n", sym->name);
> + printf("*\n");
> + }
> rootEntry = menu_get_parent_menu(menu);
> conf(rootEntry);
> break;
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists