kconfig: list unknown symbols in the old .config
Hi,
We recently were hit (unnecessarily hard) when after kernel uprev we figured that something wasn't working. The root cause was a rename of the CONFIG_FOO option between kernel releases, which make oldconfig doesn't warn/notify about.
Would it be possible to add either a new --listunknown mode to conf or to somehow make it conf_warning("unknown symbol: %s\n", line) when it reads a line from oldconf that it cannot sym_find()?
That would save a ton of time.
Quoted 7 lines · Sergey Senozhatsky
Hi,
We recently were hit (unnecessarily hard) when after kernel uprev we figured that something wasn't working. The root cause was a rename of the
CONFIG_FOOoption between kernel releases, which make oldconfig doesn't warn/notify about.
Quoted 5 lines
Would it be possible to add either a new --listunknown mode to conf or to somehow make it
conf_warning("unknown symbol: %s\n", line)when it reads a line from oldconf that it cannotsym_find()?That would save a ton of time.
So I have this simple (quick-n-dirty) patch, that seem to be doing the trick. Just to show the idea.
Running make listunknown produces the following (on a hand-crafted .config):
.config:6:warning: unknown symbol: CONFIG_DISABLE_BUGS .config:7:warning: unknown symbol: CONFIG_COMPILE_GOOD_CODE_ONLY make[2]: *** [scripts/kconfig/Makefile:77: listunknown] Error 1
...
---
scripts/kconfig/conf.c +9 -0
@@ -36,6 +36,7 @@ enum input_mode { yes2modconfig, mod2yesconfig, mod2noconfig, + listunknown, };static enum input_mode input_mode = oldaskconfig;static int input_mode_opt;
@@ -683,6 +684,7 @@ static const struct option long_opts[] = { {"yes2modconfig", no_argument, &input_mode_opt, yes2modconfig}, {"mod2yesconfig", no_argument, &input_mode_opt, mod2yesconfig}, {"mod2noconfig", no_argument, &input_mode_opt, mod2noconfig}, + {"listunknown", no_argument, &input_mode_opt, listunknown}, {NULL, 0, NULL, 0} };
@@ -712,6 +714,7 @@ static void conf_usage(const char *progname)printf (" --yes2modconfig Change answers from yes to mod if possible\n" );printf (" --mod2yesconfig Change answers from mod to yes if possible\n" );printf (" --mod2noconfig Change answers from mod to no if possible\n" ); +printf (" --listunknown List symbols that are not recognized anymore\n" );printf (" (If none of the above is given, --oldaskconfig is the default)\n" ); }
@@ -823,6 +826,12 @@ int main(int ac, char **av)exit (1 ); }break ; +case listunknown: +if (conf_read_listunknown ()) +exit (1 ); +else +exit (0 ); +break ;default :break ; }
scripts/kconfig/confdata.c +89 -40
153 lines not on this page · raw message
scripts/kconfig/lkc_proto.h +1 -0
@@ -5,6 +5,7 @@void conf_parse (const char *name);int conf_read (const char *name);int conf_read_simple (const char *name,int ); +int conf_read_listunknown (void );int conf_write_defconfig (const char *name);int conf_write (const char *name);int conf_write_autoconf (int overwrite);
Quoted 11 lines · Sergey Senozhatsky
Hi,
We recently were hit (unnecessarily hard) when after kernel uprev we figured that something wasn't working. The root cause was a rename of the
CONFIG_FOOoption between kernel releases, which make oldconfig doesn't warn/notify about.Would it be possible to add either a new --listunknown mode to conf or to somehow make it
conf_warning("unknown symbol: %s\n", line)when it reads a line from oldconf that it cannotsym_find()?
This makes sense and I brought up this scenario a couple of days ago on a recent patch.
I can make a patch for this if needed.
Thanks,
Jesse Taube
Quoted 2 lines
That would save a ton of time.
Quoted 5 lines · Jesse T
Quoted 5 lines
We recently were hit (unnecessarily hard) when after kernel uprev we figured that something wasn't working. The root cause was a rename of the
CONFIG_FOOoption between kernel releases, which make oldconfig doesn't warn/notify about.
Quoted 7 lines
Quoted 3 lines
Would it be possible to add either a new --listunknown mode to conf or to somehow make it
conf_warning("unknown symbol: %s\n", line)when it reads a line from oldconf that it cannotsym_find()?This makes sense and I brought up this scenario a couple of days ago on a recent patch.
I can make a patch for this if needed.
I posted an RFC patch a couple of days ago
https://lore.kernel.org/all/[email protected]/T/#u