Skip to contentSkip to conversation

kbuild + kconfig updates for 2.6.16-rc

PATCH In review Sam Ravnborg 6 participants 38 messages Jan 3, 2006 – Jan 4, 2006

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild + kconfig updates for 2.6.16-rc

Accumulated kbuild + kconfig updates for 2.6.16-rc.

The updates are available in the origin branch at my build git repository. Please pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild.git from the origin branch.

Most noteworthy are:
- Fix so we always run silentoldconfig in a cleaned tree. Changes to Kconfig files could be missed
- Fix from Ustyugov Roman so we no longer hide for example the unix symbol when module is named unix.
- fix to genksyms so it handles typeof() correct
Also updated to use recent version of gperf, flex + bison so _shipped files conatains lots of changes
- MODVERSIONING is no longer marked EXPERIMENTAL
- menuconfig are now readable in a text-only console.
There was some strange indention troubles before that was no visible in a xterm window.
- lxdialog has been Lindented and moved causing a longer diffstat than usual.

shortlog below include the details.
Patches will be posted to linux-kernel as follow-up to this mail.

Sam

Adrian Bunk:
kbuild: remove the deprecated check_gcc

Bodo Eggert:
kbuild: document INSTALL_MOD_PATH in 'make help'

Brian Gerst:
gitignore: asm-offsets.h
gitignore: x86_64 files
gitignore: misc files

Brian Strand:
kbuild: patch to Documentation/kbuild/modules.txt

John Kacur:
kbuild: Add ctags support for function prototypes and external variable declarations

Luke Yang:
kbuild: Fix crc-error warning on modules

Petr Baudis:
kconfig: Remove support for lxdialog --checklist

Robin Holt:

      kbuild: Fix genksyms handling of DEFINE_PER_CPU(struct foo_s *, bar);

Sam Ravnborg:
kconfig: Lindent scripts/lxdialog
kconfig: fixup after Lindent
kconfig: lxdialog is now sparse clean
kconfig: Add print_title helper in lxdialog
kconfig: Left aling menu items in menuconfig
kconfig: Fix indention when using menuconfig in text-onle consoles
kconfig: make lxdialog/menubox.c more readable
kconfig: truncate too long menu lines in menuconfig
kconfig: move lxdialog to scripts/kconfig/lxdialog
kbuild: escape '#' in .target.cmd files
kbuild: Create _shipped files for genksyms
kbuild: remove EXPERIMENTAL tag from Module versioning
kbuild: always run 'make silentoldconfig' when tree is cleaned

[email protected]:
gitignore: ignore more generated files

Samuel Thibault:
kbuild: tags file generation fixup

Ustyugov Roman:
kbuild: set correct KBUILD_MODNAME when using well known kernel symbols as module names

diffstat:

 .gitignore                               |    1 
 Documentation/kbuild/modules.txt         |   25 
 Makefile                                 |   47 
 arch/x86_64/boot/.gitignore              |    3 
 arch/x86_64/boot/tools/.gitignore        |    1 
 arch/x86_64/ia32/.gitignore              |    2 
 drivers/char/.gitignore                  |    2 
 drivers/ieee1394/.gitignore              |    1 
 drivers/md/.gitignore                    |    4 
 drivers/net/wan/.gitignore               |    1 
 drivers/scsi/.gitignore                  |    3 
 drivers/scsi/aic7xxx/.gitignore          |    6 
 include/asm-mips/.gitignore              |    2 
 include/linux/spinlock.h                 |    3 
 init/Kconfig                             |    5 
 kernel/.gitignore                        |    5 
 scripts/.gitignore                       |    5 
 scripts/Makefile                         |    2 
 scripts/Makefile.lib                     |    8 
 scripts/basic/fixdep.c                   |   16 
 scripts/genksyms/.gitignore              |    4 
 scripts/genksyms/keywords.c_shipped      |  210 +-
 scripts/genksyms/lex.c_shipped           |  166 +
 scripts/genksyms/parse.c_shipped         | 2916 ++++++++++++++++++-------------
 scripts/genksyms/parse.h_shipped         |  167 +
 scripts/genksyms/parse.y                 |    2 
 scripts/kconfig/.gitignore               |    2 
 scripts/kconfig/Makefile                 |    3 
 scripts/kconfig/lxdialog/.gitignore      |    5 
 scripts/kconfig/lxdialog/BIG.FAT.WARNING |    4 
 scripts/kconfig/lxdialog/Makefile        |   42 
 scripts/kconfig/lxdialog/checklist.c     |  400 +++-
 scripts/kconfig/lxdialog/colors.h        |  154 +
 scripts/kconfig/lxdialog/dialog.h        |  193 +-
 scripts/kconfig/lxdialog/inputbox.c      |  224 ++
 scripts/kconfig/lxdialog/lxdialog.c      |  225 ++
 scripts/kconfig/lxdialog/menubox.c       |  425 ++++
 scripts/kconfig/lxdialog/msgbox.c        |   71 
 scripts/kconfig/lxdialog/textbox.c       |  533 +++++
 scripts/kconfig/lxdialog/util.c          |  362 +++
 scripts/kconfig/lxdialog/yesno.c         |  102 +
 scripts/kconfig/mconf.c                  |    2 
 scripts/kconfig/util.c                   |    3 
 scripts/lxdialog/BIG.FAT.WARNING         |    4 
 scripts/lxdialog/Makefile                |   42 
 scripts/lxdialog/checklist.c             | 1119 +++--------
 scripts/lxdialog/colors.h                |  155 -
 scripts/lxdialog/dialog.h                |  245 --
 scripts/lxdialog/inputbox.c              |  696 ++-----
 scripts/lxdialog/lxdialog.c              |  448 +---
 scripts/lxdialog/menubox.c               | 1373 ++++----------
 scripts/lxdialog/msgbox.c                |  195 --
 scripts/lxdialog/textbox.c               | 1606 +++++------------
 scripts/lxdialog/util.c                  |  842 ++------
 scripts/lxdialog/yesno.c                 |  280 --
 scripts/mod/modpost.c                    |    9 
 56 files changed, 6973 insertions(+), 6398 deletions(-)
#1 lore raw

PATCH 2/26 kconfig: fixup after Lindent

From: Sam Ravnborg <[email protected]>
Date: 1132433780 +0100

Readability are more important then the 80 coloumn limit, so fold several lines to greatly improve readability.
Also keep return type on same line as function definition.

---

 scripts/lxdialog/checklist.c |   99 +++++++++++++-----------------------------
 scripts/lxdialog/dialog.h    |    3 -
 scripts/lxdialog/inputbox.c  |   49 ++++++---------------
 scripts/lxdialog/menubox.c   |   83 +++++++++++------------------------
 scripts/lxdialog/msgbox.c    |    5 +-
 scripts/lxdialog/textbox.c   |   93 ++++++++++++++-------------------------
 scripts/lxdialog/util.c      |    2 -
 scripts/lxdialog/yesno.c     |    3 -
 8 files changed, 108 insertions(+), 229 deletions(-)

dec69da856653772d7ee7b2f98dc69da27274a22

scripts/lxdialog/checklist.c +30 -69
index 1857c53..ae40a2b 100644
@@ -28,8 +28,8 @@ static int list_width, check_x, item_x, 
 /*
  * Print list item
  */
-static void
-print_item(WINDOW * win, const char *item, int status, int choice, int selected)
+static void print_item(WINDOW * win, const char *item, int status, int choice,
+		       int selected)
 {
 	int i;
 
@@ -59,8 +59,7 @@ print_item(WINDOW * win, const char *ite
 /*
  * Print the scroll indicators.
  */
-static void
-print_arrows(WINDOW * win, int choice, int item_no, int scroll,
+static void print_arrows(WINDOW * win, int choice, int item_no, int scroll,
 	     int y, int x, int height)
 {
 	wmove(win, y, x);
@@ -112,10 +111,9 @@ static void print_buttons(WINDOW * dialo
  * Display a dialog box with a list of options that can be turned on or off
  * The `flag' parameter is used to select between radiolist and checklist.
  */
-int
-dialog_checklist(const char *title, const char *prompt, int height, int width,
-		 int list_height, int item_no, const char *const *items,
-		 int flag)
+int dialog_checklist(const char *title, const char *prompt, int height,
+		     int width, int list_height, int item_no,
+		     const char *const *items, int flag)
 {
 	int i, x, y, box_x, box_y;
 	int key = 0, button = 0, choice = 0, scroll = 0, max_choice, *status;
@@ -183,15 +181,14 @@ dialog_checklist(const char *title, cons
 	box_x = (width - list_width) / 2 - 1;
 
 	/* create new window for the list */
-	list =
-	    subwin(dialog, list_height, list_width, y + box_y + 1,
-		   x + box_x + 1);
+	list = subwin(dialog, list_height, list_width, y + box_y + 1,
+	              x + box_x + 1);
 
 	keypad(list, TRUE);
 
 	/* draw a box around the list items */
 	draw_box(dialog, box_y, box_x, list_height + 2, list_width + 2,
-		 menubox_border_attr, menubox_attr);
+	         menubox_border_attr, menubox_attr);
 
 	/* Find length of longest item in order to center checklist */
 	check_x = 0;
@@ -238,24 +235,18 @@ dialog_checklist(const char *title, cons
 					/* Scroll list down */
 					if (list_height > 1) {
 						/* De-highlight current first item */
-						print_item(list,
-							   items[scroll * 3 +
-								 1],
-							   status[scroll], 0,
-							   FALSE);
+						print_item(list, items[scroll * 3 + 1],
+							   status[scroll], 0, FALSE);
 						scrollok(list, TRUE);
 						wscrl(list, -1);
 						scrollok(list, FALSE);
 					}
 					scroll--;
-					print_item(list, items[scroll * 3 + 1],
-						   status[scroll], 0, TRUE);
+					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);
+						     scroll, box_y, box_x + check_x + 5, list_height);
 
 					wrefresh(dialog);
 
@@ -269,32 +260,20 @@ dialog_checklist(const char *title, cons
 					/* Scroll list up */
 					if (list_height > 1) {
 						/* De-highlight current last item before scrolling up */
-						print_item(list,
-							   items[(scroll +
-								  max_choice -
-								  1) * 3 + 1],
-							   status[scroll +
-								  max_choice -
-								  1],
-							   max_choice - 1,
-							   FALSE);
+						print_item(list, items[(scroll + max_choice - 1) * 3 + 1],
+							   status[scroll + max_choice - 1],
+							   max_choice - 1, FALSE);
 						scrollok(list, TRUE);
 						wscrl(list, 1);
 						scrollok(list, FALSE);
 					}
 					scroll++;
-					print_item(list,
-						   items[(scroll + max_choice -
-							  1) * 3 + 1],
-						   status[scroll + max_choice -
-							  1], max_choice - 1,
-						   TRUE);
+					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);
+						     scroll, box_y, box_x + check_x + 5, list_height);
 
 					wrefresh(dialog);
 
@@ -304,16 +283,12 @@ dialog_checklist(const char *title, cons
 			}
 			if (i != choice) {
 				/* De-highlight current item */
-				print_item(list,
-					   items[(scroll + choice) * 3 + 1],
-					   status[scroll + choice], choice,
-					   FALSE);
+				print_item(list, items[(scroll + choice) * 3 + 1],
+					   status[scroll + choice], choice, FALSE);
 				/* Highlight new item */
 				choice = i;
-				print_item(list,
-					   items[(scroll + choice) * 3 + 1],
-					   status[scroll + choice], choice,
-					   TRUE);
+				print_item(list, items[(scroll + choice) * 3 + 1],
+					   status[scroll + choice], choice, TRUE);
 				wnoutrefresh(list);
 				wrefresh(dialog);
 			}
@@ -342,28 +317,18 @@ dialog_checklist(const char *title, cons
 		case '\n':
 			if (!button) {
 				if (flag == FLAG_CHECK) {
-					status[scroll + choice] =
-					    !status[scroll + choice];
+					status[scroll + choice] = !status[scroll + choice];
 					wmove(list, choice, check_x);
 					wattrset(list, check_selected_attr);
-					wprintw(list, "[%c]",
-						status[scroll +
-						       choice] ? 'X' : ' ');
+					wprintw(list, "[%c]", status[scroll + choice] ? 'X' : ' ');
 				} else {
 					if (!status[scroll + choice]) {
 						for (i = 0; i < item_no; i++)
 							status[i] = 0;
 						status[scroll + choice] = 1;
 						for (i = 0; i < max_choice; i++)
-							print_item(list,
-								   items[(scroll
-									  +
-									  i) *
-									 3 + 1],
-								   status[scroll
-									  + i],
-								   i,
-								   i == choice);
+							print_item(list, items[(scroll + i) * 3 + 1],
+								   status[scroll + i], i, i == choice);
 					}
 				}
 				wnoutrefresh(list);
@@ -372,19 +337,15 @@ dialog_checklist(const char *title, cons
 				for (i = 0; i < item_no; i++) {
 					if (status[i]) {
 						if (flag == FLAG_CHECK) {
-							fprintf(stderr,
-								"\"%s\" ",
-								items[i * 3]);
+							fprintf(stderr, "\"%s\" ", items[i * 3]);
 						} else {
-							fprintf(stderr, "%s",
-								items[i * 3]);
+							fprintf(stderr, "%s", items[i * 3]);
 						}
 
 					}
 				}
 			} else
-				fprintf(stderr, "%s",
-					items[(scroll + choice) * 3]);
+				fprintf(stderr, "%s", items[(scroll + choice) * 3]);
 			delwin(dialog);
 			free(status);
 			return button;
scripts/lxdialog/dialog.h +1 -2
index c86801f..3cf3d35 100644
@@ -1,4 +1,3 @@
-
 /*
  *  dialog.h -- common declarations for all dialog modules
  *
@@ -87,7 +86,7 @@
 #define ACS_DARROW 'v'
 #endif
 
-/* 
+/*
  * Attribute names
  */
 #define screen_attr                   attributes[0]
scripts/lxdialog/inputbox.c +15 -34

89 lines not on this page · raw message

scripts/lxdialog/menubox.c +26 -57

157 lines not on this page · raw message

scripts/lxdialog/msgbox.c +2 -3
index 76f358c..b394057 100644
@@ -25,9 +25,8 @@
  * Display a message box. Program will pause and display an "OK" button
  * if the parameter 'pause' is non-zero.
  */
-int
-dialog_msgbox(const char *title, const char *prompt, int height, int width,
-	      int pause)
+int dialog_msgbox(const char *title, const char *prompt, int height, int width,
+                  int pause)
 {
 	int i, x, y, key = 0;
 	WINDOW *dialog;
scripts/lxdialog/textbox.c +32 -61

212 lines not on this page · raw message

scripts/lxdialog/util.c +1 -1
index 232b32c..1f84809 100644
@@ -28,7 +28,7 @@ const char *backtitle = NULL;
 
 const char *dialog_result;
 
-/* 
+/*
  * Attribute values, default is for mono display
  */
 chtype attributes[] = {
scripts/lxdialog/yesno.c +1 -2
index dffd5af..84f3e8e 100644
@@ -96,8 +96,7 @@ int dialog_yesno(const char *title, cons
 		case TAB:
 		case KEY_LEFT:
 		case KEY_RIGHT:
-			button = ((key == KEY_LEFT ? --button : ++button) < 0)
-			    ? 1 : (button > 1 ? 0 : button);
+			button = ((key == KEY_LEFT ? --button : ++button) < 0) ? 1 : (button > 1 ? 0 : button);
 
 			print_buttons(dialog, height, width, button);
 			wrefresh(dialog);
Signature · 1 line
1.0.6
#2 lore raw

PATCH 3/26 kconfig: lxdialog is now sparse clean

In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: 1132435075 +0100

Replacing a gcc idiom with malloc and deleting an unused global variable made lxdialog sparse clean.

---

 scripts/lxdialog/menubox.c |    5 +++--
 scripts/lxdialog/util.c    |    2 --
 2 files changed, 3 insertions(+), 4 deletions(-)

a06104af7dcf2f5bafaf18f373c8b2554cbfe014

scripts/lxdialog/menubox.c +3 -2
index 260cc4d..ff3a617 100644
@@ -67,7 +67,7 @@ static void print_item(WINDOW * win, con
 		       int selected, int hotkey)
 {
 	int j;
-	char menu_item[menu_width + 1];
+	char *menu_item = malloc(menu_width + 1);
 
 	strncpy(menu_item, item, menu_width);
 	menu_item[menu_width] = 0;
@@ -95,6 +95,7 @@ static void print_item(WINDOW * win, con
 		wmove(win, choice, item_x + 1);
 		wrefresh(win);
 	}
+	free(menu_item);
 }
 
 /*
@@ -221,7 +222,7 @@ int dialog_menu(const char *title, const
 
 	/*
 	 * Find length of longest item in order to center menu.
-	 * Set 'choice' to default item. 
+	 * Set 'choice' to default item.
 	 */
 	item_x = 0;
 	for (i = 0; i < item_no; i++) {
scripts/lxdialog/util.c +0 -2
index 1f84809..ce41147 100644
@@ -26,8 +26,6 @@ bool use_colors = 1;
 
 const char *backtitle = NULL;
 
-const char *dialog_result;
-
 /*
  * Attribute values, default is for mono display
  */
Signature · 1 line
1.0.6
#3 lore raw

PATCH 4/26 kconfig: Add print_title helper in lxdialog

In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: 1132439886 +0100

Simplify check for long title and use a helper function in util.c

---

 scripts/lxdialog/checklist.c |   15 +--------------
 scripts/lxdialog/dialog.h    |    1 +
 scripts/lxdialog/inputbox.c  |   15 +--------------
 scripts/lxdialog/menubox.c   |   15 +--------------
 scripts/lxdialog/msgbox.c    |   14 +-------------
 scripts/lxdialog/textbox.c   |   14 +-------------
 scripts/lxdialog/util.c      |   14 ++++++++++++++
 scripts/lxdialog/yesno.c     |   15 +--------------
 8 files changed, 21 insertions(+), 82 deletions(-)

fa7009d5b59b8acd8071f7b3057d36eeeaf08146

scripts/lxdialog/checklist.c +1 -14
index ae40a2b..3fb681f 100644
@@ -158,20 +158,7 @@ int dialog_checklist(const char *title, 
 	wattrset(dialog, dialog_attr);
 	waddch(dialog, ACS_RTEE);
 
-	if (title != NULL && strlen(title) >= width - 2) {
-		/* truncate long title -- mec */
-		char *title2 = malloc(width - 2 + 1);
-		memcpy(title2, title, width - 2);
-		title2[width - 2] = '\0';
-		title = title2;
-	}
-
-	if (title != NULL) {
-		wattrset(dialog, title_attr);
-		mvwaddch(dialog, 0, (width - strlen(title)) / 2 - 1, ' ');
-		waddstr(dialog, (char *)title);
-		waddch(dialog, ' ');
-	}
+	print_title(dialog, title, width);
 
 	wattrset(dialog, dialog_attr);
 	print_autowrap(dialog, prompt, width - 2, 1, 3);
scripts/lxdialog/dialog.h +1 -0
index 3cf3d35..f882204 100644
@@ -145,6 +145,7 @@ void dialog_clear(void);
 void color_setup(void);
 void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x);
 void print_button(WINDOW * win, const char *label, int y, int x, int selected);
+void print_title(WINDOW *dialog, const char *title, int width);
 void draw_box(WINDOW * win, int y, int x, int height, int width, chtype box,
 	      chtype border);
 void draw_shadow(WINDOW * win, int y, int x, int height, int width);
scripts/lxdialog/inputbox.c +1 -14
index bc135c7..7795037 100644
@@ -66,20 +66,7 @@ int dialog_inputbox(const char *title, c
 	wattrset(dialog, dialog_attr);
 	waddch(dialog, ACS_RTEE);
 
-	if (title != NULL && strlen(title) >= width - 2) {
-		/* truncate long title -- mec */
-		char *title2 = malloc(width - 2 + 1);
-		memcpy(title2, title, width - 2);
-		title2[width - 2] = '\0';
-		title = title2;
-	}
-
-	if (title != NULL) {
-		wattrset(dialog, title_attr);
-		mvwaddch(dialog, 0, (width - strlen(title)) / 2 - 1, ' ');
-		waddstr(dialog, (char *)title);
-		waddch(dialog, ' ');
-	}
+	print_title(dialog, title, width);
 
 	wattrset(dialog, dialog_attr);
 	print_autowrap(dialog, prompt, width - 2, 1, 3);
scripts/lxdialog/menubox.c +1 -14
index ff3a617..ebfe6a3 100644
@@ -189,20 +189,7 @@ int dialog_menu(const char *title, const
 	wbkgdset(dialog, dialog_attr & A_COLOR);
 	waddch(dialog, ACS_RTEE);
 
-	if (title != NULL && strlen(title) >= width - 2) {
-		/* truncate long title -- mec */
-		char *title2 = malloc(width - 2 + 1);
-		memcpy(title2, title, width - 2);
-		title2[width - 2] = '\0';
-		title = title2;
-	}
-
-	if (title != NULL) {
-		wattrset(dialog, title_attr);
-		mvwaddch(dialog, 0, (width - strlen(title)) / 2 - 1, ' ');
-		waddstr(dialog, (char *)title);
-		waddch(dialog, ' ');
-	}
+	print_title(dialog, title, width);
 
 	wattrset(dialog, dialog_attr);
 	print_autowrap(dialog, prompt, width - 2, 1, 3);
scripts/lxdialog/msgbox.c +1 -13
index b394057..7323f54 100644
@@ -42,20 +42,8 @@ int dialog_msgbox(const char *title, con
 
 	draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
 
-	if (title != NULL && strlen(title) >= width - 2) {
-		/* truncate long title -- mec */
-		char *title2 = malloc(width - 2 + 1);
-		memcpy(title2, title, width - 2);
-		title2[width - 2] = '\0';
-		title = title2;
-	}
+	print_title(dialog, title, width);
 
-	if (title != NULL) {
-		wattrset(dialog, title_attr);
-		mvwaddch(dialog, 0, (width - strlen(title)) / 2 - 1, ' ');
-		waddstr(dialog, (char *)title);
-		waddch(dialog, ' ');
-	}
 	wattrset(dialog, dialog_attr);
 	print_autowrap(dialog, prompt, width - 2, 1, 2);
 
scripts/lxdialog/textbox.c +1 -13
index fa8d92e..77848bb 100644
@@ -103,20 +103,8 @@ int dialog_textbox(const char *title, co
 	wbkgdset(dialog, dialog_attr & A_COLOR);
 	waddch(dialog, ACS_RTEE);
 
-	if (title != NULL && strlen(title) >= width - 2) {
-		/* truncate long title -- mec */
-		char *title2 = malloc(width - 2 + 1);
-		memcpy(title2, title, width - 2);
-		title2[width - 2] = '\0';
-		title = title2;
-	}
+	print_title(dialog, title, width);
 
-	if (title != NULL) {
-		wattrset(dialog, title_attr);
-		mvwaddch(dialog, 0, (width - strlen(title)) / 2 - 1, ' ');
-		waddstr(dialog, (char *)title);
-		waddch(dialog, ' ');
-	}
 	print_button(dialog, " Exit ", height - 2, width / 2 - 4, TRUE);
 	wnoutrefresh(dialog);
 	getyx(dialog, cur_y, cur_x);	/* Save cursor position */
scripts/lxdialog/util.c +14 -0
index ce41147..f82cebb 100644
@@ -177,6 +177,20 @@ void end_dialog(void)
 	endwin();
 }
 
+/* Print the title of the dialog. Center the title and truncate
+ * tile if wider than dialog (- 2 chars).
+ **/
+void print_title(WINDOW *dialog, const char *title, int width)
+{
+	if (title) {
+		int tlen = MIN(width - 2, strlen(title));
+		wattrset(dialog, title_attr);
+		mvwaddch(dialog, 0, (width - tlen) / 2 - 1, ' ');
+		mvwaddnstr(dialog, 0, (width - tlen)/2, title, tlen);
+		waddch(dialog, ' ');
+	}
+}
+
 /*
  * Print a string of text in a window, automatically wrap around to the
  * next line if the string is too long to fit on one line. Newline
scripts/lxdialog/yesno.c +1 -14
index 84f3e8e..cb2568a 100644
@@ -61,20 +61,7 @@ int dialog_yesno(const char *title, cons
 	wattrset(dialog, dialog_attr);
 	waddch(dialog, ACS_RTEE);
 
-	if (title != NULL && strlen(title) >= width - 2) {
-		/* truncate long title -- mec */
-		char *title2 = malloc(width - 2 + 1);
-		memcpy(title2, title, width - 2);
-		title2[width - 2] = '\0';
-		title = title2;
-	}
-
-	if (title != NULL) {
-		wattrset(dialog, title_attr);
-		mvwaddch(dialog, 0, (width - strlen(title)) / 2 - 1, ' ');
-		waddstr(dialog, (char *)title);
-		waddch(dialog, ' ');
-	}
+	print_title(dialog, title, width);
 
 	wattrset(dialog, dialog_attr);
 	print_autowrap(dialog, prompt, width - 2, 1, 3);
Signature · 1 line
1.0.6
#4 lore raw

PATCH 5/26 kconfig: Left aling menu items in menuconfig

In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: 1132522881 +0100

Keeping menu lines on a fixed position creates less visual noise when navigating the menus.

---

 scripts/lxdialog/menubox.c |   30 +++++++++++-------------------
 1 files changed, 11 insertions(+), 19 deletions(-)

0e175d05a4e72f85918da3ea4bd9f5d3d78face4

scripts/lxdialog/menubox.c +11 -19
index ebfe6a3..89fcf41 100644
@@ -58,7 +58,8 @@
 
 #include "dialog.h"
 
-static int menu_width, item_x;
+#define ITEM_IDENT 4   /* Indent of menu entries. Fixed for all menus */
+static int menu_width;
 
 /*
  * Print menu item
@@ -86,13 +87,13 @@ static void print_item(WINDOW * win, con
 	wclrtoeol(win);
 #endif
 	wattrset(win, selected ? item_selected_attr : item_attr);
-	mvwaddstr(win, choice, item_x, menu_item);
+	mvwaddstr(win, choice, ITEM_IDENT, menu_item);
 	if (hotkey) {
 		wattrset(win, selected ? tag_key_selected_attr : tag_key_attr);
-		mvwaddch(win, choice, item_x + j, menu_item[j]);
+		mvwaddch(win, choice, ITEM_IDENT + j, menu_item[j]);
 	}
 	if (selected) {
-		wmove(win, choice, item_x + 1);
+		wmove(win, choice, ITEM_IDENT + 1);
 		wrefresh(win);
 	}
 	free(menu_item);
@@ -207,19 +208,10 @@ int dialog_menu(const char *title, const
 	draw_box(dialog, box_y, box_x, menu_height + 2, menu_width + 2,
 		 menubox_border_attr, menubox_attr);
 
-	/*
-	 * Find length of longest item in order to center menu.
-	 * Set 'choice' to default item.
-	 */
-	item_x = 0;
-	for (i = 0; i < item_no; i++) {
-		item_x =
-		    MAX(item_x, MIN(menu_width, strlen(items[i * 2 + 1]) + 2));
+	/* Set choice to default item */
+	for (i = 0; i < item_no; i++)
 		if (strcmp(current, items[i * 2]) == 0)
 			choice = i;
-	}
-
-	item_x = (menu_width - item_x) / 2;
 
 	/* get the scroll info from the temp file */
 	if ((f = fopen("lxdialog.scrltmp", "r")) != NULL) {
@@ -254,10 +246,10 @@ int dialog_menu(const char *title, const
 	wnoutrefresh(menu);
 
 	print_arrows(dialog, item_no, scroll,
-		     box_y, box_x + item_x + 1, menu_height);
+		     box_y, box_x + ITEM_IDENT + 1, menu_height);
 
 	print_buttons(dialog, height, width, 0);
-	wmove(menu, choice, item_x + 1);
+	wmove(menu, choice, ITEM_IDENT + 1);
 	wrefresh(menu);
 
 	while (key != ESC) {
@@ -286,7 +278,7 @@ int dialog_menu(const char *title, const
 		    key == KEY_UP || key == KEY_DOWN ||
 		    key == '-' || key == '+' ||
 		    key == KEY_PPAGE || key == KEY_NPAGE) {
-
+			/* Remove highligt of current item */
 			print_item(menu, items[(scroll + choice) * 2 + 1],
 				   choice, FALSE,
 				   (items[(scroll + choice) * 2][0] != ':'));
@@ -364,7 +356,7 @@ int dialog_menu(const char *title, const
 				   choice, TRUE, (items[(scroll + choice) * 2][0] != ':'));
 
 			print_arrows(dialog, item_no, scroll,
-				     box_y, box_x + item_x + 1, menu_height);
+				     box_y, box_x + ITEM_IDENT + 1, menu_height);
 
 			wnoutrefresh(dialog);
 			wrefresh(menu);
Signature · 1 line
1.0.6
#5 lore raw

PATCH 6/26 kconfig: Fix indention when using menuconfig in text-onle consoles

In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: 1132524229 +0100

When using menuconfig in a text-only console (no X started) the indention was often two spaces wrong. This proved to be a ncurses issue which are worked around by calling wrefresh more often.

---

 scripts/lxdialog/menubox.c |   37 ++++++++++++++++++-------------------
 1 files changed, 18 insertions(+), 19 deletions(-)

7c3badf96e0dc8aa89ebf8919653339a5ee8e035

scripts/lxdialog/menubox.c +18 -19
index 89fcf41..461ee08 100644
@@ -94,9 +94,9 @@ static void print_item(WINDOW * win, con
 	}
 	if (selected) {
 		wmove(win, choice, ITEM_IDENT + 1);
-		wrefresh(win);
 	}
 	free(menu_item);
+	wrefresh(win);
 }
 
 /*
@@ -125,6 +125,7 @@ static void print_arrows(WINDOW * win, i
 
 	y = y + height + 1;
 	wmove(win, y, x);
+	wrefresh(win);
 
 	if ((height < item_no) && (scroll + height < item_no)) {
 		wattrset(win, darrow_attr);
@@ -139,6 +140,7 @@ static void print_arrows(WINDOW * win, i
 	}
 
 	wmove(win, cur_y, cur_x);
+	wrefresh(win);
 }
 
 /*
@@ -157,6 +159,17 @@ static void print_buttons(WINDOW * win, 
 	wrefresh(win);
 }
 
+/* scroll up n lines (n may be negative) */
+static void do_scroll(WINDOW *win, int *scroll, int n)
+{
+	/* Scroll menu up */
+	scrollok(win, TRUE);
+	wscrl(win, n);
+	scrollok(win, FALSE);
+	*scroll = *scroll + n;
+	wrefresh(win);
+}
+
 /*
  * Display a menu for choosing among a number of options
  */
@@ -286,11 +299,7 @@ int dialog_menu(const char *title, const
 			if (key == KEY_UP || key == '-') {
 				if (choice < 2 && scroll) {
 					/* Scroll menu down */
-					scrollok(menu, TRUE);
-					wscrl(menu, -1);
-					scrollok(menu, FALSE);
-
-					scroll--;
+					do_scroll(menu, &scroll, -1);
 
 					print_item(menu, items[scroll * 2 + 1], 0, FALSE,
 						   (items[scroll * 2][0] != ':'));
@@ -306,11 +315,7 @@ int dialog_menu(const char *title, const
 				if ((choice > max_choice - 3) &&
 				    (scroll + max_choice < item_no)) {
 					/* Scroll menu up */
-					scrollok(menu, TRUE);
-					wscrl(menu, 1);
-					scrollok(menu, FALSE);
-
-					scroll++;
+					do_scroll(menu, &scroll, 1);
 
 					print_item(menu, items[(scroll + max_choice - 1) * 2 + 1],
 						   max_choice - 1, FALSE,
@@ -322,8 +327,7 @@ int dialog_menu(const char *title, const
 				scrollok(menu, TRUE);
 				for (i = 0; (i < max_choice); i++) {
 					if (scroll > 0) {
-						wscrl(menu, -1);
-						scroll--;
+						do_scroll(menu, &scroll, -1);
 						print_item(menu, items[scroll * 2 + 1], 0, FALSE,
 							   (items[scroll * 2][0] != ':'));
 					} else {
@@ -331,15 +335,11 @@ int dialog_menu(const char *title, const
 							choice--;
 					}
 				}
-				scrollok(menu, FALSE);
 
 			} else if (key == KEY_NPAGE) {
 				for (i = 0; (i < max_choice); i++) {
 					if (scroll + max_choice < item_no) {
-						scrollok(menu, TRUE);
-						wscrl(menu, 1);
-						scrollok(menu, FALSE);
-						scroll++;
+						do_scroll(menu, &scroll, 1);
 						print_item(menu, items[(scroll + max_choice - 1) * 2 + 1],
 							   max_choice - 1, FALSE,
 							   (items [(scroll + max_choice - 1) * 2][0] != ':'));
@@ -348,7 +348,6 @@ int dialog_menu(const char *title, const
 							choice++;
 					}
 				}
-
 			} else
 				choice = i;
 
Signature · 1 line
1.0.6
#6 lore raw

PATCH 7/26 kconfig: make lxdialog/menubox.c more readable

In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: 1132526075 +0100

Utilising a small macro for print_item made wonders for readability for this file.

---

 scripts/lxdialog/menubox.c |   42 ++++++++++++++++++------------------------
 1 files changed, 18 insertions(+), 24 deletions(-)

59d3cf7a40dfdbb8e86758ade172831c19630050

scripts/lxdialog/menubox.c +18 -24
index 461ee08..d0bf32b 100644
@@ -64,8 +64,8 @@ static int menu_width;
 /*
  * Print menu item
  */
-static void print_item(WINDOW * win, const char *item, int choice,
-		       int selected, int hotkey)
+static void do_print_item(WINDOW * win, const char *item, int choice,
+                          int selected, int hotkey)
 {
 	int j;
 	char *menu_item = malloc(menu_width + 1);
@@ -99,6 +99,12 @@ static void print_item(WINDOW * win, con
 	wrefresh(win);
 }
 
+#define print_item(index, choice, selected) \
+do {\
+	int hotkey = (items[(index) * 2][0] != ':'); \
+	do_print_item(menu, items[(index) * 2 + 1], choice, selected, hotkey); \
+} while (0)
+
 /*
  * Print the scroll indicators.
  */
@@ -251,9 +257,7 @@ int dialog_menu(const char *title, const
 
 	/* Print the menu */
 	for (i = 0; i < max_choice; i++) {
-		print_item(menu, items[(first_item + i) * 2 + 1], i,
-			   i == choice,
-			   (items[(first_item + i) * 2][0] != ':'));
+		print_item(first_item + i, i, i == choice);
 	}
 
 	wnoutrefresh(menu);
@@ -292,34 +296,27 @@ int dialog_menu(const char *title, const
 		    key == '-' || key == '+' ||
 		    key == KEY_PPAGE || key == KEY_NPAGE) {
 			/* Remove highligt of current item */
-			print_item(menu, items[(scroll + choice) * 2 + 1],
-				   choice, FALSE,
-				   (items[(scroll + choice) * 2][0] != ':'));
+			print_item(scroll + choice, choice, FALSE);
 
 			if (key == KEY_UP || key == '-') {
 				if (choice < 2 && scroll) {
 					/* Scroll menu down */
 					do_scroll(menu, &scroll, -1);
 
-					print_item(menu, items[scroll * 2 + 1], 0, FALSE,
-						   (items[scroll * 2][0] != ':'));
+					print_item(scroll, 0, FALSE);
 				} else
 					choice = MAX(choice - 1, 0);
 
 			} else if (key == KEY_DOWN || key == '+') {
-
-				print_item(menu,
-					   items[(scroll + choice) * 2 + 1], choice, FALSE,
-					   (items[(scroll + choice) * 2][0] != ':'));
+				print_item(scroll+choice, choice, FALSE);
 
 				if ((choice > max_choice - 3) &&
 				    (scroll + max_choice < item_no)) {
 					/* Scroll menu up */
 					do_scroll(menu, &scroll, 1);
 
-					print_item(menu, items[(scroll + max_choice - 1) * 2 + 1],
-						   max_choice - 1, FALSE,
-						   (items [(scroll + max_choice - 1) * 2][0] != ':'));
+					print_item(scroll+max_choice - 1,
+						   max_choice - 1, FALSE);
 				} else
 					choice = MIN(choice + 1, max_choice - 1);
 
@@ -328,8 +325,7 @@ int dialog_menu(const char *title, const
 				for (i = 0; (i < max_choice); i++) {
 					if (scroll > 0) {
 						do_scroll(menu, &scroll, -1);
-						print_item(menu, items[scroll * 2 + 1], 0, FALSE,
-							   (items[scroll * 2][0] != ':'));
+						print_item(scroll, 0, FALSE);
 					} else {
 						if (choice > 0)
 							choice--;
@@ -340,9 +336,8 @@ int dialog_menu(const char *title, const
 				for (i = 0; (i < max_choice); i++) {
 					if (scroll + max_choice < item_no) {
 						do_scroll(menu, &scroll, 1);
-						print_item(menu, items[(scroll + max_choice - 1) * 2 + 1],
-							   max_choice - 1, FALSE,
-							   (items [(scroll + max_choice - 1) * 2][0] != ':'));
+						print_item(scroll+max_choice-1,
+							   max_choice - 1, FALSE);
 					} else {
 						if (choice + 1 < max_choice)
 							choice++;
@@ -351,8 +346,7 @@ int dialog_menu(const char *title, const
 			} else
 				choice = i;
 
-			print_item(menu, items[(scroll + choice) * 2 + 1],
-				   choice, TRUE, (items[(scroll + choice) * 2][0] != ':'));
+			print_item(scroll + choice, choice, TRUE);
 
 			print_arrows(dialog, item_no, scroll,
 				     box_y, box_x + ITEM_IDENT + 1, menu_height);
Signature · 1 line
1.0.6
#7 lore raw

PATCH 8/26 kconfig: truncate too long menu lines in menuconfig

In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: 1132610372 +0100

menu lines wrapped over too lines when too long - truncate them. Also fixed a coding style issue

---

 scripts/lxdialog/menubox.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

e067e1f98d54d62fd598126f95e7684e5b63e67f

scripts/lxdialog/menubox.c +3 -3
index d0bf32b..2d91880 100644
@@ -70,7 +70,7 @@ static void do_print_item(WINDOW * win, 
 	int j;
 	char *menu_item = malloc(menu_width + 1);
 
-	strncpy(menu_item, item, menu_width);
+	strncpy(menu_item, item, menu_width - ITEM_IDENT);
 	menu_item[menu_width] = 0;
 	j = first_alpha(menu_item, "YyNnMmHh");
 
@@ -184,8 +184,8 @@ int dialog_menu(const char *title, const
                 const char *const *items)
 {
 	int i, j, x, y, box_x, box_y;
-	int key = 0, button = 0, scroll = 0, choice = 0, first_item =
-	    0, max_choice;
+	int key = 0, button = 0, scroll = 0, choice = 0;
+	int first_item =  0, max_choice;
 	WINDOW *dialog, *menu;
 	FILE *f;
 
Signature · 1 line
1.0.6
#8 lore raw

PATCH 9/26 kconfig: move lxdialog to scripts/kconfig/lxdialog

In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: 1134765319 +0100

The only lxdialog user i kconfig - for menuconfig. So move it to reflect this.

---

 scripts/Makefile                         |    2 +-
 scripts/kconfig/Makefile                 |    3 ++-
 scripts/kconfig/lxdialog/BIG.FAT.WARNING |    0 
 scripts/kconfig/lxdialog/Makefile        |    0 
 scripts/kconfig/lxdialog/checklist.c     |    0 
 scripts/kconfig/lxdialog/colors.h        |    0 
 scripts/kconfig/lxdialog/dialog.h        |    0 
 scripts/kconfig/lxdialog/inputbox.c      |    0 
 scripts/kconfig/lxdialog/lxdialog.c      |    0 
 scripts/kconfig/lxdialog/menubox.c       |    2 +-
 scripts/kconfig/lxdialog/msgbox.c        |    0 
 scripts/kconfig/lxdialog/textbox.c       |    0 
 scripts/kconfig/lxdialog/util.c          |    0 
 scripts/kconfig/lxdialog/yesno.c         |    0 
 scripts/kconfig/mconf.c                  |    2 +-
 15 files changed, 5 insertions(+), 4 deletions(-)
 rename scripts/{lxdialog/BIG.FAT.WARNING => kconfig/lxdialog/BIG.FAT.WARNING} (100%)
 rename scripts/{lxdialog/Makefile => kconfig/lxdialog/Makefile} (100%)
 rename scripts/{lxdialog/checklist.c => kconfig/lxdialog/checklist.c} (100%)
 rename scripts/{lxdialog/colors.h => kconfig/lxdialog/colors.h} (100%)
 rename scripts/{lxdialog/dialog.h => kconfig/lxdialog/dialog.h} (100%)
 rename scripts/{lxdialog/inputbox.c => kconfig/lxdialog/inputbox.c} (100%)
 rename scripts/{lxdialog/lxdialog.c => kconfig/lxdialog/lxdialog.c} (100%)
 rename scripts/{lxdialog/menubox.c => kconfig/lxdialog/menubox.c} (100%)
 rename scripts/{lxdialog/msgbox.c => kconfig/lxdialog/msgbox.c} (100%)
 rename scripts/{lxdialog/textbox.c => kconfig/lxdialog/textbox.c} (100%)
 rename scripts/{lxdialog/util.c => kconfig/lxdialog/util.c} (100%)
 rename scripts/{lxdialog/yesno.c => kconfig/lxdialog/yesno.c} (100%)

6f6046cff2e8f04d6b916b10ebaa7b40d7e7967a

scripts/Makefile +1 -1
index 67763ee..6f6b48f 100644
@@ -19,4 +19,4 @@ subdir-$(CONFIG_MODVERSIONS) += genksyms
 subdir-$(CONFIG_MODULES)     += mod
 
 # Let clean descend into subdirs
-subdir-	+= basic lxdialog kconfig package
+subdir-	+= basic kconfig package
scripts/kconfig/Makefile +2 -1
index 9d67782..55bf955 100644
@@ -11,7 +11,7 @@ gconfig: $(obj)/gconf
 	$< arch/$(ARCH)/Kconfig
 
 menuconfig: $(obj)/mconf
-	$(Q)$(MAKE) $(build)=scripts/lxdialog
+	$(Q)$(MAKE) $(build)=scripts/kconfig/lxdialog
 	$< arch/$(ARCH)/Kconfig
 
 config: $(obj)/conf
@@ -115,6 +115,7 @@ endif
 
 clean-files	:= lkc_defs.h qconf.moc .tmp_qtcheck \
 		   .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c
+subdir- += lxdialog
 
 # Needed for systems without gettext
 KBUILD_HAVE_NLS := $(shell \
scripts/kconfig/lxdialog/BIG.FAT.WARNING renamed from scripts/lxdialog/BIG.FAT.WARNING +0 -0
similarity index 100%
rename from scripts/lxdialog/BIG.FAT.WARNING
rename to scripts/kconfig/lxdialog/BIG.FAT.WARNING
scripts/kconfig/lxdialog/Makefile renamed from scripts/lxdialog/Makefile +0 -0
similarity index 100%
rename from scripts/lxdialog/Makefile
rename to scripts/kconfig/lxdialog/Makefile
scripts/kconfig/lxdialog/checklist.c renamed from scripts/lxdialog/checklist.c +0 -0
similarity index 100%
rename from scripts/lxdialog/checklist.c
rename to scripts/kconfig/lxdialog/checklist.c
scripts/kconfig/lxdialog/colors.h renamed from scripts/lxdialog/colors.h +0 -0
similarity index 100%
rename from scripts/lxdialog/colors.h
rename to scripts/kconfig/lxdialog/colors.h
scripts/kconfig/lxdialog/dialog.h renamed from scripts/lxdialog/dialog.h +0 -0
similarity index 100%
rename from scripts/lxdialog/dialog.h
rename to scripts/kconfig/lxdialog/dialog.h
scripts/kconfig/lxdialog/inputbox.c renamed from scripts/lxdialog/inputbox.c +0 -0
similarity index 100%
rename from scripts/lxdialog/inputbox.c
rename to scripts/kconfig/lxdialog/inputbox.c
scripts/kconfig/lxdialog/lxdialog.c renamed from scripts/lxdialog/lxdialog.c +0 -0
similarity index 100%
rename from scripts/lxdialog/lxdialog.c
rename to scripts/kconfig/lxdialog/lxdialog.c
scripts/kconfig/lxdialog/menubox.c renamed from scripts/lxdialog/menubox.c +1 -1
similarity index 100%
rename from scripts/lxdialog/menubox.c
rename to scripts/kconfig/lxdialog/menubox.c
index 2d91880..09512b5 100644
@@ -58,7 +58,7 @@
 
 #include "dialog.h"
 
-#define ITEM_IDENT 4   /* Indent of menu entries. Fixed for all menus */
+#define ITEM_IDENT 1   /* Indent of menu entries. Fixed for all menus */
 static int menu_width;
 
 /*
scripts/kconfig/lxdialog/msgbox.c renamed from scripts/lxdialog/msgbox.c +0 -0
similarity index 100%
rename from scripts/lxdialog/msgbox.c
rename to scripts/kconfig/lxdialog/msgbox.c
scripts/kconfig/lxdialog/textbox.c renamed from scripts/lxdialog/textbox.c +0 -0
similarity index 100%
rename from scripts/lxdialog/textbox.c
rename to scripts/kconfig/lxdialog/textbox.c
scripts/kconfig/lxdialog/util.c renamed from scripts/lxdialog/util.c +0 -0
similarity index 100%
rename from scripts/lxdialog/util.c
rename to scripts/kconfig/lxdialog/util.c
scripts/kconfig/lxdialog/yesno.c renamed from scripts/lxdialog/yesno.c +0 -0
similarity index 100%
rename from scripts/lxdialog/yesno.c
rename to scripts/kconfig/lxdialog/yesno.c
scripts/kconfig/mconf.c +1 -1
index d1ad405..d63d7fb 100644
@@ -325,7 +325,7 @@ static void cprint_init(void)
 	memset(args, 0, sizeof(args));
 	indent = 0;
 	child_count = 0;
-	cprint("./scripts/lxdialog/lxdialog");
+	cprint("./scripts/kconfig/lxdialog/lxdialog");
 	cprint("--backtitle");
 	cprint(menu_backtitle);
 }
Signature · 1 line
1.0.6
#9 lore raw

PATCH 10/26 kbuild: remove the deprecated check_gcc

In reply to Sam Ravnborg

From: Adrian Bunk <[email protected]>
Date: 1134516367 +0100

check_gcc has been deprecated for quite some time.

---

 Makefile |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

cb1a7b4df7e2ffc7c97891e8f350ce5db50df3b9

Makefile +0 -4
index c319144..b7856d3 100644
@@ -286,10 +286,6 @@ export quiet Q KBUILD_VERBOSE
 cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
              > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
 
-# For backward compatibility
-check_gcc = $(warning check_gcc is deprecated - use cc-option) \
-            $(call cc-option, $(1),$(2))
-
 # cc-option-yn
 # Usage: flag := $(call cc-option-yn, -march=winchip-c6)
 cc-option-yn = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
Signature · 1 line
1.0.6
#10 lore raw

PATCH 11/26 kbuild: patch to Documentation/kbuild/modules.txt

In reply to Sam Ravnborg

From: Brian Strand <[email protected]>
Date: 1132622588 +0000

First off, thanks for the kbuild docs, they are very useful! Second, I've attached a patch to modules.txt (from 2.6.14.2) with a "compile" fix to a Makefile example, and some trivial spelling/grammar nits. Please let me know if you want the patch in some other format (eg not MIME), or if I should go bother someone else about it.

---

 Documentation/kbuild/modules.txt |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

98a1e444111c9fd3f7a2b55225f7febf4209c020

Documentation/kbuild/modules.txt +12 -12
index c91caf7..1c0db65 100644
@@ -38,7 +38,7 @@ included in the kernel tree.
 What is covered within this file is mainly information to authors
 of modules. The author of an external modules should supply
 a makefile that hides most of the complexity so one only has to type
-'make' to buld the module. A complete example will be present in
+'make' to build the module. A complete example will be present in
 chapter ¤. Creating a kbuild file for an external module".
 
 
@@ -69,7 +69,7 @@ when building an external module.
 
 --- 2.2 Available targets
 
-	$KDIR refers to path to kernel source top-level directory
+	$KDIR refers to the path to the kernel source top-level directory
 
 	make -C $KDIR M=`pwd`
 		Will build the module(s) located in current directory.
@@ -87,11 +87,11 @@ when building an external module.
 	make -C $KDIR M=$PWD modules_install
 		Install the external module(s).
 		Installation default is in /lib/modules/<kernel-version>/extra,
-		but may be prefixed with INSTALL_MOD_PATH - see separate chater.
+		but may be prefixed with INSTALL_MOD_PATH - see separate chapter.
 
 	make -C $KDIR M=$PWD clean
 		Remove all generated files for the module - the kernel
-		source directory is not moddified.
+		source directory is not modified.
 
 	make -C $KDIR M=`pwd` help
 		help will list the available target when building external
@@ -99,7 +99,7 @@ when building an external module.
 
 --- 2.3 Available options:
 
-	$KDIR refer to path to kernel src
+	$KDIR refers to the path to the kernel source top-level directory
 
 	make -C $KDIR
 		Used to specify where to find the kernel source.
@@ -206,11 +206,11 @@ following files:
 
 		KERNELDIR := /lib/modules/`uname -r`/build
 		all::
-			$(MAKE) -C $KERNELDIR M=`pwd` $@
+			$(MAKE) -C $(KERNELDIR) M=`pwd` $@
 
 		# Module specific targets
 		genbin:
-			echo "X" > 8123_bini.o_shipped
+			echo "X" > 8123_bin.o_shipped
 
 		endif
 
@@ -341,13 +341,13 @@ directory and therefore needs to deal wi
 		EXTRA_CFLAGS := -Iinclude
 		8123-y := 8123_if.o 8123_pci.o 8123_bin.o
 
-	Note that in the assingment there is no space between -I and the path.
-	This is a kbuild limitation and no space must be present.
+	Note that in the assignment there is no space between -I and the path.
+	This is a kbuild limitation:  there must be no space present.
 
 
 === 6. Module installation
 
-Modules which are included in the kernel is installed in the directory:
+Modules which are included in the kernel are installed in the directory:
 
 	/lib/modules/$(KERNELRELEASE)/kernel
 
@@ -365,7 +365,7 @@ External modules are installed in the di
 		=> Install dir: /frodo/lib/modules/$(KERNELRELEASE)/kernel
 
 	INSTALL_MOD_PATH may be set as an ordinary shell variable or as in the
-	example above be specified on the commandline when calling make.
+	example above be specified on the command line when calling make.
 	INSTALL_MOD_PATH has effect both when installing modules included in
 	the kernel as well as when installing external modules.
 
@@ -384,7 +384,7 @@ External modules are installed in the di
 
 === 7. Module versioning
 
-Module versioning are enabled by the CONFIG_MODVERSIONS tag.
+Module versioning is enabled by the CONFIG_MODVERSIONS tag.
 
 Module versioning is used as a simple ABI consistency check. The Module
 versioning creates a CRC value of the full prototype for an exported symbol and
Signature · 1 line
1.0.6
#11 lore raw

PATCH 12/26 kbuild: document INSTALL_MOD_PATH in 'make help'

In reply to Sam Ravnborg

From: Bodo Eggert <[email protected]>
Date: 1132773094 +0100

---

 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

9cc5d74c847dd3a9ea121b5bbca07bd5791c54ee

Makefile +1 -1
index b7856d3..5f685b9 100644
@@ -1062,7 +1062,7 @@ help:
 	@echo  '  all		  - Build all targets marked with [*]'
 	@echo  '* vmlinux	  - Build the bare kernel'
 	@echo  '* modules	  - Build all modules'
-	@echo  '  modules_install - Install all modules'
+	@echo  '  modules_install - Install all modules to INSTALL_MOD_PATH (default: /)'
 	@echo  '  dir/            - Build all files in dir and below'
 	@echo  '  dir/file.[ois]  - Build specified target only'
 	@echo  '  dir/file.ko     - Build module including final link'
Signature · 1 line
1.0.6
#12 lore raw

PATCH 13/26 kbuild: Fix crc-error warning on modules

In reply to Sam Ravnborg

From: Luke Yang <[email protected]>
Date: 1135132043 +0800

This is the patch for the following issue:

In include/linux/module.h, "__crc_" and "__ksymtab_" are hard
coded to be the prefix for some kinds of symbols (CRC symbol and
ksymtab section). But in script /mod/modpost.c, MODULE_SYMBOL_PREFIX##"__crc_" is used as the prefix to search CRC symbols. So if an architecture (such as h8300 or Blackfin) defines MODULE_SYMBOL_PREFIX as not NULL ("_"), modpost will always warn about "no invalid crc".
And it is the same with KSYMTAB_PFX.

---

 scripts/mod/modpost.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

9572b28faf72859c6b91891c627870cfa282d19d

scripts/mod/modpost.c +2 -2
index 3bed09e..8ce5a63 100644
@@ -326,8 +326,8 @@ parse_elf_finish(struct elf_info *info)
 	release_file(info->hdr, info->size);
 }
 
-#define CRC_PFX     MODULE_SYMBOL_PREFIX "__crc_"
-#define KSYMTAB_PFX MODULE_SYMBOL_PREFIX "__ksymtab_"
+#define CRC_PFX     "__crc_"
+#define KSYMTAB_PFX "__ksymtab_"
 
 void
 handle_modversions(struct module *mod, struct elf_info *info,
Signature · 1 line
1.0.6
#13 lore raw

PATCH 14/26 kbuild: Add ctags support for function prototypes and external variable declarations

In reply to Sam Ravnborg

From: John Kacur <[email protected]>
Date: 1130559913 -0400

This patch adds function prototypes and external variable declarations to the set of tag kinds when running ctags. I find this useful when perusing the kernel. Please apply.

---

 Makefile |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

f6333eb4e788bf70d6455c9004b6b676df62c500

Makefile +8 -4
index 5f685b9..ced0346 100644
@@ -1236,8 +1236,10 @@ cscope: FORCE
 quiet_cmd_TAGS = MAKE   $@
 define cmd_TAGS
 	rm -f $@; \
-	ETAGSF=`etags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL --extra=+f"`; \
-	$(all-sources) | xargs etags $$ETAGSF -a
+	ETAGSF=`etags --version | grep -i exuberant >/dev/null && \
+                echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
+                --extra=+f --c-kinds=+px"`; \
+                $(all-sources) | xargs etags $$ETAGSF -a
 endef
 
 TAGS: FORCE
@@ -1247,8 +1249,10 @@ TAGS: FORCE
 quiet_cmd_tags = MAKE   $@
 define cmd_tags
 	rm -f $@; \
-	CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL --extra=+f"`; \
-	$(all-sources) | xargs ctags $$CTAGSF -a
+	CTAGSF=`ctags --version | grep -i exuberant >/dev/null && \
+                echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
+                --extra=+f --c-kinds=+px"`; \
+                $(all-sources) | xargs ctags $$CTAGSF -a
 endef
 
 tags: FORCE
Signature · 1 line
1.0.6
#14 lore raw

PATCH 15/26 kbuild: escape '#' in .target.cmd files

In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: 1135549274 +0100

Commandlines are contained in the .<target>.cmd files and in case they contain a '#' char make see this as start of comment.
Teach fixdep to escape the '#' char so make will assing the full commandline.

---

 scripts/basic/fixdep.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

4d99f93bdaa1ab49188cac67b4aae9180f8e3960

scripts/basic/fixdep.c +14 -1
index 0b61bea..679124b 100644
@@ -130,9 +130,22 @@ void usage(void)
 	exit(1);
 }
 
+/*
+ * Print out the commandline prefixed with cmd_<target filename> :=
+ * If commandline contains '#' escape with '\' so make to not see
+ * the '#' as a start-of-comment symbol
+ **/
 void print_cmdline(void)
 {
-	printf("cmd_%s := %s\n\n", target, cmdline);
+	char *p = cmdline;
+
+	printf("cmd_%s := ", target);
+	for (; *p; p++) {
+		if (*p == '#')
+			printf("\\");
+		printf("%c", *p);
+	}
+	printf("\n\n");
 }
 
 char * str_config  = NULL;
Signature · 1 line
1.0.6
#15 lore raw

PATCH 16/26 kbuild: set correct KBUILD_MODNAME when using well known kernel symbols as module names

In reply to Sam Ravnborg

From: Ustyugov Roman <[email protected]>
Date: 1127450531 +0400

This patch fixes a problem when we use well known kernel symbols as module names.

For example, if module source name is current.c, idle_stack.c or etc., we have a bad KBUILD_MODNAME value.
For example, KBUILD_MODNAME will be "get_current()" instead of "current", or "(init_thread_union.stack)" instead of "idle_task".

The trick is to define a stringify macro on the commandline - named KBUILD_STR for namespace reasons - and then to stringify the module name.

There are a few uses of KBUILD_MODNAME throughout the tree but the usage is for debug and will not be harmed by this change so left untouched for now.

While at it KBUILD_BASENAME was changed too. Any spinlock usage in the unix module would have created wrong section names without it. Usage in spinlock.h fixed so it no longer stringify KBUILD_BASENAME.

Original patch from Ustyogov Roman - all bugs introduced by me.

---

 include/linux/spinlock.h |    3 +--
 scripts/Makefile.lib     |    8 +++++---
 scripts/mod/modpost.c    |    3 +--
 3 files changed, 7 insertions(+), 7 deletions(-)

f83b5e323f57d6e1f35a839d663e91cebe985e54

include/linux/spinlock.h +1 -2
index 0e9682c..799be67 100644
@@ -59,8 +59,7 @@
 /*
  * Must define these before including other files, inline functions need them
  */
-#define LOCK_SECTION_NAME                       \
-        ".text.lock." __stringify(KBUILD_BASENAME)
+#define LOCK_SECTION_NAME ".text.lock."KBUILD_BASENAME
 
 #define LOCK_SECTION_START(extra)               \
         ".subsection 1\n\t"                     \
scripts/Makefile.lib +5 -3
index 0f81dcf..550798f 100644
@@ -81,8 +81,10 @@ obj-dirs	:= $(addprefix $(obj)/,$(obj-di
 # Note: It's possible that one object gets potentially linked into more
 #       than one module. In that case KBUILD_MODNAME will be set to foo_bar,
 #       where foo and bar are the name of the modules.
-basename_flags = -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F)))
-modname_flags  = $(if $(filter 1,$(words $(modname))),-DKBUILD_MODNAME=$(subst $(comma),_,$(subst -,_,$(modname))))
+name-fix = $(subst $(comma),_,$(subst -,_,$1))
+basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(*F)))"
+modname_flags  = $(if $(filter 1,$(words $(modname))),\
+                 -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
 
 _c_flags       = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o)
 _a_flags       = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
@@ -113,7 +115,7 @@ endif
 
 c_flags        = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
 		 $(__c_flags) $(modkern_cflags) \
-		 $(basename_flags) $(modname_flags)
+		 -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
 
 a_flags        = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
 		 $(__a_flags) $(modkern_aflags)
scripts/mod/modpost.c +1 -2
index 8ce5a63..f70ff13 100644
@@ -539,10 +539,9 @@ add_header(struct buffer *b, struct modu
 	buf_printf(b, "\n");
 	buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n");
 	buf_printf(b, "\n");
-	buf_printf(b, "#undef unix\n"); /* We have a module called "unix" */
 	buf_printf(b, "struct module __this_module\n");
 	buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n");
-	buf_printf(b, " .name = __stringify(KBUILD_MODNAME),\n");
+	buf_printf(b, " .name = KBUILD_MODNAME,\n");
 	if (mod->has_init)
 		buf_printf(b, " .init = init_module,\n");
 	if (mod->has_cleanup)
Signature · 1 line
1.0.6
#16 lore raw

PATCH 17/26 kbuild: Fix genksyms handling of DEFINE_PER_CPU(struct foo_s *, bar);

In reply to Sam Ravnborg

From: Robin Holt <[email protected]>
Date: 1135129550 -0600

This is a one-line change to parse.y.
To take advantage of this the scripts/genksyms/*_shipped files needs to be rebuild - this is the next patch.

When a .c file contains:
DEFINE_PER_CPU(struct foo_s *, bar);

the .cpp output looks like:
__attribute__((__section__(".data.percpu"))) __typeof__(struct foo_s *) per_cpu__bar;

With the existing parse.y, the value inside the paranthesis of __typeof__() does not evaluate as a type_specifier and therefore per_cpu__bar does not get assigned a type for genksyms which results in the EXPORT_PER_CPU_SYMBOL() not generating a CRC value.

I have compared the Modules.symvers with and without this patch and for ia64's defconfig, the only change is:

Before 0x00000000    per_cpu____sn_nodepda   vmlinux
After  0x9d3f3faa    per_cpu____sn_nodepda   vmlinux

per_cpu____sn_nodepda was the original source of my problems.

---

 scripts/genksyms/parse.y |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

a89a0a2354ae666612968e254d650bfd04f11eb6

scripts/genksyms/parse.y +1 -0
index 0990437..ca04c94 100644
@@ -197,6 +197,7 @@ storage_class_specifier:
 type_specifier:
 	simple_type_specifier
 	| cvar_qualifier
+	| TYPEOF_KEYW '(' decl_specifier_seq '*' ')'
 	| TYPEOF_KEYW '(' decl_specifier_seq ')'
 
 	/* References to s/u/e's defined elsewhere.  Rearrange things
Signature · 1 line
1.0.6
#17 lore raw

Re: [PATCH 17/26] kbuild: Fix genksyms handling of DEFINE_PER_CPU(struct foo_s *, bar);

Quoted 8 lines

This is a one-line change to parse.y.
To take advantage of this the scripts/genksyms/*_shipped files needs to be rebuild - this is the next patch.

When a .c file contains:
DEFINE_PER_CPU(struct foo_s *, bar);

the .cpp output looks like:

     ^^^^

Are you right about C++?

Jan Engelhardt

#18 lore raw

Re: [PATCH 17/26] kbuild: Fix genksyms handling of DEFINE_PER_CPU(struct foo_s *, bar);

Quoted 11 lines · Jan Engelhardt
Quoted 8 lines

This is a one-line change to parse.y.
To take advantage of this the scripts/genksyms/*_shipped files needs to be rebuild - this is the next patch.

When a .c file contains:
DEFINE_PER_CPU(struct foo_s *, bar);

the .cpp output looks like:

     ^^^^

Are you right about C++?

It's the pre-processed output with DEFINE_PER_CPU expanded, not C++.

Sam

#19 lore raw

Re: [PATCH 17/26] kbuild: Fix genksyms handling of DEFINE_PER_CPU(struct foo_s *, bar);

Quoted 10 lines
Quoted 7 lines
Quoted 4 lines

When a .c file contains:
DEFINE_PER_CPU(struct foo_s *, bar);

the .cpp output looks like:

     ^^^^

Are you right about C++?

It's the pre-processed output with DEFINE_PER_CPU expanded, not C++.

Oh ok. (According to gcc(1), that's called ".i")

Jan Engelhardt

#20 lore raw

Re: [PATCH 17/26] kbuild: Fix genksyms handling of DEFINE_PER_CPU(struct foo_s *, bar);

In reply to Sam Ravnborg

Sam,

I just finally got caught up from vacation and noticed that you do not have a patch which rebuilds keywords.c_shipped, lex.c_shipped, parse.c_shipped, parse.h_shipped. Did I miss a patch in this set?

Thanks,
Robin

#21 lore raw

Re: [PATCH 17/26] kbuild: Fix genksyms handling of DEFINE_PER_CPU(struct foo_s *, bar);

Quoted 5 lines · Robin Holt

Sam,

I just finally got caught up from vacation and noticed that you do not have a patch which rebuilds keywords.c_shipped, lex.c_shipped, parse.c_shipped, parse.h_shipped. Did I miss a patch in this set?

Hi Robin.

I combined them all in one patch wich caused lkml filter to eat it. The patch now includes documentation on version of tools used.

You can see the patch here:
http://www.kernel.org/git/?p=linux/kernel/git/sam/kbuild.git;a=commit;h=c40f56409d01f6f1ea80ed4c229096749c2335df

Since is is all auto-generated code I see no gain in splitting up the code so it can be published on lkml.

Sam

#22 lore raw

PATCH 19/26 kbuild: remove EXPERIMENTAL tag from Module versioning

In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: 1135634642 +0100

Module versioning support has been stable for a loong time so let's get rid of the EXPERIMENTAL tag.

---

 init/Kconfig |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

0d5416433190ee80a8146137dd84613bb9c7ae92

init/Kconfig +2 -2
index ea097e0..11930fb 100644
@@ -460,8 +460,8 @@ config OBSOLETE_MODPARM
 	  If unsure, say Y.
 
 config MODVERSIONS
-	bool "Module versioning support (EXPERIMENTAL)"
-	depends on MODULES && EXPERIMENTAL
+	bool "Module versioning support"
+	depends on MODULES
 	help
 	  Usually, you have to use modules compiled with your kernel.
 	  Saying Y here makes it sometimes possible to use modules
Signature · 1 line
1.0.6
#23 lore raw

PATCH 20/26 kbuild: tags file generation fixup

In reply to Sam Ravnborg

From: Samuel Thibault <[email protected]>
Date: 1135561638 +0100

Here is a fixup for tags file generation, for proper tags of __releases/__acquires functions.

---

 Makefile |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

54e08a2392e99ba9e48ce1060e0b52a39118419c

Makefile +8 -6
index ced0346..922c763 100644
@@ -1236,9 +1236,10 @@ cscope: FORCE
 quiet_cmd_TAGS = MAKE   $@
 define cmd_TAGS
 	rm -f $@; \
-	ETAGSF=`etags --version | grep -i exuberant >/dev/null && \
-                echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
-                --extra=+f --c-kinds=+px"`; \
+	ETAGSF=`etags --version | grep -i exuberant >/dev/null &&     \
+                echo "-I __initdata,__exitdata,__acquires,__releases  \
+                      -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL              \
+                      --extra=+f --c-kinds=+px"`;                     \
                 $(all-sources) | xargs etags $$ETAGSF -a
 endef
 
@@ -1249,9 +1250,10 @@ TAGS: FORCE
 quiet_cmd_tags = MAKE   $@
 define cmd_tags
 	rm -f $@; \
-	CTAGSF=`ctags --version | grep -i exuberant >/dev/null && \
-                echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
-                --extra=+f --c-kinds=+px"`; \
+	CTAGSF=`ctags --version | grep -i exuberant >/dev/null &&     \
+                echo "-I __initdata,__exitdata,__acquires,__releases  \
+                      -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL              \
+                      --extra=+f --c-kinds=+px"`;                     \
                 $(all-sources) | xargs ctags $$CTAGSF -a
 endef
 
Signature · 1 line
1.0.6
#24 lore raw

PATCH 21/26 kbuild: always run 'make silentoldconfig' when tree is cleaned

In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: 1135636443 +0100

If the file .kconfig.d is missing then make sure to run 'make silentoldconfig', since we have no way to detect if a Kconfig file has been updated.

-kconfig.d is created by kconfig and is removed as part of 'make clean' so the situation is likely to occur in reality.

Jan Beulich <[email protected]> reported this bug.

---

 Makefile               |   10 ++++++----
 scripts/kconfig/util.c |    2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

752625cff3eba81cbc886988d5b420064c033948

Makefile +6 -4
index 922c763..d3598ef 100644
@@ -477,18 +477,20 @@ ifeq ($(dot-config),1)
 
 # Read in dependencies to all Kconfig* files, make sure to run
 # oldconfig if changes are detected.
--include .config.cmd
+-include .kconfig.d
 
 include .config
 
 # If .config needs to be updated, it will be done via the dependency
 # that autoconf has on .config.
 # To avoid any implicit rule to kick in, define an empty command
-.config: ;
+.config .kconfig.d: ;
 
 # If .config is newer than include/linux/autoconf.h, someone tinkered
-# with it and forgot to run make oldconfig
-include/linux/autoconf.h: .config
+# with it and forgot to run make oldconfig.
+# If kconfig.d is missing then we are probarly in a cleaned tree so
+# we execute the config step to be sure to catch updated Kconfig files
+include/linux/autoconf.h: .kconfig.d .config
 	$(Q)mkdir -p include/linux
 	$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
 else
scripts/kconfig/util.c +1 -1
index 1fa4c0b..a711007 100644
@@ -33,7 +33,7 @@ int file_write_dep(const char *name)
 	FILE *out;
 
 	if (!name)
-		name = ".config.cmd";
+		name = ".kconfig.d";
 	out = fopen("..config.tmp", "w");
 	if (!out)
 		return 1;
Signature · 1 line
1.0.6
#25 lore raw

PATCH 22/26 gitignore: asm-offsets.h

In reply to Sam Ravnborg

From: Brian Gerst <[email protected]>
Date: 1135743544 -0500

Ignore asm-offsets.h for all arches.

---

 .gitignore                  |    1 +
 include/asm-mips/.gitignore |    1 -
 2 files changed, 1 insertions(+), 1 deletions(-)
 delete mode 100644 include/asm-mips/.gitignore

42f122c8f7e7134c824907358a5df94cfa38946d

.gitignore +1 -0
index 5014bfa..a4b576e 100644
@@ -23,6 +23,7 @@ Module.symvers
 # Generated include files
 #
 include/asm
+include/asm-*/asm-offsets.h
 include/config
 include/linux/autoconf.h
 include/linux/compile.h
include/asm-mips/.gitignore deleted +0 -1
deleted file mode 100644
index 4ec57ad..0000000
@@ -1 +0,0 @@
-asm_offsets.h
Signature · 1 line
1.0.6
#26 lore raw

PATCH 23/26 gitignore: x86_64 files

In reply to Sam Ravnborg

From: Brian Gerst <[email protected]>
Date: 1135744791 -0500

Add filters for x86_64 generated files.

---

 arch/x86_64/boot/.gitignore       |    3 +++
 arch/x86_64/boot/tools/.gitignore |    1 +
 arch/x86_64/ia32/.gitignore       |    1 +
 3 files changed, 5 insertions(+), 0 deletions(-)
 create mode 100644 arch/x86_64/boot/.gitignore
 create mode 100644 arch/x86_64/boot/tools/.gitignore
 create mode 100644 arch/x86_64/ia32/.gitignore

02959a875caec8cabd36111046ad537251ef405f

arch/x86_64/boot/.gitignore new file +3 -0
new file mode 100644
index 0000000..495f20c
@@ -0,0 +1,3 @@
+bootsect
+bzImage
+setup
arch/x86_64/boot/tools/.gitignore new file +1 -0
new file mode 100644
index 0000000..378eac2
@@ -0,0 +1 @@
+build
arch/x86_64/ia32/.gitignore new file +1 -0
new file mode 100644
index 0000000..48ab174
@@ -0,0 +1 @@
+vsyscall*.so
Signature · 1 line
1.0.6
#27 lore raw

Re: [PATCH 23/26] gitignore: x86_64 files

Quoted 4 lines · Sam Ravnborg

From: Brian Gerst <[email protected]>
Date: 1135744791 -0500

Add filters for x86_64 generated files.

Please don't submit this patch. If anything such ignore lists for specific SVMs should be in a central place, but not spread everywhere.

-Andi

#28 lore raw

Re: [PATCH 23/26] gitignore: x86_64 files

Quoted 10 lines · Andi Kleen
Quoted 4 lines · Sam Ravnborg

From: Brian Gerst <[email protected]>
Date: 1135744791 -0500

Add filters for x86_64 generated files.

Please don't submit this patch. If anything such ignore lists for specific SVMs should be in a central place, but not spread everywhere.

If we go for a central '.gitignore' then we will most probarly see a file that is only added entries to, not removed. We saw that in the bk days.
Today there are 23 .gitignores in the kernel - including the ones from this patchset.
In may other cases we avoid this central point of information disaster and we shall avoid it for .gitignore too.

Sam

#29 lore raw

Re: [PATCH 23/26] gitignore: x86_64 files

Quoted 8 lines · Sam Ravnborg
Quoted 7 lines · Andi Kleen
Quoted 4 lines · Sam Ravnborg

From: Brian Gerst <[email protected]>
Date: 1135744791 -0500

Add filters for x86_64 generated files.

Quoted 7 lines
Quoted 3 lines

Please don't submit this patch. If anything such ignore lists for specific SVMs should be in a central place, but not spread everywhere.

If we go for a central '.gitignore' then we will most probarly see a file that is only added entries to, not removed. We saw that in the bk days.

And what's the problem with that?

Quoted 2 lines

Today there are 23 .gitignores in the kernel - including the ones from this patchset.

And next year .cvsignores and .svnignores and .hgignores and .whateveriscurrentlyenvoguesvmignores ?

Quoted 2 lines

In may other cases we avoid this central point of information disaster and we shall avoid it for .gitignore too.

Please do that outside arch/x86_64 then.

-Andi

#30 lore raw

Re: [PATCH 23/26] gitignore: x86_64 files

Quoted 5 lines · Andi Kleen
Quoted 2 lines

Today there are 23 .gitignores in the kernel - including the ones from this patchset.

And next year .cvsignores and .svnignores and .hgignores and .whateveriscurrentlyenvoguesvmignores ?

The correct fix would be:
Make 'O=$somedir' mandatory.

Signature · 2 lines
short story of a lazy sysadmin:
 alias appserv=wotan
#31 lore raw

Re: [PATCH 23/26] gitignore: x86_64 files

In reply to Andi Kleen
Quoted 5 lines · Andi Kleen
Quoted 2 lines

Today there are 23 .gitignores in the kernel - including the ones from this patchset.

And next year .cvsignores and .svnignores and .hgignores and .whateveriscurrentlyenvoguesvmignores ?

The kernel will contain files relevant for the main SCM used for kernel development. If people prefer bk, cvs, hg or whatever they will most likely have similar info in a branch that never hits mainline.

Not maintaining a set of .gitignore files for x86_64 will hit all users of git for x86_64.
Having a file in arch/ containing a list of generated files for each and every arch does confilt with the distributed nature of how SW is developed for the kernel.

The files are hidden for all normal cases so they should not hurt - or?

Added Linus to this thread - he was the one that wrote this in top-level .gitignore:

# NOTE! Don't add files that are generated in specific

# subdirectories here. Add them in the ".gitignore" file
# in that subdirectory instead.

Sam

#32 lore raw

Re: [PATCH 23/26] gitignore: x86_64 files

In reply to Andi Kleen
Quoted 6 lines · Andi Kleen
Quoted 3 lines · Sam Ravnborg

From: Brian Gerst <[email protected]>
Date: 1135744791 -0500

Quoted 7 lines
Quoted 1 line

Add filters for x86_64 generated files.

Please don't submit this patch. If anything such ignore lists for specific SVMs should be in a central place, but not spread everywhere.

It makes good sense to have .*ignore files in the same directory as the Makefile that produces the ignored files. They are more likely to be maintained when they are in the same location.

Git is the SCM du jour for kernel work. If you chose to use another SCM then these files don't hinder you at all.

--
Brian Gerst

#33 lore raw

PATCH 24/26 gitignore: misc files

In reply to Sam Ravnborg

From: Brian Gerst <[email protected]>
Date: 1135745011 -0500

Ignore all files generated from *_shipped files, plus a few others.

---

 drivers/char/.gitignore         |    2 +-
 drivers/ieee1394/.gitignore     |    1 +
 drivers/md/.gitignore           |    4 ++++
 drivers/net/wan/.gitignore      |    1 +
 drivers/scsi/.gitignore         |    3 +++
 drivers/scsi/aic7xxx/.gitignore |    6 ++++++
 scripts/genksyms/.gitignore     |    4 ++++
 scripts/kconfig/.gitignore      |    1 +
 8 files changed, 21 insertions(+), 1 deletions(-)
 create mode 100644 drivers/ieee1394/.gitignore
 create mode 100644 drivers/md/.gitignore
 create mode 100644 drivers/net/wan/.gitignore
 create mode 100644 drivers/scsi/.gitignore
 create mode 100644 drivers/scsi/aic7xxx/.gitignore
 create mode 100644 scripts/genksyms/.gitignore

352dd1df32e672be4cff71132eb9c06a257872fe

drivers/char/.gitignore +1 -1
index 2b6b1d7..73dfdce 100644
@@ -1,3 +1,3 @@
 consolemap_deftbl.c
 defkeymap.c
-
+qtronixmap.c
drivers/ieee1394/.gitignore new file +1 -0
new file mode 100644
index 0000000..33da10a
@@ -0,0 +1 @@
+oui.c
drivers/md/.gitignore new file +4 -0
new file mode 100644
index 0000000..a7afec6
@@ -0,0 +1,4 @@
+mktables
+raid6altivec*.c
+raid6int*.c
+raid6tables.c
drivers/net/wan/.gitignore new file +1 -0
new file mode 100644
index 0000000..dae3ea6
@@ -0,0 +1 @@
+wanxlfw.inc
drivers/scsi/.gitignore new file +3 -0
new file mode 100644
index 0000000..b385af3
@@ -0,0 +1,3 @@
+53c700_d.h
+53c7xx_d.h
+53c7xx_u.h
drivers/scsi/aic7xxx/.gitignore new file +6 -0
new file mode 100644
index 0000000..b8ee24d
@@ -0,0 +1,6 @@
+aic79xx_reg.h
+aic79xx_reg_print.c
+aic79xx_seq.h
+aic7xxx_reg.h
+aic7xxx_reg_print.c
+aic7xxx_seq.h
scripts/genksyms/.gitignore new file +4 -0
new file mode 100644
index 0000000..be5cadb
@@ -0,0 +1,4 @@
+keywords.c
+lex.c
+parse.[ch]
+genksyms
scripts/kconfig/.gitignore +1 -0
index 2dac344..e8ad1f6 100644
@@ -5,6 +5,7 @@ config*
 lex.*.c
 *.tab.c
 *.tab.h
+zconf.hash.c
 
 #
 # configuration programs
Signature · 1 line
1.0.6
#34 lore raw

PATCH 25/26 kconfig: Remove support for lxdialog --checklist

In reply to Sam Ravnborg

From: Petr Baudis <[email protected]>
Date: 1135223044 +0100

Remove support for lxdialog --checklist

The checklist lxdialog functionality is not used by menuconfig (only the radiolist variant is used) and supporting it would significantly complicate the forthcoming liblxdialog API.

---

 scripts/kconfig/lxdialog/checklist.c |   47 ++++++++++------------------------
 scripts/kconfig/lxdialog/dialog.h    |    9 +------
 scripts/kconfig/lxdialog/lxdialog.c  |   12 +--------
 3 files changed, 17 insertions(+), 51 deletions(-)

00213b17cec87d2cd4df75bcc79aea7a91d8532d

scripts/kconfig/lxdialog/checklist.c +14 -33
index 3fb681f..db07ae7 100644
@@ -23,7 +23,7 @@
 
 #include "dialog.h"
 
-static int list_width, check_x, item_x, checkflag;
+static int list_width, check_x, item_x;
 
 /*
  * Print list item
@@ -41,10 +41,7 @@ static void print_item(WINDOW * win, con
 
 	wmove(win, choice, check_x);
 	wattrset(win, selected ? check_selected_attr : check_attr);
-	if (checkflag == FLAG_CHECK)
-		wprintw(win, "[%c]", status ? 'X' : ' ');
-	else
-		wprintw(win, "(%c)", status ? 'X' : ' ');
+	wprintw(win, "(%c)", status ? 'X' : ' ');
 
 	wattrset(win, selected ? tag_selected_attr : tag_attr);
 	mvwaddch(win, choice, item_x, item[0]);
@@ -109,18 +106,16 @@ static void print_buttons(WINDOW * dialo
 
 /*
  * Display a dialog box with a list of options that can be turned on or off
- * The `flag' parameter is used to select between radiolist and checklist.
+ * in the style of radiolist (only one option turned on at a time).
  */
 int dialog_checklist(const char *title, const char *prompt, int height,
 		     int width, int list_height, int item_no,
-		     const char *const *items, int flag)
+		     const char *const *items)
 {
 	int i, x, y, box_x, box_y;
 	int key = 0, button = 0, choice = 0, scroll = 0, max_choice, *status;
 	WINDOW *dialog, *list;
 
-	checkflag = flag;
-
 	/* Allocate space for storing item on/off status */
 	if ((status = malloc(sizeof(int) * item_no)) == NULL) {
 		endwin();
@@ -303,34 +298,20 @@ int dialog_checklist(const char *title, 
 		case ' ':
 		case '\n':
 			if (!button) {
-				if (flag == FLAG_CHECK) {
-					status[scroll + choice] = !status[scroll + choice];
-					wmove(list, choice, check_x);
-					wattrset(list, check_selected_attr);
-					wprintw(list, "[%c]", status[scroll + choice] ? 'X' : ' ');
-				} else {
-					if (!status[scroll + choice]) {
-						for (i = 0; i < item_no; i++)
-							status[i] = 0;
-						status[scroll + choice] = 1;
-						for (i = 0; i < max_choice; i++)
-							print_item(list, items[(scroll + i) * 3 + 1],
-								   status[scroll + i], i, i == choice);
-					}
+				if (!status[scroll + choice]) {
+					for (i = 0; i < item_no; i++)
+						status[i] = 0;
+					status[scroll + choice] = 1;
+					for (i = 0; i < max_choice; i++)
+						print_item(list, items[(scroll + i) * 3 + 1],
+							   status[scroll + i], i, i == choice);
 				}
 				wnoutrefresh(list);
 				wrefresh(dialog);
 
-				for (i = 0; i < item_no; i++) {
-					if (status[i]) {
-						if (flag == FLAG_CHECK) {
-							fprintf(stderr, "\"%s\" ", items[i * 3]);
-						} else {
-							fprintf(stderr, "%s", items[i * 3]);
-						}
-
-					}
-				}
+				for (i = 0; i < item_no; i++)
+					if (status[i])
+						fprintf(stderr, "%s", items[i * 3]);
 			} else
 				fprintf(stderr, "%s", items[(scroll + choice) * 3]);
 			delwin(dialog);
scripts/kconfig/lxdialog/dialog.h +1 -8
index f882204..af3cf71 100644
@@ -160,7 +160,7 @@ int dialog_menu(const char *title, const
 		const char *const *items);
 int dialog_checklist(const char *title, const char *prompt, int height,
 		     int width, int list_height, int item_no,
-		     const char *const *items, int flag);
+		     const char *const *items);
 extern char dialog_input_result[];
 int dialog_inputbox(const char *title, const char *prompt, int height,
 		    int width, const char *init);
@@ -175,10 +175,3 @@ int dialog_inputbox(const char *title, c
  *   -- uppercase chars are used to invoke the button (M_EVENT + 'O')
  */
 #define M_EVENT (KEY_MAX+1)
-
-/*
- * The `flag' parameter in checklist is used to select between
- * radiolist and checklist
- */
-#define FLAG_CHECK 1
-#define FLAG_RADIO 0
scripts/kconfig/lxdialog/lxdialog.c +2 -10
index 2c34ea1..79f6c5f 100644
@@ -31,12 +31,11 @@ struct Mode {
 	jumperFn *jumper;
 };
 
-jumperFn j_menu, j_checklist, j_radiolist, j_yesno, j_textbox, j_inputbox;
+jumperFn j_menu, j_radiolist, j_yesno, j_textbox, j_inputbox;
 jumperFn j_msgbox, j_infobox;
 
 static struct Mode modes[] = {
 	{"--menu", 9, 0, 3, j_menu},
-	{"--checklist", 9, 0, 3, j_checklist},
 	{"--radiolist", 9, 0, 3, j_radiolist},
 	{"--yesno", 5, 5, 1, j_yesno},
 	{"--textbox", 5, 5, 1, j_textbox},
@@ -151,7 +150,6 @@ static void Usage(const char *name)
 \nBox options:\
 \n\
 \n  --menu      <text> <height> <width> <menu height> <tag1> <item1>...\
-\n  --checklist <text> <height> <width> <list height> <tag1> <item1> <status1>...\
 \n  --radiolist <text> <height> <width> <list height> <tag1> <item1> <status1>...\
 \n  --textbox   <file> <height> <width>\
 \n  --inputbox  <text> <height> <width> [<init>]\
@@ -170,16 +168,10 @@ int j_menu(const char *t, int ac, const 
 			   atoi(av[5]), av[6], (ac - 6) / 2, av + 7);
 }
 
-int j_checklist(const char *t, int ac, const char *const *av)
-{
-	return dialog_checklist(t, av[2], atoi(av[3]), atoi(av[4]),
-				atoi(av[5]), (ac - 6) / 3, av + 6, FLAG_CHECK);
-}
-
 int j_radiolist(const char *t, int ac, const char *const *av)
 {
 	return dialog_checklist(t, av[2], atoi(av[3]), atoi(av[4]),
-				atoi(av[5]), (ac - 6) / 3, av + 6, FLAG_RADIO);
+				atoi(av[5]), (ac - 6) / 3, av + 6);
 }
 
 int j_textbox(const char *t, int ac, const char *const *av)
Signature · 1 line
1.0.6
#35 lore raw

PATCH 26/26 gitignore: ignore more generated files

In reply to Sam Ravnborg

---

 kernel/.gitignore                   |    5 +++++
 scripts/.gitignore                  |    5 ++++-
 scripts/kconfig/lxdialog/.gitignore |    4 ++++
 3 files changed, 13 insertions(+), 1 deletions(-)
 create mode 100644 kernel/.gitignore
 create mode 100644 scripts/kconfig/lxdialog/.gitignore

febf7ea4bedcd36fba0843db726bba28d22bf89a

kernel/.gitignore new file +5 -0
new file mode 100644
index 0000000..f2ab700
@@ -0,0 +1,5 @@
+#
+# Generated files
+#
+config_data.h
+config_data.gz
scripts/.gitignore +4 -1
index b46d68b..a234e52 100644
@@ -1,4 +1,7 @@
+#
+# Generated files
+#
 conmakehash
 kallsyms
 pnmtologo
-
+bin2c
scripts/kconfig/lxdialog/.gitignore new file +4 -0
new file mode 100644
index 0000000..90b08ff
@@ -0,0 +1,4 @@
+#
+# Generated files
+#
+lxdialog
Signature · 1 line
1.0.6
#36 lore raw
In reply to Sam Ravnborg
Quoted 5 lines · Sam Ravnborg

Accumulated kbuild + kconfig updates for 2.6.16-rc.

The updates are available in the origin branch at my build git repository. Please pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild.git from the origin branch.

Due to my ignorance of/missing understanding of branches in git one patch were missing in the origin branch.

It was in the master branch instead - so I have pulled in the master branch in the origin branch and updated the kbuild repository.

It is following patch:
Jan-Benedict Glaw
kbuild: tar-pkg with out-out-tree building

Sam

#37 lore raw

PATCH 1/1 kbuild: tar-pkg with out-out-tree building

diff-tree 6073aa643f52fd12b02f0532dc96287f4c3293b5 (from 752625cff3eba81cbc886988d5b420064c033948)

Author: Jan-Benedict Glaw <[email protected]>
Date:   Sun Jan 1 14:23:47 2006 +0100

kbuild: tar-pkg with out-out-tree building

Fix out-of-tree builds for the tar-pkg targets

When I wrote the buildtar script, I didn't even think about out-of-tree builds because I didn't use these back then. This patch throughoutly uses ${objtree} instead of pwd.

Also, the kernel version is no longer manually built. Instead, it will properly use $KERNELRELEASE . Installing modules is only done if CONFIG_MODULES is set.

scripts/package/Makefile +1 -1
index f3e7e8e..c201ef0 100644
@@ -82,11 +82,11 @@ clean-dirs += $(objtree)/debian/
 
 # tarball targets
 # ---------------------------------------------------------------------------
 .PHONY: tar%pkg
 tar%pkg:
-	$(MAKE)
+	$(MAKE) KBUILD_SRC=
 	$(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@
 
 clean-dirs += $(objtree)/tar-install/
 
 
scripts/package/buildtar +13 -18
index d8fffe6..88b5281 100644
@@ -1,11 +1,11 @@
 #!/bin/sh
 
 #
-# buildtar 0.0.3
+# buildtar 0.0.4
 #
-# (C) 2004-2005 by Jan-Benedict Glaw <[email protected]>
+# (C) 2004-2006 by Jan-Benedict Glaw <[email protected]>
 #
 # This script is used to compile a tarball from the currently
 # prepared kernel. Based upon the builddeb script from
 # Wichert Akkerman <[email protected]>.
 #
@@ -13,13 +13,12 @@
 set -e
 
 #
 # Some variables and settings used throughout the script
 #
-version="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}${EXTRANAME}"
 tmpdir="${objtree}/tar-install"
-tarball="${objtree}/linux-${version}.tar"
+tarball="${objtree}/linux-${KERNELRELEASE}.tar"
 
 
 #
 # Figure out how to compress, if requested at all
 #
@@ -51,43 +50,39 @@ mkdir -p -- "${tmpdir}/boot"
 
 
 #
 # Try to install modules
 #
-if ! make INSTALL_MOD_PATH="${tmpdir}" modules_install; then
-	echo "" >&2
-	echo "Ignoring error at module_install time, since that could be" >&2
-	echo "a result of missing local modutils/module-init-tools," >&2
-	echo "or you just didn't compile in module support at all..." >&2
-	echo "" >&2
+if grep -q '^CONFIG_MODULES=y' "${objtree}/.config"; then
+	make ARCH="${ARCH}" O="${objtree}" KBUILD_SRC= INSTALL_MOD_PATH="${tmpdir}" modules_install
 fi
 
 
 #
 # Install basic kernel files
 #
-cp -v -- System.map "${tmpdir}/boot/System.map-${version}"
-cp -v -- .config "${tmpdir}/boot/config-${version}"
-cp -v -- vmlinux "${tmpdir}/boot/vmlinux-${version}"
+cp -v -- "${objtree}/System.map" "${tmpdir}/boot/System.map-${KERNELRELEASE}"
+cp -v -- "${objtree}/.config" "${tmpdir}/boot/config-${KERNELRELEASE}"
+cp -v -- "${objtree}/vmlinux" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}"
 
 
 #
 # Install arch-specific kernel image(s)
 #
 case "${ARCH}" in
 	i386)
-		[ -f arch/i386/boot/bzImage ] && cp -v -- arch/i386/boot/bzImage "${tmpdir}/boot/vmlinuz-${version}"
+		[ -f "${objtree}/arch/i386/boot/bzImage" ] && cp -v -- "${objtree}/arch/i386/boot/bzImage" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}"
 		;;
 	alpha)
-		[ -f arch/alpha/boot/vmlinux.gz ] && cp -v -- arch/alpha/boot/vmlinux.gz "${tmpdir}/boot/vmlinuz-${version}"
+		[ -f "${objtree}/arch/alpha/boot/vmlinux.gz" ] && cp -v -- "${objtree}/arch/alpha/boot/vmlinux.gz" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}"
 		;;
 	vax)
-		[ -f vmlinux.SYS ] && cp -v -- vmlinux.SYS "${tmpdir}/boot/vmlinux-${version}.SYS"
-		[ -f vmlinux.dsk ] && cp -v -- vmlinux.dsk "${tmpdir}/boot/vmlinux-${version}.dsk"
+		[ -f "${objtree}/vmlinux.SYS" ] && cp -v -- "${objtree}/vmlinux.SYS" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}.SYS"
+		[ -f "${objtree}/vmlinux.dsk" ] && cp -v -- "${objtree}/vmlinux.dsk" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}.dsk"
 		;;
 	*)
-		[ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-kbuild-${version}"
+		[ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-kbuild-${KERNELRELEASE}"
 		echo "" >&2
 		echo '** ** **  WARNING  ** ** **' >&2
 		echo "" >&2
 		echo "Your architecture did not define any architecture-dependant files" >&2
 		echo "to be placed into the tarball. Please add those to ${0} ..." >&2