kbuild configuration system improvements
cover kbuild configuration system improvements
From: Cheng Renquan <[email protected]>
These patches improve usability of kernel configuration system,
1. add symbol's value shown accompanied in config item's help message;
2. move the real plumbing functions code from mconf.c to menu.c, make them be able to be shared with other configuration methods;
3. add "symbol's value shown" support for gconfig/xconfig/config;
0001-add-symbol-value-to-help-find-the-real-depend.patch
0002-add-menu_get_ext_help-function-to-display-more-infor.patch
0003-menuconfig-improvements.patch
0004-make-use-of-menu_get_ext_help-in-gconfig.patch
0005-make-use-of-menu_get_ext_help-in-qconfig.patch
0006-make-use-of-menu_get_ext_help-in-make-config.patch--
Cheng Renquan
PATCH 1/6 add symbol value to help find the real depend
From: Cheng Renquan <[email protected]>
kbuild-menuconfig-display-depend-value.patch
Sometimes when configuring need to disable some unused item, but the item is selected by many other items, it's hard to find the real dependency which selected it, This patch add every symbol's value accompanied to make it possible to find the real dependency easily.
An example is CONFIG_RFKILL,
---------------------- RF switch subsystem support ----------------------
| CONFIG_RFKILL: | | | | Say Y here if you want to have control over RF switches | | found on many WiFi and Bluetooth cards. | | | | To compile this driver as a module, choose M here: the | | module will be called rfkill. | | | | Symbol: RFKILL [=m] | | Prompt: RF switch subsystem support | | Defined at net/rfkill/Kconfig:4 | | Depends on: NET [=y] | | Location: | | -> Networking support (NET [=y]) | | Selected by: IWLCORE [=n] && NETDEVICES [=y] && !S390 [=S390] && PC | | |
----------------------------------------------------------------( 99%)---
--- scripts/kconfig/expr.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
scripts/kconfig/expr.c +2 -0
@@ -1098,6 +1098,8 @@ void expr_fprint(struct expr *e, FILE *out)static void expr_print_gstr_helper (void *data,struct symbol *sym,const char *str) {str_append ((struct gstr *)data, str); +if (sym) +str_printf ((struct gstr *)data," [=%s]" ,sym_get_string_value (sym)); }void expr_gstr_print (struct expr *e,struct gstr *gs)
Signature · 1 line
1.6.3.3
PATCH 2/6 add menu_get_ext_help function to display more information
From: Cheng Renquan <[email protected]>
The three functions are moved from mconf.c, then they can be shared in all menuconfig & gconfig & xconfig & config.
+void menu_get_ext_help(struct menu *menu, struct gstr *help) +static void get_prompt_str(struct gstr *r, struct property *prop) +void get_symbol_str(struct gstr *r, struct symbol *sym)
--- scripts/kconfig/lkc_proto.h | 2 + scripts/kconfig/menu.c | 79 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 0 deletions(-)
scripts/kconfig/lkc_proto.h +2 -0
@@ -17,6 +17,8 @@ P(menu_get_root_menu,struct menu *,(struct menu *menu)); P(menu_get_parent_menu,struct menu *,(struct menu *menu)); P(menu_has_help,bool,(struct menu *menu)); P(menu_get_help,const char *,(struct menu *menu)); +P(get_symbol_str,void,(struct gstr *r, struct symbol *sym)); +P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help));/* symbol.c */ P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]);
scripts/kconfig/menu.c +79 -0
88 lines not on this page · raw message
Signature · 1 line
1.6.3.3
PATCH 3/6 menuconfig improvements
From: Cheng Renquan <[email protected]>
The removed functions are moved into menu.c for sharing with gconfig & xconfig & config.
--- scripts/kconfig/mconf.c | 78 ++--------------------------------------------- 1 files changed, 3 insertions(+), 75 deletions(-)
scripts/kconfig/mconf.c +3 -75
@@ -199,8 +199,6 @@ inputbox_instructions_string[] = N_( setmod_text[] = N_("This feature depends on another which has been configured as a module.\n" "As a result, this feature will be built as a module." ), -nohelp_text[] = N_( -"There is no help available for this kernel option.\n" ), load_config_text[] = N_("Enter the name of the configuration file you wish to load. " "Accept the name shown to restore the configuration you "
@@ -284,66 +282,6 @@ static void show_textbox(const char *title, const char *text, int r, int c);static void show_helptext (const char *title,const char *text);static void show_help (struct menu *menu); -static void get_prompt_str (struct gstr *r,struct property *prop) -{ -int i, j; -struct menu *submenu[8 ], *menu; - -str_printf (r,_ ("Prompt: %s\n" ),_ (prop->text)); -str_printf (r,_ (" Defined at %s:%d\n" ), prop->menu->file->name, - prop->menu->lineno); -if (!expr_is_yes (prop->visible.expr)) { -str_append (r,_ (" Depends on: " )); -expr_gstr_print (prop->visible.expr, r); -str_append (r,"\n" ); - } - menu = prop->menu->parent; -for (i =0 ; menu != &rootmenu && i <8 ; menu = menu->parent) - submenu[i++] = menu; -if (i >0 ) { -str_printf (r,_ (" Location:\n" )); -for (j =4 ; --i >=0 ; j +=2 ) { - menu = submenu[i]; -str_printf (r,"%*c-> %s" , j,' ' ,_ (menu_get_prompt (menu))); -if (menu->sym) { -str_printf (r," (%s [=%s])" , menu->sym->name ? - menu->sym->name :_ ("<choice>" ), -sym_get_string_value (menu->sym)); - } -str_append (r,"\n" ); - } - } -} - -static void get_symbol_str (struct gstr *r,struct symbol *sym) -{ -bool hit; -struct property *prop; - -if (sym && sym->name) -str_printf (r,"Symbol: %s [=%s]\n" , sym->name, -sym_get_string_value (sym)); - for_all_prompts(sym, prop) -get_prompt_str (r, prop); - hit = false; - for_all_properties(sym, prop, P_SELECT) { -if (!hit) { -str_append (r," Selects: " ); - hit = true; - }else -str_printf (r," && " ); -expr_gstr_print (prop->expr, r); - } -if (hit) -str_append (r,"\n" ); -if (sym->rev_dep.expr) { -str_append (r,_ (" Selected by: " )); -expr_gstr_print (sym->rev_dep.expr, r); -str_append (r,"\n" ); - } -str_append (r,"\n\n" ); -} -static struct gstr get_relations_str (struct symbol **sym_arr) {struct symbol *sym;
@@ -699,19 +637,9 @@ static void show_helptext(const char *title, const char *text)static void show_help (struct menu *menu) {struct gstr help =str_new (); -struct symbol *sym = menu->sym; - -if (menu_has_help (menu)) - { -if (sym->name) { -str_printf (&help,"CONFIG_%s:\n\n" , sym->name); -str_append (&help,_ (menu_get_help (menu))); -str_append (&help,"\n" ); - } - }else { -str_append (&help, nohelp_text); - } -get_symbol_str (&help, sym); + +menu_get_ext_help (menu, &help); +show_helptext (_ (menu_get_prompt (menu)),str_get (&help));str_free (&help); }
Signature · 1 line
1.6.3.3
PATCH 4/6 make use of menu_get_ext_help in gconfig
From: Cheng Renquan <[email protected]>
Futhermore, gconfig interface lack the "search a symbol" function, do later.
--- scripts/kconfig/gconf.c | 21 ++++----------------- 1 files changed, 4 insertions(+), 17 deletions(-)
scripts/kconfig/gconf.c +4 -17
@@ -456,19 +456,9 @@ static void text_insert_help(struct menu *menu)GtkTextBuffer *buffer;GtkTextIter start, end;const char *prompt =_ (menu_get_prompt (menu)); -gchar *name; -const char *help; +struct gstr help =str_new (); - help =menu_get_help (menu); - -/* Gettextize if the help text not empty */ -if ((help !=0 ) && (help[0 ] !=0 )) - help =_ (help); - -if (menu->sym && menu->sym->name) - name =g_strdup_printf (menu->sym->name); -else - name =g_strdup ("" ); +menu_get_ext_help (menu, &help); buffer =gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_w));gtk_text_buffer_get_bounds (buffer, &start, &end);
@@ -478,14 +468,11 @@ static void text_insert_help(struct menu *menu)gtk_text_buffer_get_end_iter (buffer, &end);gtk_text_buffer_insert_with_tags (buffer, &end, prompt,-1 , tag1,NULL ); -gtk_text_buffer_insert_at_cursor (buffer," " ,1 ); -gtk_text_buffer_get_end_iter (buffer, &end); -gtk_text_buffer_insert_with_tags (buffer, &end, name,-1 , tag1, -NULL );gtk_text_buffer_insert_at_cursor (buffer,"\n\n" ,2 );gtk_text_buffer_get_end_iter (buffer, &end); -gtk_text_buffer_insert_with_tags (buffer, &end, help,-1 , tag2, +gtk_text_buffer_insert_with_tags (buffer, &end,str_get (&help),-1 , tag2,NULL ); +str_free (&help); }
Signature · 1 line
1.6.3.3
PATCH 5/6 make use of menu_get_ext_help in qconfig
From: Cheng Renquan <[email protected]>
--- scripts/kconfig/qconf.cc | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-)
scripts/kconfig/qconf.cc +4 -6
@@ -1042,12 +1042,10 @@ void ConfigInfoView::menuInfo(void) if (showDebug()) debug = debug_info(sym); - help = menu_get_help(menu); - /* Gettextize if the help text not empty */ - if (help.isEmpty()) - help = print_filter(menu_get_help(menu)); - else - help = print_filter(_(menu_get_help(menu))); + struct gstr help_gstr = str_new(); + menu_get_ext_help(menu, &help_gstr); + help = print_filter(str_get(&help_gstr)); + str_free(&help_gstr); } else if (menu->prompt) { head += "<big><b>"; head += print_filter(_(menu->prompt->text));
Signature · 1 line
1.6.3.3
PATCH 6/6 make use of menu_get_ext_help in "make config"
From: Cheng Renquan <[email protected]>
--- scripts/kconfig/conf.c | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-)
scripts/kconfig/conf.c +11 -11
@@ -38,14 +38,14 @@ static int conf_cnt;static char line[128 ];static struct menu *rootEntry; -static char nohelp_text[] =N_ ("Sorry, no help available for this option yet.\n" ); - -static const char *get_help (struct menu *menu) +static void print_help (struct menu *menu) { -if (menu_has_help (menu)) -return _ (menu_get_help (menu)); -else -return nohelp_text; +struct gstr help =str_new (); + +menu_get_ext_help (menu, &help); + +printf ("\n%s\n" ,str_get (&help)); +str_free (&help); }static void strip (char *str)
@@ -140,7 +140,7 @@ int conf_string(struct menu *menu)case '?' :/* print help */ if (line[1 ] =='\n' ) { -printf ("\n%s\n" ,get_help (menu)); +print_help (menu); def =NULL ;break ; }
@@ -220,7 +220,7 @@ static int conf_sym(struct menu *menu)if (sym_set_tristate_value (sym, newval))return 0 ; help: -printf ("\n%s\n" ,get_help (menu)); +print_help (menu); } }
@@ -307,7 +307,7 @@ static int conf_choice(struct menu *menu)fgets (line,128 , stdin);strip (line);if (line[0 ] =='?' ) { -printf ("\n%s\n" ,get_help (menu)); +print_help (menu);continue ; }if (!line[0 ])
@@ -331,7 +331,7 @@ static int conf_choice(struct menu *menu)if (!child)continue ;if (line[strlen (line) -1 ] =='?' ) { -printf ("\n%s\n" ,get_help (child)); +print_help (child);continue ; }sym_set_choice_value (sym, child->sym);
Signature · 1 line
1.6.3.3
Re: [PATCH 1/6] add symbol value to help find the real depend
In reply to Cheng RenquanQuoted 28 lines · Cheng Renquan
From: Cheng Renquan <[email protected]>
kbuild-menuconfig-display-depend-value.patch
Sometimes when configuring need to disable some unused item, but the item is selected by many other items, it's hard to find the real dependency which selected it, This patch add every symbol's value accompanied to make it possible to find the real dependency easily.
An example is
CONFIG_RFKILL,---------------------- RF switch subsystem support ----------------------
| CONFIG_RFKILL: | | | | Say Y here if you want to have control over RF switches | | found on many WiFi and Bluetooth cards. | | | | To compile this driver as a module, choose M here: the | | module will be called rfkill. | | | | Symbol: RFKILL [=m] | | Prompt: RF switch subsystem support | | Defined at net/rfkill/Kconfig:4 | | Depends on: NET [=y] | | Location: | | -> Networking support (NET [=y]) | | Selected by: IWLCORE [=n] && NETDEVICES [=y] && !S390 [=S390] && PC | | |
Quoted 1 line
----------------------------------------------------------------( 99%)---
I like this concept, but I'd like to see it supported with make oldconfig. Let's say I copy a .config from kernel X into kernel Y (Y>X) and make oldconfig. Sometimes the new kernel will enable some previously disabled option, and it would be very useful to see WHY.
To take a concrete example, in my 2.6.30 .config I had:
CONFIG_DRM=mCONFIG_DRM_RADEON=m
# CONFIG_FB is not set
which when oldconfig'd in 2.6.31-rc changed to
CONFIG_DRM=mCONFIG_DRM_RADEON=mCONFIG_FB=m
(+ some more FB stuff)
In this case it would have been nice to get an explanation that DRM_RADEON was responsible for (wrongly, IMO) selecting FB. Something like
# CONFIG_FB was selected by CONFIG_DRM_RADEONCONFIG_FB=m
These comments should only be emitted for options added by select that previously were absent or 'is not set'.
/Mikael
Re: [PATCH 1/6] add symbol value to help find the real depend
On Sun, Jul 12, 2009 at 10:00 AM, Mikael Pettersson<[email protected]> wrote:
[...]
Quoted 1 line
I like this concept, but I'd like to see it supported with make oldconfig.
'make oldconfig' uses the same 'scripts/kconfig/conf' program as the 'make config' does, which is supported already in this series of patches,
Quoted 17 lines
Let's say I copy a .config from kernel X into kernel Y (Y>X) and make oldconfig. Sometimes the new kernel will enable some previously disabled option, and it would be very useful to see WHY.
To take a concrete example, in my 2.6.30 .config I had:
CONFIG_DRM=mCONFIG_DRM_RADEON=m
#CONFIG_FBis not setwhich when oldconfig'd in 2.6.31-rc changed to
CONFIG_DRM=mCONFIG_DRM_RADEON=mCONFIG_FB=m
(+ some more FB stuff)
Quoted 8 lines
In this case it would have been nice to get an explanation that
DRM_RADEONwas responsible for (wrongly, IMO) selecting FB. Something like#
CONFIG_FBwas selected byCONFIG_DRM_RADEONCONFIG_FB=mThese comments should only be emitted for options added by select that previously were absent or 'is not set'.
The conf system is not so smart to find the recent changes (you may try scripts/diffconfig to diff two .config),
Anyway, if you don't like CONFIG_FB and have no idea why it is selected, you can navigate to CONFIG_FB in menuconfig/gconfig/xconfig/config, and find out the real dependency reason from its help message,
Quoted 3 lines
/Mikael
--
Cheng Renquan (程任全), from Shenzhen, China
Quoted 9 lines · Cheng Renquan
From: Cheng Renquan <[email protected]>
These patches improve usability of kernel configuration system,
1. add symbol's value shown accompanied in config item's help message;
2. move the real plumbing functions code frommconf.ctomenu.c, make them be able to be shared with other configuration methods;
3. add "symbol's value shown" support for gconfig/xconfig/config;
Quoted 6 lines
0001-add-symbol-value-to-help-find-the-real-depend.patch
0002-add-menu_get_ext_help-function-to-display-more-infor.patch
0003-menuconfig-improvements.patch
0004-make-use-of-menu_get_ext_help-in-gconfig.patch
0005-make-use-of-menu_get_ext_help-in-qconfig.patch
0006-make-use-of-menu_get_ext_help-in-make-config.patchI fixed them all up to:
1) include "kconfig:" prefix in subject
2) cc: of Roman Zippel which is kconfig maintainer
There were a few checkpatch issues that I decided to ignore for now.
Please always cc: Roman on kconfig patches as he is the mintainer.
Applied to kbuild-next.git.
Thanks,
Sam
Quoted 4 lines · Sam Ravnborg
I fixed them all up to:
1) include "kconfig:" prefix in subject
2) cc: of Roman Zippel which is kconfig maintainer
Quoted 8 lines
There were a few checkpatch issues that I decided to ignore for now.
Please always cc: Roman on kconfig patches as he is the mintainer.
Applied to kbuild-next.git.
Thanks,
Sam
Sorry, I just mixed up kbuild and kconfig, now I know it and will keep that in mind in later developement, thank you,
--
Cheng Renquan, Shenzhen, China
Quoted 21 lines · On Sat, 18 Jul 2009 09:21:38 +0200 Sam Ravnborg wrote:
Quoted 9 lines · Cheng Renquan
From: Cheng Renquan <[email protected]>
These patches improve usability of kernel configuration system,
1. add symbol's value shown accompanied in config item's help message;
2. move the real plumbing functions code frommconf.ctomenu.c, make them be able to be shared with other configuration methods;
3. add "symbol's value shown" support for gconfig/xconfig/config;Quoted 6 lines
0001-add-symbol-value-to-help-find-the-real-depend.patch 0002-add-menu_get_ext_help-function-to-display-more-infor.patch 0003-menuconfig-improvements.patch 0004-make-use-of-menu_get_ext_help-in-gconfig.patch 0005-make-use-of-menu_get_ext_help-in-qconfig.patch 0006-make-use-of-menu_get_ext_help-in-make-config.patchI fixed them all up to:
1) include "kconfig:" prefix in subject
2) cc: of Roman Zippel which is kconfig maintainer
Quoted 5 lines
There were a few checkpatch issues that I decided to ignore for now.
Please always cc: Roman on kconfig patches as he is the mintainer.
Applied to kbuild-next.git.
FWIW, I still get a segfault in gconfig (as I reported several months ago). I suppose that if it's a real issue, someone else will also see this.
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/
Quoted 25 lines · Randy Dunlap
Quoted 23 lines · On Sat, 18 Jul 2009 09:21:38 +0200 Sam Ravnborg wrote:
Quoted 9 lines · Cheng Renquan
From: Cheng Renquan <[email protected]>
These patches improve usability of kernel configuration system,
1. add symbol's value shown accompanied in config item's help message;
2. move the real plumbing functions code frommconf.ctomenu.c, make them be able to be shared with other configuration methods;
3. add "symbol's value shown" support for gconfig/xconfig/config;Quoted 6 lines
0001-add-symbol-value-to-help-find-the-real-depend.patch 0002-add-menu_get_ext_help-function-to-display-more-infor.patch 0003-menuconfig-improvements.patch 0004-make-use-of-menu_get_ext_help-in-gconfig.patch 0005-make-use-of-menu_get_ext_help-in-qconfig.patch 0006-make-use-of-menu_get_ext_help-in-make-config.patchI fixed them all up to:
1) include "kconfig:" prefix in subject
2) cc: of Roman Zippel which is kconfig maintainerThere were a few checkpatch issues that I decided to ignore for now.
Quoted 7 lines
Quoted 3 lines
Please always cc: Roman on kconfig patches as he is the mintainer.
Applied to kbuild-next.git.
FWIW, I still get a segfault in gconfig (as I reported several months ago). I suppose that if it's a real issue, someone else will also see this.
I assumed it was fixed - the changelog patches did not mention any outstanding issues.
Following fix is needed.
Sam
scripts/kconfig/menu.c +2 -1
@@ -528,5 +528,6 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help) }else {str_append (help, nohelp_text); } -get_symbol_str (help, sym); +if (sym) +get_symbol_str (help, sym); }
Quoted 6 lines
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/
Quoted 31 lines · On Wed, 22 Jul 2009 23:48:42 +0200 Sam Ravnborg wrote:
Quoted 30 lines · Randy Dunlap
Quoted 26 lines · On Sat, 18 Jul 2009 09:21:38 +0200 Sam Ravnborg wrote:
Quoted 9 lines · Cheng Renquan
From: Cheng Renquan <[email protected]>
These patches improve usability of kernel configuration system,
1. add symbol's value shown accompanied in config item's help message;
2. move the real plumbing functions code frommconf.ctomenu.c, make them be able to be shared with other configuration methods;
3. add "symbol's value shown" support for gconfig/xconfig/config;Quoted 6 lines
0001-add-symbol-value-to-help-find-the-real-depend.patch 0002-add-menu_get_ext_help-function-to-display-more-infor.patch 0003-menuconfig-improvements.patch 0004-make-use-of-menu_get_ext_help-in-gconfig.patch 0005-make-use-of-menu_get_ext_help-in-qconfig.patch 0006-make-use-of-menu_get_ext_help-in-make-config.patchI fixed them all up to:
1) include "kconfig:" prefix in subject
2) cc: of Roman Zippel which is kconfig maintainerThere were a few checkpatch issues that I decided to ignore for now.
Please always cc: Roman on kconfig patches as he is the mintainer.
Applied to kbuild-next.git.
Quoted 7 lines
Quoted 2 lines
FWIW, I still get a segfault in gconfig (as I reported several months ago). I suppose that if it's a real issue, someone else will also see this.
I assumed it was fixed - the changelog patches did not mention any outstanding issues.
Following fix is needed.
Ack, that works. Thanks.
Quoted 19 lines
Sam
scripts/kconfig/menu.c +2
-1@@ -528,5 +528,6 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help) }else {str_append (help, nohelp_text); } -get_symbol_str (help, sym); +if (sym) +get_symbol_str (help, sym); }Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/