From 40aee729b350672c2550640622416a855e27938f Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Sun, 9 Apr 2006 17:26:39 +0200 Subject: kconfig: fix default value for choice input The wrong default value can cause conf to end up in endless loop for choice questions. Signed-off-by: Roman Zippel Signed-off-by: Sam Ravnborg --- scripts/kconfig/conf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 10eeae53d827..b86c64f90c94 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -328,8 +328,7 @@ static int conf_choice(struct menu *menu) printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu)); def_sym = sym_get_choice_value(sym); cnt = def = 0; - line[0] = '0'; - line[1] = 0; + line[0] = 0; for (child = menu->list; child; child = child->next) { if (!menu_is_visible(child)) continue; -- cgit v1.2.3-59-g8ed1b From 59c6a3f4d745584f2f78cdf1f5e221a19518926c Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Sun, 9 Apr 2006 17:26:50 +0200 Subject: kconfig: revert conf behaviour change After the last patch fixed the real problem, revert this needless behaviour change of conf, which only hid the real problem. Signed-off-by: Roman Zippel Signed-off-by: Sam Ravnborg --- scripts/kconfig/conf.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index b86c64f90c94..ae5ab981bb1d 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -63,20 +63,6 @@ static void check_stdin(void) } } -static char *fgets_check_stream(char *s, int size, FILE *stream) -{ - char *ret = fgets(s, size, stream); - - if (ret == NULL && feof(stream)) { - printf(_("aborted!\n\n")); - printf(_("Console input is closed. ")); - printf(_("Run 'make oldconfig' to update configuration.\n\n")); - exit(1); - } - - return ret; -} - static void conf_askvalue(struct symbol *sym, const char *def) { enum symbol_type type = sym_get_type(sym); @@ -114,7 +100,7 @@ static void conf_askvalue(struct symbol *sym, const char *def) check_stdin(); case ask_all: fflush(stdout); - fgets_check_stream(line, 128, stdin); + fgets(line, 128, stdin); return; case set_default: printf("%s\n", def); @@ -369,7 +355,7 @@ static int conf_choice(struct menu *menu) check_stdin(); case ask_all: fflush(stdout); - fgets_check_stream(line, 128, stdin); + fgets(line, 128, stdin); strip(line); if (line[0] == '?') { printf("\n%s\n", menu->sym->help ? -- cgit v1.2.3-59-g8ed1b From 94f2505be3b6afaf50129e949b1840bc4dd0b3e8 Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Sun, 9 Apr 2006 17:27:14 +0200 Subject: kconfig: recenter menuconfig Move the menuconfig output more into the centre again, it's using a fixed position depending on the window width using the fact that the menu output has to work in a 80 chars terminal. Signed-off-by: Roman Zippel Signed-off-by: Sam Ravnborg --- scripts/kconfig/lxdialog/menubox.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c index 09512b544375..bf8052f4fd4a 100644 --- a/scripts/kconfig/lxdialog/menubox.c +++ b/scripts/kconfig/lxdialog/menubox.c @@ -58,8 +58,7 @@ #include "dialog.h" -#define ITEM_IDENT 1 /* Indent of menu entries. Fixed for all menus */ -static int menu_width; +static int menu_width, item_x; /* * Print menu item @@ -70,7 +69,7 @@ static void do_print_item(WINDOW * win, const char *item, int choice, int j; char *menu_item = malloc(menu_width + 1); - strncpy(menu_item, item, menu_width - ITEM_IDENT); + strncpy(menu_item, item, menu_width - item_x); menu_item[menu_width] = 0; j = first_alpha(menu_item, "YyNnMmHh"); @@ -87,13 +86,13 @@ static void do_print_item(WINDOW * win, const char *item, int choice, wclrtoeol(win); #endif wattrset(win, selected ? item_selected_attr : item_attr); - mvwaddstr(win, choice, ITEM_IDENT, menu_item); + mvwaddstr(win, choice, item_x, menu_item); if (hotkey) { wattrset(win, selected ? tag_key_selected_attr : tag_key_attr); - mvwaddch(win, choice, ITEM_IDENT + j, menu_item[j]); + mvwaddch(win, choice, item_x + j, menu_item[j]); } if (selected) { - wmove(win, choice, ITEM_IDENT + 1); + wmove(win, choice, item_x + 1); } free(menu_item); wrefresh(win); @@ -227,6 +226,8 @@ int dialog_menu(const char *title, const char *prompt, int height, int width, draw_box(dialog, box_y, box_x, menu_height + 2, menu_width + 2, menubox_border_attr, menubox_attr); + item_x = (menu_width - 70) / 2; + /* Set choice to default item */ for (i = 0; i < item_no; i++) if (strcmp(current, items[i * 2]) == 0) @@ -263,10 +264,10 @@ int dialog_menu(const char *title, const char *prompt, int height, int width, wnoutrefresh(menu); print_arrows(dialog, item_no, scroll, - box_y, box_x + ITEM_IDENT + 1, menu_height); + box_y, box_x + item_x + 1, menu_height); print_buttons(dialog, height, width, 0); - wmove(menu, choice, ITEM_IDENT + 1); + wmove(menu, choice, item_x + 1); wrefresh(menu); while (key != ESC) { @@ -349,7 +350,7 @@ int dialog_menu(const char *title, const char *prompt, int height, int width, print_item(scroll + choice, choice, TRUE); print_arrows(dialog, item_no, scroll, - box_y, box_x + ITEM_IDENT + 1, menu_height); + box_y, box_x + item_x + 1, menu_height); wnoutrefresh(dialog); wrefresh(menu); -- cgit v1.2.3-59-g8ed1b From b5ac4817de3032796c558b0a32062e7392b5ea60 Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Sun, 9 Apr 2006 17:27:28 +0200 Subject: kconfig: fix typo in change count initialization Configuration needs saving when either of these conditions is true. Signed-off-by: Roman Zippel Signed-off-by: Sam Ravnborg --- scripts/kconfig/confdata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 1b8882ddbc74..1b5df589f3ae 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -325,7 +325,7 @@ int conf_read(const char *name) sym->flags |= e->right.sym->flags & SYMBOL_NEW; } - sym_change_count = conf_warnings && conf_unsaved; + sym_change_count = conf_warnings || conf_unsaved; return 0; } -- cgit v1.2.3-59-g8ed1b From f043ca43c1ae354346f72dc5826d820d5619f0b2 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 12 Apr 2006 02:21:25 +0200 Subject: [PATCH] Enhancing accessibility of lxdialog For easily getting fairly good accessibility, the TTY cursor should always be left at the focus location. This patch fixes the checklist by just having the list refreshed after the dialog box (hence the cursor position remains in the list). Signed-off-by: Samuel Thibault Signed-off-by: Linus Torvalds --- scripts/kconfig/lxdialog/checklist.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'scripts/kconfig') diff --git a/scripts/kconfig/lxdialog/checklist.c b/scripts/kconfig/lxdialog/checklist.c index db07ae73e051..be0200e9cdaf 100644 --- a/scripts/kconfig/lxdialog/checklist.c +++ b/scripts/kconfig/lxdialog/checklist.c @@ -196,8 +196,8 @@ int dialog_checklist(const char *title, const char *prompt, int height, print_buttons(dialog, height, width, 0); - wnoutrefresh(list); wnoutrefresh(dialog); + wnoutrefresh(list); doupdate(); while (key != ESC) { @@ -225,12 +225,11 @@ int dialog_checklist(const char *title, const char *prompt, int height, } scroll--; print_item(list, items[scroll * 3 + 1], status[scroll], 0, TRUE); - wnoutrefresh(list); - print_arrows(dialog, choice, item_no, scroll, box_y, box_x + check_x + 5, list_height); - wrefresh(dialog); + wnoutrefresh(dialog); + wrefresh(list); continue; /* wait for another key press */ } else @@ -252,12 +251,12 @@ int dialog_checklist(const char *title, const char *prompt, int height, scroll++; print_item(list, items[(scroll + max_choice - 1) * 3 + 1], status[scroll + max_choice - 1], max_choice - 1, TRUE); - wnoutrefresh(list); print_arrows(dialog, choice, item_no, scroll, box_y, box_x + check_x + 5, list_height); - wrefresh(dialog); + wnoutrefresh(dialog); + wrefresh(list); continue; /* wait for another key press */ } else @@ -271,8 +270,8 @@ int dialog_checklist(const char *title, const char *prompt, int height, choice = i; print_item(list, items[(scroll + choice) * 3 + 1], status[scroll + choice], choice, TRUE); - wnoutrefresh(list); - wrefresh(dialog); + wnoutrefresh(dialog); + wrefresh(list); } continue; /* wait for another key press */ } @@ -306,8 +305,8 @@ int dialog_checklist(const char *title, const char *prompt, int height, print_item(list, items[(scroll + i) * 3 + 1], status[scroll + i], i, i == choice); } - wnoutrefresh(list); - wrefresh(dialog); + wnoutrefresh(dialog); + wrefresh(list); for (i = 0; i < item_no; i++) if (status[i]) -- cgit v1.2.3-59-g8ed1b From 9dfb563b07b1aafcd7d40528ebfa7f9ce28f0556 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Tue, 18 Apr 2006 22:21:53 -0700 Subject: [PATCH] config: update usage/help info Replace outdated help message with a reference to README. Update README for make *config variants and environment variable info. Signed-off-by: Randy Dunlap Acked-by: Sam Ravnborg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- README | 23 ++++++++++++++++++++++- scripts/kconfig/conf.c | 3 ++- 2 files changed, 24 insertions(+), 2 deletions(-) (limited to 'scripts/kconfig') diff --git a/README b/README index 05e055530bbb..3e264723b863 100644 --- a/README +++ b/README @@ -165,10 +165,31 @@ CONFIGURING the kernel: "make xconfig" X windows (Qt) based configuration tool. "make gconfig" X windows (Gtk) based configuration tool. "make oldconfig" Default all questions based on the contents of - your existing ./.config file. + your existing ./.config file and asking about + new config symbols. "make silentoldconfig" Like above, but avoids cluttering the screen with questions already answered. + "make defconfig" Create a ./.config file by using the default + symbol values from arch/$ARCH/defconfig. + "make allyesconfig" + Create a ./.config file by setting symbol + values to 'y' as much as possible. + "make allmodconfig" + Create a ./.config file by setting symbol + values to 'm' as much as possible. + "make allnoconfig" Create a ./.config file by setting symbol + values to 'n' as much as possible. + "make randconfig" Create a ./.config file by setting symbol + values to random values. + + The allyesconfig/allmodconfig/allnoconfig/randconfig variants can + also use the environment variable KCONFIG_ALLCONFIG to specify a + filename that contains config options that the user requires to be + set to a specific value. If KCONFIG_ALLCONFIG=filename is not used, + "make *config" checks for a file named "all{yes/mod/no/random}.config" + for symbol values that are to be forced. If this file is not found, + it checks for a file named "all.config" to contain forced values. NOTES on "make config": - having unnecessary drivers will make the kernel bigger, and can diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index ae5ab981bb1d..8012d1076876 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -531,7 +532,7 @@ int main(int ac, char **av) break; case 'h': case '?': - printf("%s [-o|-s] config\n", av[0]); + fprintf(stderr, "See README for usage info\n"); exit(0); } } -- cgit v1.2.3-59-g8ed1b