Selaa lähdekoodia

Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild: (38 commits)
  kconfig: fix mconf segmentation fault
  kbuild: enable use of code from a different dir
  kconfig: error out if recursive dependencies are found
  kbuild: scripts/basic/fixdep segfault on pathological string-o-death
  kconfig: correct minor typo in Kconfig warning message.
  kconfig: fix path to modules.txt in Kconfig help
  usr/Kconfig: fix typo
  kernel-doc: alphabetically-sorted entries in index.html of 'htmldocs'
  kbuild: be more explicit on missing .config file
  kbuild: clarify the creation of the LOCALVERSION_AUTO string.
  kbuild: propagate errors from find in scripts/gen_initramfs_list.sh
  kconfig: refer to qt3 if we cannot find qt libraries
  kbuild: handle compressed cpio initramfs-es
  kbuild: ignore section mismatch warning for references from .paravirtprobe to .init.text
  kbuild: remove stale comment in modpost.c
  kbuild/mkuboot.sh: allow spaces in CROSS_COMPILE
  kbuild: fix make mrproper for Documentation/DocBook/man
  kbuild: remove kconfig binaries during make mrproper
  kconfig/menuconfig: do not hardcode '.config'
  kbuild: override build timestamp & version
  ...
Linus Torvalds 18 vuotta sitten
vanhempi
commit
15700770ef
47 muutettua tiedostoa jossa 766 lisäystä ja 168 poistoa
  1. 3 6
      Documentation/DocBook/Makefile
  2. 0 3
      Documentation/DocBook/man/Makefile
  3. 1 1
      Documentation/kbuild/modules.txt
  4. 11 0
      Kbuild
  5. 9 6
      Makefile
  6. 2 2
      drivers/mtd/devices/Kconfig
  7. 3 3
      drivers/net/Kconfig
  8. 6 6
      drivers/net/wireless/Kconfig
  9. 2 2
      drivers/scsi/Kconfig
  10. 4 4
      drivers/video/Kconfig
  11. 4 0
      include/linux/input.h
  12. 1 0
      include/linux/mod_devicetable.h
  13. 10 6
      init/Kconfig
  14. 3 3
      init/main.c
  15. 3 0
      lib/Kconfig.debug
  16. 1 1
      net/ipv6/netfilter/Kconfig
  17. 12 12
      net/netfilter/Kconfig
  18. 1 1
      net/tipc/Kconfig
  19. 9 10
      scripts/Makefile.build
  20. 7 7
      scripts/Makefile.host
  21. 4 4
      scripts/Makefile.modpost
  22. 2 0
      scripts/basic/fixdep.c
  23. 118 0
      scripts/checksyscalls.sh
  24. 126 0
      scripts/cleanfile
  25. 206 0
      scripts/cleanpatch
  26. 9 3
      scripts/gen_initramfs_list.sh
  27. 3 2
      scripts/kconfig/Makefile
  28. 1 0
      scripts/kconfig/conf.c
  29. 1 1
      scripts/kconfig/lex.zconf.c_shipped
  30. 1 0
      scripts/kconfig/lkc.h
  31. 1 0
      scripts/kconfig/lxdialog/dialog.h
  32. 7 2
      scripts/kconfig/lxdialog/util.c
  33. 31 12
      scripts/kconfig/mconf.c
  34. 1 1
      scripts/kconfig/menu.c
  35. 4 1
      scripts/kconfig/qconf.cc
  36. 1 1
      scripts/kconfig/qconf.h
  37. 5 8
      scripts/kconfig/symbol.c
  38. 1 1
      scripts/kconfig/zconf.l
  39. 4 2
      scripts/kconfig/zconf.tab.c_shipped
  40. 4 2
      scripts/kconfig/zconf.y
  41. 20 7
      scripts/mkcompile_h
  42. 1 1
      scripts/mkuboot.sh
  43. 11 10
      scripts/mod/file2alias.c
  44. 108 33
      scripts/mod/modpost.c
  45. 1 0
      scripts/mod/modpost.h
  46. 2 3
      scripts/mod/sumversion.c
  47. 1 1
      usr/Kconfig

+ 3 - 6
Documentation/DocBook/Makefile

@@ -41,7 +41,7 @@ psdocs: $(PS)
 PDF := $(patsubst %.xml, %.pdf, $(BOOKS))
 PDF := $(patsubst %.xml, %.pdf, $(BOOKS))
 pdfdocs: $(PDF)
 pdfdocs: $(PDF)
 
 
-HTML := $(patsubst %.xml, %.html, $(BOOKS))
+HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS)))
 htmldocs: $(HTML)
 htmldocs: $(HTML)
 
 
 MAN := $(patsubst %.xml, %.9, $(BOOKS))
 MAN := $(patsubst %.xml, %.9, $(BOOKS))
@@ -152,6 +152,7 @@ quiet_cmd_db2man = MAN     $@
 	@(which xmlto > /dev/null 2>&1) || \
 	@(which xmlto > /dev/null 2>&1) || \
 	 (echo "*** You need to install xmlto ***"; \
 	 (echo "*** You need to install xmlto ***"; \
 	  exit 1)
 	  exit 1)
+	$(Q)mkdir -p $(obj)/man
 	$(call cmd,db2man)
 	$(call cmd,db2man)
 	@touch $@
 	@touch $@
 
 
@@ -212,11 +213,7 @@ clean-files := $(DOCBOOKS) \
 	$(patsubst %.xml, %.9,    $(DOCBOOKS)) \
 	$(patsubst %.xml, %.9,    $(DOCBOOKS)) \
 	$(C-procfs-example)
 	$(C-procfs-example)
 
 
-clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS))
-
-#man put files in man subdir - traverse down
-subdir- := man/
-
+clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man
 
 
 # Declare the contents of the .PHONY variable as phony.  We keep that
 # Declare the contents of the .PHONY variable as phony.  We keep that
 # information in a variable se we can use it in if_changed and friends.
 # information in a variable se we can use it in if_changed and friends.

+ 0 - 3
Documentation/DocBook/man/Makefile

@@ -1,3 +0,0 @@
-# Rules are put in Documentation/DocBook
-
-clean-files := *.9.gz *.sgml manpage.links manpage.refs

+ 1 - 1
Documentation/kbuild/modules.txt

@@ -249,7 +249,7 @@ following files:
 		--> filename: Makefile
 		--> filename: Makefile
 		KERNELDIR := /lib/modules/`uname -r`/build
 		KERNELDIR := /lib/modules/`uname -r`/build
 		all::
 		all::
-			$(MAKE) -C $KERNELDIR M=`pwd` $@
+			$(MAKE) -C $(KERNELDIR) M=`pwd` $@
 
 
 		# Module specific targets
 		# Module specific targets
 		genbin:
 		genbin:

+ 11 - 0
Kbuild

@@ -2,6 +2,7 @@
 # Kbuild for top-level directory of the kernel
 # Kbuild for top-level directory of the kernel
 # This file takes care of the following:
 # This file takes care of the following:
 # 1) Generate asm-offsets.h
 # 1) Generate asm-offsets.h
+# 2) Check for missing system calls
 
 
 #####
 #####
 # 1) Generate asm-offsets.h
 # 1) Generate asm-offsets.h
@@ -46,3 +47,13 @@ $(obj)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild
 	$(Q)mkdir -p $(dir $@)
 	$(Q)mkdir -p $(dir $@)
 	$(call cmd,offsets)
 	$(call cmd,offsets)
 
 
+#####
+# 2) Check for missing system calls
+#
+
+quiet_cmd_syscalls = CALL    $<
+      cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags)
+
+PHONY += missing-syscalls
+missing-syscalls: scripts/checksyscalls.sh FORCE
+	$(call cmd,syscalls)

+ 9 - 6
Makefile

@@ -576,7 +576,7 @@ libs-y		:= $(libs-y1) $(libs-y2)
 # ---------------------------------------------------------------------------
 # ---------------------------------------------------------------------------
 # vmlinux is built from the objects selected by $(vmlinux-init) and
 # vmlinux is built from the objects selected by $(vmlinux-init) and
 # $(vmlinux-main). Most are built-in.o files from top-level directories
 # $(vmlinux-main). Most are built-in.o files from top-level directories
-# in the kernel tree, others are specified in arch/$(ARCH)Makefile.
+# in the kernel tree, others are specified in arch/$(ARCH)/Makefile.
 # Ordering when linking is important, and $(vmlinux-init) must be first.
 # Ordering when linking is important, and $(vmlinux-init) must be first.
 #
 #
 # vmlinux
 # vmlinux
@@ -603,6 +603,7 @@ vmlinux-init := $(head-y) $(init-y)
 vmlinux-main := $(core-y) $(libs-y) $(drivers-y) $(net-y)
 vmlinux-main := $(core-y) $(libs-y) $(drivers-y) $(net-y)
 vmlinux-all  := $(vmlinux-init) $(vmlinux-main)
 vmlinux-all  := $(vmlinux-init) $(vmlinux-main)
 vmlinux-lds  := arch/$(ARCH)/kernel/vmlinux.lds
 vmlinux-lds  := arch/$(ARCH)/kernel/vmlinux.lds
+export KBUILD_VMLINUX_OBJS := $(vmlinux-all)
 
 
 # Rule to link vmlinux - also used during CONFIG_KALLSYMS
 # Rule to link vmlinux - also used during CONFIG_KALLSYMS
 # May be overridden by arch/$(ARCH)/Makefile
 # May be overridden by arch/$(ARCH)/Makefile
@@ -855,6 +856,7 @@ archprepare: prepare1 scripts_basic
 
 
 prepare0: archprepare FORCE
 prepare0: archprepare FORCE
 	$(Q)$(MAKE) $(build)=.
 	$(Q)$(MAKE) $(build)=.
+	$(Q)$(MAKE) $(build)=. missing-syscalls
 
 
 # All the preparing..
 # All the preparing..
 prepare: prepare0
 prepare: prepare0
@@ -1277,10 +1279,7 @@ endif
 ALLSOURCE_ARCHS := $(ARCH)
 ALLSOURCE_ARCHS := $(ARCH)
 
 
 define find-sources
 define find-sources
-        ( find $(__srctree) $(RCS_FIND_IGNORE) \
-	       \( -name include -o -name arch \) -prune -o \
-	       -name $1 -print; \
-	  for ARCH in $(ALLSOURCE_ARCHS) ; do \
+        ( for ARCH in $(ALLSOURCE_ARCHS) ; do \
 	       find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \
 	       find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \
 	            -name $1 -print; \
 	            -name $1 -print; \
 	  done ; \
 	  done ; \
@@ -1294,7 +1293,11 @@ define find-sources
 	            -name $1 -print; \
 	            -name $1 -print; \
 	  done ; \
 	  done ; \
 	  find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
 	  find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
-	       -name $1 -print )
+	       -name $1 -print; \
+	  find $(__srctree) $(RCS_FIND_IGNORE) \
+	       \( -name include -o -name arch \) -prune -o \
+	       -name $1 -print; \
+	  )
 endef
 endef
 
 
 define all-sources
 define all-sources

+ 2 - 2
drivers/mtd/devices/Kconfig

@@ -49,8 +49,8 @@ config MTD_MS02NV
 
 
 	  If you want to compile this driver as a module ( = code which can be
 	  If you want to compile this driver as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
 	  inserted in and removed from the running kernel whenever you want),
-	  say M here and read <file:Documentation/modules.txt>.  The module will
-	  be called ms02-nv.o.
+	  say M here and read <file:Documentation/kbuild/modules.txt>.
+	  The module will be called ms02-nv.ko.
 
 
 config MTD_DATAFLASH
 config MTD_DATAFLASH
 	tristate "Support for AT45xxx DataFlash"
 	tristate "Support for AT45xxx DataFlash"

+ 3 - 3
drivers/net/Kconfig

@@ -833,8 +833,8 @@ config SMC91X
 	  This driver is also available as a module ( = code which can be
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
 	  inserted in and removed from the running kernel whenever you want).
 	  The module will be called smc91x.  If you want to compile it as a
 	  The module will be called smc91x.  If you want to compile it as a
-	  module, say M here and read <file:Documentation/modules.txt> as well
-	  as <file:Documentation/networking/net-modules.txt>.
+	  module, say M here and read <file:Documentation/kbuild/modules.txt>
+	  as well as <file:Documentation/networking/net-modules.txt>.
 
 
 config SMC9194
 config SMC9194
 	tristate "SMC 9194 support"
 	tristate "SMC 9194 support"
@@ -889,7 +889,7 @@ config SMC911X
 
 
 	  This driver is also available as a module. The module will be 
 	  This driver is also available as a module. The module will be 
 	  called smc911x.  If you want to compile it as a module, say M 
 	  called smc911x.  If you want to compile it as a module, say M 
-	  here and read <file:Documentation/modules.txt>
+	  here and read <file:Documentation/kbuild/modules.txt>
 
 
 config NET_VENDOR_RACAL
 config NET_VENDOR_RACAL
 	bool "Racal-Interlan (Micom) NI cards"
 	bool "Racal-Interlan (Micom) NI cards"

+ 6 - 6
drivers/net/wireless/Kconfig

@@ -153,8 +153,8 @@ config IPW2100
  
  
           If you want to compile the driver as a module ( = code which can be
           If you want to compile the driver as a module ( = code which can be
           inserted in and removed from the running kernel whenever you want),
           inserted in and removed from the running kernel whenever you want),
-          say M here and read <file:Documentation/modules.txt>.  The module
-          will be called ipw2100.ko.
+          say M here and read <file:Documentation/kbuild/modules.txt>.
+          The module will be called ipw2100.ko.
 	
 	
 config IPW2100_MONITOR
 config IPW2100_MONITOR
         bool "Enable promiscuous mode"
         bool "Enable promiscuous mode"
@@ -208,8 +208,8 @@ config IPW2200
  
  
           If you want to compile the driver as a module ( = code which can be
           If you want to compile the driver as a module ( = code which can be
           inserted in and removed from the running kernel whenever you want),
           inserted in and removed from the running kernel whenever you want),
-          say M here and read <file:Documentation/modules.txt>.  The module
-          will be called ipw2200.ko.
+          say M here and read <file:Documentation/kbuild/modules.txt>.
+          The module will be called ipw2200.ko.
 
 
 config IPW2200_MONITOR
 config IPW2200_MONITOR
         bool "Enable promiscuous mode"
         bool "Enable promiscuous mode"
@@ -517,8 +517,8 @@ config PRISM54
 	  
 	  
 	  If you want to compile the driver as a module ( = code which can be
 	  If you want to compile the driver as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
 	  inserted in and removed from the running kernel whenever you want),
-	  say M here and read <file:Documentation/modules.txt>.  The module
-	  will be called prism54.ko.
+	  say M here and read <file:Documentation/kbuild/modules.txt>.
+	  The module will be called prism54.ko.
 
 
 config USB_ZD1201
 config USB_ZD1201
 	tristate "USB ZD1201 based Wireless device support"
 	tristate "USB ZD1201 based Wireless device support"

+ 2 - 2
drivers/scsi/Kconfig

@@ -170,7 +170,7 @@ config CHR_DEV_SCH
 	
 	
 	  If you want to compile this as a module ( = code which can be
 	  If you want to compile this as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want),
 	  inserted in and removed from the running kernel whenever you want),
-	  say M here and read <file:Documentation/modules.txt> and
+	  say M here and read <file:Documentation/kbuild/modules.txt> and
 	  <file:Documentation/scsi.txt>. The module will be called ch.o.
 	  <file:Documentation/scsi.txt>. The module will be called ch.o.
 	  If unsure, say N.
 	  If unsure, say N.
 	
 	
@@ -1783,7 +1783,7 @@ config ZFCP
 
 
           This driver is also available as a module. This module will be
           This driver is also available as a module. This module will be
           called zfcp. If you want to compile it as a module, say M here
           called zfcp. If you want to compile it as a module, say M here
-          and read <file:Documentation/modules.txt>.
+          and read <file:Documentation/kbuild/modules.txt>.
 
 
 config SCSI_SRP
 config SCSI_SRP
 	tristate "SCSI RDMA Protocol helper library"
 	tristate "SCSI RDMA Protocol helper library"

+ 4 - 4
drivers/video/Kconfig

@@ -191,7 +191,7 @@ config FB_ARMCLCD
 
 
 	  If you want to compile this as a module (=code which can be
 	  If you want to compile this as a module (=code which can be
 	  inserted into and removed from the running kernel), say M
 	  inserted into and removed from the running kernel), say M
-	  here and read <file:Documentation/modules.txt>.  The module
+	  here and read <file:Documentation/kbuild/modules.txt>.  The module
 	  will be called amba-clcd.
 	  will be called amba-clcd.
 
 
 choice
 choice
@@ -1494,7 +1494,7 @@ config FB_PXA
 	  This driver is also available as a module ( = code which can be
 	  This driver is also available as a module ( = code which can be
 	  inserted and removed from the running kernel whenever you want). The
 	  inserted and removed from the running kernel whenever you want). The
 	  module will be called pxafb. If you want to compile it as a module,
 	  module will be called pxafb. If you want to compile it as a module,
-	  say M here and read <file:Documentation/modules.txt>.
+	  say M here and read <file:Documentation/kbuild/modules.txt>.
 
 
 	  If unsure, say N.
 	  If unsure, say N.
 
 
@@ -1547,7 +1547,7 @@ config FB_W100
 	  This driver is also available as a module ( = code which can be
 	  This driver is also available as a module ( = code which can be
 	  inserted and removed from the running kernel whenever you want). The
 	  inserted and removed from the running kernel whenever you want). The
 	  module will be called w100fb. If you want to compile it as a module,
 	  module will be called w100fb. If you want to compile it as a module,
-	  say M here and read <file:Documentation/modules.txt>.
+	  say M here and read <file:Documentation/kbuild/modules.txt>.
 
 
 	  If unsure, say N.
 	  If unsure, say N.
 
 
@@ -1564,7 +1564,7 @@ config FB_S3C2410
 	  This driver is also available as a module ( = code which can be
 	  This driver is also available as a module ( = code which can be
 	  inserted and removed from the running kernel whenever you want). The
 	  inserted and removed from the running kernel whenever you want). The
 	  module will be called s3c2410fb. If you want to compile it as a module,
 	  module will be called s3c2410fb. If you want to compile it as a module,
-	  say M here and read <file:Documentation/modules.txt>.
+	  say M here and read <file:Documentation/kbuild/modules.txt>.
 
 
 	  If unsure, say N.
 	  If unsure, say N.
 config FB_S3C2410_DEBUG
 config FB_S3C2410_DEBUG

+ 4 - 0
include/linux/input.h

@@ -990,6 +990,10 @@ struct input_dev {
 #error "EV_MAX and INPUT_DEVICE_ID_EV_MAX do not match"
 #error "EV_MAX and INPUT_DEVICE_ID_EV_MAX do not match"
 #endif
 #endif
 
 
+#if KEY_MIN_INTERESTING != INPUT_DEVICE_ID_KEY_MIN_INTERESTING
+#error "KEY_MIN_INTERESTING and INPUT_DEVICE_ID_KEY_MIN_INTERESTING do not match"
+#endif
+
 #if KEY_MAX != INPUT_DEVICE_ID_KEY_MAX
 #if KEY_MAX != INPUT_DEVICE_ID_KEY_MAX
 #error "KEY_MAX and INPUT_DEVICE_ID_KEY_MAX do not match"
 #error "KEY_MAX and INPUT_DEVICE_ID_KEY_MAX do not match"
 #endif
 #endif

+ 1 - 0
include/linux/mod_devicetable.h

@@ -262,6 +262,7 @@ struct i2c_device_id {
 
 
 /* Input */
 /* Input */
 #define INPUT_DEVICE_ID_EV_MAX		0x1f
 #define INPUT_DEVICE_ID_EV_MAX		0x1f
+#define INPUT_DEVICE_ID_KEY_MIN_INTERESTING	0x71
 #define INPUT_DEVICE_ID_KEY_MAX		0x1ff
 #define INPUT_DEVICE_ID_KEY_MAX		0x1ff
 #define INPUT_DEVICE_ID_REL_MAX		0x0f
 #define INPUT_DEVICE_ID_REL_MAX		0x0f
 #define INPUT_DEVICE_ID_ABS_MAX		0x3f
 #define INPUT_DEVICE_ID_ABS_MAX		0x3f

+ 10 - 6
init/Kconfig

@@ -80,16 +80,20 @@ config LOCALVERSION_AUTO
 	default y
 	default y
 	help
 	help
 	  This will try to automatically determine if the current tree is a
 	  This will try to automatically determine if the current tree is a
-	  release tree by looking for git tags that
-	  belong to the current top of tree revision.
+	  release tree by looking for git tags that belong to the current
+	  top of tree revision.
 
 
 	  A string of the format -gxxxxxxxx will be added to the localversion
 	  A string of the format -gxxxxxxxx will be added to the localversion
-	  if a git based tree is found.  The string generated by this will be
+	  if a git-based tree is found.  The string generated by this will be
 	  appended after any matching localversion* files, and after the value
 	  appended after any matching localversion* files, and after the value
-	  set in CONFIG_LOCALVERSION
+	  set in CONFIG_LOCALVERSION.
 
 
-	  Note: This requires Perl, and a git repository, but not necessarily
-	  the git or cogito tools to be installed.
+	  (The actual string used here is the first eight characters produced
+	  by running the command:
+
+	    $ git rev-parse --verify HEAD
+
+	  which is done within the script "scripts/setlocalversion".)
 
 
 config SWAP
 config SWAP
 	bool "Support for paging of anonymous memory (swap)"
 	bool "Support for paging of anonymous memory (swap)"

+ 3 - 3
init/main.c

@@ -82,7 +82,7 @@
 #warning gcc-4.1.0 is known to miscompile the kernel.  A different compiler version is recommended.
 #warning gcc-4.1.0 is known to miscompile the kernel.  A different compiler version is recommended.
 #endif
 #endif
 
 
-static int init(void *);
+static int kernel_init(void *);
 
 
 extern void init_IRQ(void);
 extern void init_IRQ(void);
 extern void fork_init(unsigned long);
 extern void fork_init(unsigned long);
@@ -431,7 +431,7 @@ static void __init setup_command_line(char *command_line)
 static void noinline rest_init(void)
 static void noinline rest_init(void)
 	__releases(kernel_lock)
 	__releases(kernel_lock)
 {
 {
-	kernel_thread(init, NULL, CLONE_FS | CLONE_SIGHAND);
+	kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
 	numa_default_policy();
 	numa_default_policy();
 	unlock_kernel();
 	unlock_kernel();
 
 
@@ -768,7 +768,7 @@ static int noinline init_post(void)
 	panic("No init found.  Try passing init= option to kernel.");
 	panic("No init found.  Try passing init= option to kernel.");
 }
 }
 
 
-static int __init init(void * unused)
+static int __init kernel_init(void * unused)
 {
 {
 	lock_kernel();
 	lock_kernel();
 	/*
 	/*

+ 3 - 0
lib/Kconfig.debug

@@ -333,6 +333,9 @@ config DEBUG_INFO
 	help
 	help
           If you say Y here the resulting kernel image will include
           If you say Y here the resulting kernel image will include
 	  debugging info resulting in a larger kernel image.
 	  debugging info resulting in a larger kernel image.
+	  This adds debug symbols to the kernel and modules (gcc -g), and
+	  is needed if you intend to use kernel crashdump or binary object
+	  tools like crash, kgdb, LKCD, gdb, etc on the kernel.
 	  Say Y here only if you plan to debug the kernel.
 	  Say Y here only if you plan to debug the kernel.
 
 
 	  If unsure, say N.
 	  If unsure, say N.

+ 1 - 1
net/ipv6/netfilter/Kconfig

@@ -198,7 +198,7 @@ config IP6_NF_RAW
 	  and OUTPUT chains.
 	  and OUTPUT chains.
 	
 	
 	  If you want to compile it as a module, say M here and read
 	  If you want to compile it as a module, say M here and read
-	  <file:Documentation/modules.txt>.  If unsure, say `N'.
+	  <file:Documentation/kbuild/modules.txt>.  If unsure, say `N'.
 
 
 endmenu
 endmenu
 
 

+ 12 - 12
net/netfilter/Kconfig

@@ -100,7 +100,7 @@ config NF_CT_PROTO_SCTP
 	  tracking code will be able to do state tracking on SCTP connections.
 	  tracking code will be able to do state tracking on SCTP connections.
 
 
 	  If you want to compile it as a module, say M here and read
 	  If you want to compile it as a module, say M here and read
-	  Documentation/modules.txt.  If unsure, say `N'.
+	  <file:Documentation/kbuild/modules.txt>.  If unsure, say `N'.
 
 
 config NF_CONNTRACK_AMANDA
 config NF_CONNTRACK_AMANDA
 	tristate "Amanda backup protocol support"
 	tristate "Amanda backup protocol support"
@@ -279,8 +279,8 @@ config NETFILTER_XT_TARGET_CONNMARK
 	  affects the connection mark value rather than the packet mark value.
 	  affects the connection mark value rather than the packet mark value.
 	
 	
 	  If you want to compile it as a module, say M here and read
 	  If you want to compile it as a module, say M here and read
-	  <file:Documentation/modules.txt>.  The module will be called
-	  ipt_CONNMARK.o.  If unsure, say `N'.
+	  <file:Documentation/kbuild/modules.txt>.  The module will be called
+	  ipt_CONNMARK.ko.  If unsure, say `N'.
 
 
 config NETFILTER_XT_TARGET_DSCP
 config NETFILTER_XT_TARGET_DSCP
 	tristate '"DSCP" target support'
 	tristate '"DSCP" target support'
@@ -341,7 +341,7 @@ config NETFILTER_XT_TARGET_NOTRACK
 	  no protocol helpers for the selected packets).
 	  no protocol helpers for the selected packets).
 	
 	
 	  If you want to compile it as a module, say M here and read
 	  If you want to compile it as a module, say M here and read
-	  <file:Documentation/modules.txt>.  If unsure, say `N'.
+	  <file:Documentation/kbuild/modules.txt>.  If unsure, say `N'.
 
 
 config NETFILTER_XT_TARGET_SECMARK
 config NETFILTER_XT_TARGET_SECMARK
 	tristate '"SECMARK" target support'
 	tristate '"SECMARK" target support'
@@ -397,7 +397,7 @@ config NETFILTER_XT_MATCH_COMMENT
 	  comments in your iptables ruleset.
 	  comments in your iptables ruleset.
 
 
 	  If you want to compile it as a module, say M here and read
 	  If you want to compile it as a module, say M here and read
-	  <file:Documentation/modules.txt>.  If unsure, say `N'.
+	  <file:Documentation/kbuild/modules.txt>.  If unsure, say `N'.
 
 
 config NETFILTER_XT_MATCH_CONNBYTES
 config NETFILTER_XT_MATCH_CONNBYTES
 	tristate  '"connbytes" per-connection counter match support'
 	tristate  '"connbytes" per-connection counter match support'
@@ -409,7 +409,7 @@ config NETFILTER_XT_MATCH_CONNBYTES
 	  number of bytes and/or packets for each direction within a connection.
 	  number of bytes and/or packets for each direction within a connection.
 
 
 	  If you want to compile it as a module, say M here and read
 	  If you want to compile it as a module, say M here and read
-	  <file:Documentation/modules.txt>.  If unsure, say `N'.
+	  <file:Documentation/kbuild/modules.txt>.  If unsure, say `N'.
 
 
 config NETFILTER_XT_MATCH_CONNMARK
 config NETFILTER_XT_MATCH_CONNMARK
 	tristate  '"connmark" connection mark match support'
 	tristate  '"connmark" connection mark match support'
@@ -421,8 +421,8 @@ config NETFILTER_XT_MATCH_CONNMARK
 	  connection mark value previously set for the session by `CONNMARK'. 
 	  connection mark value previously set for the session by `CONNMARK'. 
 	
 	
 	  If you want to compile it as a module, say M here and read
 	  If you want to compile it as a module, say M here and read
-	  <file:Documentation/modules.txt>.  The module will be called
-	  ipt_connmark.o.  If unsure, say `N'.
+	  <file:Documentation/kbuild/modules.txt>.  The module will be called
+	  ipt_connmark.ko.  If unsure, say `N'.
 
 
 config NETFILTER_XT_MATCH_CONNTRACK
 config NETFILTER_XT_MATCH_CONNTRACK
 	tristate '"conntrack" connection tracking match support'
 	tristate '"conntrack" connection tracking match support'
@@ -446,7 +446,7 @@ config NETFILTER_XT_MATCH_DCCP
 	  and DCCP flags.
 	  and DCCP flags.
 
 
 	  If you want to compile it as a module, say M here and read
 	  If you want to compile it as a module, say M here and read
-	  <file:Documentation/modules.txt>.  If unsure, say `N'.
+	  <file:Documentation/kbuild/modules.txt>.  If unsure, say `N'.
 
 
 config NETFILTER_XT_MATCH_DSCP
 config NETFILTER_XT_MATCH_DSCP
 	tristate '"DSCP" match support'
 	tristate '"DSCP" match support'
@@ -565,7 +565,7 @@ config NETFILTER_XT_MATCH_QUOTA
 	  byte counter.
 	  byte counter.
 
 
 	  If you want to compile it as a module, say M here and read
 	  If you want to compile it as a module, say M here and read
-	  <file:Documentation/modules.txt>.  If unsure, say `N'.
+	  <file:Documentation/kbuild/modules.txt>.  If unsure, say `N'.
 
 
 config NETFILTER_XT_MATCH_REALM
 config NETFILTER_XT_MATCH_REALM
 	tristate  '"realm" match support'
 	tristate  '"realm" match support'
@@ -579,7 +579,7 @@ config NETFILTER_XT_MATCH_REALM
 	  in tc world.
 	  in tc world.
 	
 	
 	  If you want to compile it as a module, say M here and read
 	  If you want to compile it as a module, say M here and read
-	  <file:Documentation/modules.txt>.  If unsure, say `N'.
+	  <file:Documentation/kbuild/modules.txt>.  If unsure, say `N'.
 
 
 config NETFILTER_XT_MATCH_SCTP
 config NETFILTER_XT_MATCH_SCTP
 	tristate  '"sctp" protocol match support (EXPERIMENTAL)'
 	tristate  '"sctp" protocol match support (EXPERIMENTAL)'
@@ -590,7 +590,7 @@ config NETFILTER_XT_MATCH_SCTP
 	  and SCTP chunk types.
 	  and SCTP chunk types.
 
 
 	  If you want to compile it as a module, say M here and read
 	  If you want to compile it as a module, say M here and read
-	  <file:Documentation/modules.txt>.  If unsure, say `N'.
+	  <file:Documentation/kbuild/modules.txt>.  If unsure, say `N'.
 
 
 config NETFILTER_XT_MATCH_STATE
 config NETFILTER_XT_MATCH_STATE
 	tristate '"state" match support'
 	tristate '"state" match support'

+ 1 - 1
net/tipc/Kconfig

@@ -18,7 +18,7 @@ config TIPC
 	  This protocol support is also available as a module ( = code which
 	  This protocol support is also available as a module ( = code which
 	  can be inserted in and removed from the running kernel whenever you
 	  can be inserted in and removed from the running kernel whenever you
 	  want). The module will be called tipc. If you want to compile it
 	  want). The module will be called tipc. If you want to compile it
-	  as a module, say M here and read <file:Documentation/modules.txt>.
+	  as a module, say M here and read <file:Documentation/kbuild/modules.txt>.
 
 
 	  If in doubt, say N.
 	  If in doubt, say N.
 
 

+ 9 - 10
scripts/Makefile.build

@@ -131,13 +131,13 @@ $(multi-objs-y:.o=.lst) : modname = $(modname-multi)
 quiet_cmd_cc_s_c = CC $(quiet_modtag)  $@
 quiet_cmd_cc_s_c = CC $(quiet_modtag)  $@
 cmd_cc_s_c       = $(CC) $(c_flags) -fverbose-asm -S -o $@ $<
 cmd_cc_s_c       = $(CC) $(c_flags) -fverbose-asm -S -o $@ $<
 
 
-%.s: %.c FORCE
+$(obj)/%.s: $(src)/%.c FORCE
 	$(call if_changed_dep,cc_s_c)
 	$(call if_changed_dep,cc_s_c)
 
 
 quiet_cmd_cc_i_c = CPP $(quiet_modtag) $@
 quiet_cmd_cc_i_c = CPP $(quiet_modtag) $@
 cmd_cc_i_c       = $(CPP) $(c_flags)   -o $@ $<
 cmd_cc_i_c       = $(CPP) $(c_flags)   -o $@ $<
 
 
-%.i: %.c FORCE
+$(obj)/%.i: $(src)/%.c FORCE
 	$(call if_changed_dep,cc_i_c)
 	$(call if_changed_dep,cc_i_c)
 
 
 quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
 quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
@@ -146,7 +146,7 @@ cmd_cc_symtypes_c	   = \
 		| $(GENKSYMS) -T $@ >/dev/null;				\
 		| $(GENKSYMS) -T $@ >/dev/null;				\
 		test -s $@ || rm -f $@
 		test -s $@ || rm -f $@
 
 
-%.symtypes : %.c FORCE
+$(obj)/%.symtypes : $(src)/%.c FORCE
 	$(call if_changed_dep,cc_symtypes_c)
 	$(call if_changed_dep,cc_symtypes_c)
 
 
 # C (.c) files
 # C (.c) files
@@ -198,14 +198,13 @@ define rule_cc_o_c
 endef
 endef
 
 
 # Built-in and composite module parts
 # Built-in and composite module parts
-
-%.o: %.c FORCE
+$(obj)/%.o: $(src)/%.c FORCE
 	$(call cmd,force_checksrc)
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 	$(call if_changed_rule,cc_o_c)
 
 
 # Single-part modules are special since we need to mark them in $(MODVERDIR)
 # Single-part modules are special since we need to mark them in $(MODVERDIR)
 
 
-$(single-used-m): %.o: %.c FORCE
+$(single-used-m): $(obj)/%.o: $(src)/%.c FORCE
 	$(call cmd,force_checksrc)
 	$(call cmd,force_checksrc)
 	$(call if_changed_rule,cc_o_c)
 	$(call if_changed_rule,cc_o_c)
 	@{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod)
 	@{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod)
@@ -215,7 +214,7 @@ quiet_cmd_cc_lst_c = MKLST   $@
 		     $(CONFIG_SHELL) $(srctree)/scripts/makelst $*.o \
 		     $(CONFIG_SHELL) $(srctree)/scripts/makelst $*.o \
 				     System.map $(OBJDUMP) > $@
 				     System.map $(OBJDUMP) > $@
 
 
-%.lst: %.c FORCE
+$(obj)/%.lst: $(src)/%.c FORCE
 	$(call if_changed_dep,cc_lst_c)
 	$(call if_changed_dep,cc_lst_c)
 
 
 # Compile assembler sources (.S)
 # Compile assembler sources (.S)
@@ -229,13 +228,13 @@ $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE)
 quiet_cmd_as_s_S = CPP $(quiet_modtag) $@
 quiet_cmd_as_s_S = CPP $(quiet_modtag) $@
 cmd_as_s_S       = $(CPP) $(a_flags)   -o $@ $< 
 cmd_as_s_S       = $(CPP) $(a_flags)   -o $@ $< 
 
 
-%.s: %.S FORCE
+$(obj)/%.s: $(src)/%.S FORCE
 	$(call if_changed_dep,as_s_S)
 	$(call if_changed_dep,as_s_S)
 
 
 quiet_cmd_as_o_S = AS $(quiet_modtag)  $@
 quiet_cmd_as_o_S = AS $(quiet_modtag)  $@
 cmd_as_o_S       = $(CC) $(a_flags) -c -o $@ $<
 cmd_as_o_S       = $(CC) $(a_flags) -c -o $@ $<
 
 
-%.o: %.S FORCE
+$(obj)/%.o: $(src)/%.S FORCE
 	$(call if_changed_dep,as_o_S)
 	$(call if_changed_dep,as_o_S)
 
 
 targets += $(real-objs-y) $(real-objs-m) $(lib-y)
 targets += $(real-objs-y) $(real-objs-m) $(lib-y)
@@ -246,7 +245,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $(always)
 quiet_cmd_cpp_lds_S = LDS     $@
 quiet_cmd_cpp_lds_S = LDS     $@
       cmd_cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -o $@ $<
       cmd_cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -o $@ $<
 
 
-%.lds: %.lds.S FORCE
+$(obj)/%.lds: $(src)/%.lds.S FORCE
 	$(call if_changed_dep,cpp_lds_S)
 	$(call if_changed_dep,cpp_lds_S)
 
 
 # Build the compiled-in targets
 # Build the compiled-in targets

+ 7 - 7
scripts/Makefile.host

@@ -114,7 +114,7 @@ hostcxx_flags  = -Wp,-MD,$(depfile) $(__hostcxx_flags)
 quiet_cmd_host-csingle 	= HOSTCC  $@
 quiet_cmd_host-csingle 	= HOSTCC  $@
       cmd_host-csingle	= $(HOSTCC) $(hostc_flags) -o $@ $< \
       cmd_host-csingle	= $(HOSTCC) $(hostc_flags) -o $@ $< \
 	  	$(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
 	  	$(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
-$(host-csingle): %: %.c FORCE
+$(host-csingle): $(obj)/%: $(src)/%.c FORCE
 	$(call if_changed_dep,host-csingle)
 	$(call if_changed_dep,host-csingle)
 
 
 # Link an executable based on list of .o files, all plain c
 # Link an executable based on list of .o files, all plain c
@@ -123,14 +123,14 @@ quiet_cmd_host-cmulti	= HOSTLD  $@
       cmd_host-cmulti	= $(HOSTCC) $(HOSTLDFLAGS) -o $@ \
       cmd_host-cmulti	= $(HOSTCC) $(HOSTLDFLAGS) -o $@ \
 			  $(addprefix $(obj)/,$($(@F)-objs)) \
 			  $(addprefix $(obj)/,$($(@F)-objs)) \
 			  $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
 			  $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
-$(host-cmulti): %: $(host-cobjs) $(host-cshlib) FORCE
+$(host-cmulti): $(obj)/%: $(host-cobjs) $(host-cshlib) FORCE
 	$(call if_changed,host-cmulti)
 	$(call if_changed,host-cmulti)
 
 
 # Create .o file from a single .c file
 # Create .o file from a single .c file
 # host-cobjs -> .o
 # host-cobjs -> .o
 quiet_cmd_host-cobjs	= HOSTCC  $@
 quiet_cmd_host-cobjs	= HOSTCC  $@
       cmd_host-cobjs	= $(HOSTCC) $(hostc_flags) -c -o $@ $<
       cmd_host-cobjs	= $(HOSTCC) $(hostc_flags) -c -o $@ $<
-$(host-cobjs): %.o: %.c FORCE
+$(host-cobjs): $(obj)/%.o: $(src)/%.c FORCE
 	$(call if_changed_dep,host-cobjs)
 	$(call if_changed_dep,host-cobjs)
 
 
 # Link an executable based on list of .o files, a mixture of .c and .cc
 # Link an executable based on list of .o files, a mixture of .c and .cc
@@ -140,20 +140,20 @@ quiet_cmd_host-cxxmulti	= HOSTLD  $@
 			  $(foreach o,objs cxxobjs,\
 			  $(foreach o,objs cxxobjs,\
 			  $(addprefix $(obj)/,$($(@F)-$(o)))) \
 			  $(addprefix $(obj)/,$($(@F)-$(o)))) \
 			  $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
 			  $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
-$(host-cxxmulti): %: $(host-cobjs) $(host-cxxobjs) $(host-cshlib) FORCE
+$(host-cxxmulti): $(obj)/%: $(host-cobjs) $(host-cxxobjs) $(host-cshlib) FORCE
 	$(call if_changed,host-cxxmulti)
 	$(call if_changed,host-cxxmulti)
 
 
 # Create .o file from a single .cc (C++) file
 # Create .o file from a single .cc (C++) file
 quiet_cmd_host-cxxobjs	= HOSTCXX $@
 quiet_cmd_host-cxxobjs	= HOSTCXX $@
       cmd_host-cxxobjs	= $(HOSTCXX) $(hostcxx_flags) -c -o $@ $<
       cmd_host-cxxobjs	= $(HOSTCXX) $(hostcxx_flags) -c -o $@ $<
-$(host-cxxobjs): %.o: %.cc FORCE
+$(host-cxxobjs): $(obj)/%.o: $(src)/%.cc FORCE
 	$(call if_changed_dep,host-cxxobjs)
 	$(call if_changed_dep,host-cxxobjs)
 
 
 # Compile .c file, create position independent .o file
 # Compile .c file, create position independent .o file
 # host-cshobjs -> .o
 # host-cshobjs -> .o
 quiet_cmd_host-cshobjs	= HOSTCC  -fPIC $@
 quiet_cmd_host-cshobjs	= HOSTCC  -fPIC $@
       cmd_host-cshobjs	= $(HOSTCC) $(hostc_flags) -fPIC -c -o $@ $<
       cmd_host-cshobjs	= $(HOSTCC) $(hostc_flags) -fPIC -c -o $@ $<
-$(host-cshobjs): %.o: %.c FORCE
+$(host-cshobjs): $(obj)/%.o: $(src)/%.c FORCE
 	$(call if_changed_dep,host-cshobjs)
 	$(call if_changed_dep,host-cshobjs)
 
 
 # Link a shared library, based on position independent .o files
 # Link a shared library, based on position independent .o files
@@ -162,7 +162,7 @@ quiet_cmd_host-cshlib	= HOSTLLD -shared $@
       cmd_host-cshlib	= $(HOSTCC) $(HOSTLDFLAGS) -shared -o $@ \
       cmd_host-cshlib	= $(HOSTCC) $(HOSTLDFLAGS) -shared -o $@ \
 			  $(addprefix $(obj)/,$($(@F:.so=-objs))) \
 			  $(addprefix $(obj)/,$($(@F:.so=-objs))) \
 			  $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
 			  $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
-$(host-cshlib): %: $(host-cshobjs) FORCE
+$(host-cshlib): $(obj)/%: $(host-cshobjs) FORCE
 	$(call if_changed,host-cshlib)
 	$(call if_changed,host-cshlib)
 
 
 targets += $(host-csingle)  $(host-cmulti) $(host-cobjs)\
 targets += $(host-csingle)  $(host-cmulti) $(host-cobjs)\

+ 4 - 4
scripts/Makefile.modpost

@@ -63,16 +63,16 @@ quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
 	$(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
 	$(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
 	$(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
 	$(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
 	$(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
 	$(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
-	$(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) \
-	$(wildcard vmlinux) $(filter-out FORCE,$^)
+	$(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)
 
 
 PHONY += __modpost
 PHONY += __modpost
 __modpost: $(modules:.ko=.o) FORCE
 __modpost: $(modules:.ko=.o) FORCE
-	$(call cmd,modpost)
+	$(call cmd,modpost) $(wildcard vmlinux) $(filter-out FORCE,$^)
 
 
 quiet_cmd_kernel-mod = MODPOST $@
 quiet_cmd_kernel-mod = MODPOST $@
-      cmd_kernel-mod = $(cmd_modpost)
+      cmd_kernel-mod = $(cmd_modpost) $(KBUILD_VMLINUX_OBJS)
 
 
+PHONY += vmlinux
 vmlinux: FORCE
 vmlinux: FORCE
 	$(call cmd,kernel-mod)
 	$(call cmd,kernel-mod)
 
 

+ 2 - 0
scripts/basic/fixdep.c

@@ -249,6 +249,8 @@ void parse_config_file(char *map, size_t len)
 	found:
 	found:
 		if (!memcmp(q - 7, "_MODULE", 7))
 		if (!memcmp(q - 7, "_MODULE", 7))
 			q -= 7;
 			q -= 7;
+		if( (q-p-7) < 0 )
+			continue;
 		use_config(p+7, q-p-7);
 		use_config(p+7, q-p-7);
 	}
 	}
 }
 }

+ 118 - 0
scripts/checksyscalls.sh

@@ -0,0 +1,118 @@
+#!/bin/sh
+#
+# Check if current architecture are missing any function calls compared
+# to i386.
+# i386 define a number of legacy system calls that are i386 specific
+# and listed below so they are ignored.
+#
+# Usage:
+# syscallchk gcc gcc-options
+#
+
+ignore_list() {
+cat << EOF
+#include <asm/types.h>
+#include <asm/unistd.h>
+
+/* System calls for 32-bit kernels only */
+#if BITS_PER_LONG == 64
+#define __IGNORE_sendfile64
+#define __IGNORE_ftruncate64
+#define __IGNORE_truncate64
+#define __IGNORE_stat64
+#define __IGNORE_lstat64
+#define __IGNORE_fstat64
+#define __IGNORE_fcntl64
+#define __IGNORE_fadvise64_64
+#define __IGNORE_fstatat64
+#define __IGNORE_fstatfs64
+#define __IGNORE_statfs64
+#endif
+
+/* i386-specific or historical system calls */
+#define __IGNORE_break
+#define __IGNORE_stty
+#define __IGNORE_gtty
+#define __IGNORE_ftime
+#define __IGNORE_prof
+#define __IGNORE_lock
+#define __IGNORE_mpx
+#define __IGNORE_ulimit
+#define __IGNORE_profil
+#define __IGNORE_ioperm
+#define __IGNORE_iopl
+#define __IGNORE_idle
+#define __IGNORE_modify_ldt
+#define __IGNORE_ugetrlimit
+#define __IGNORE_mmap2
+#define __IGNORE_vm86
+#define __IGNORE_vm86old
+#define __IGNORE_set_thread_area
+#define __IGNORE_get_thread_area
+#define __IGNORE_madvise1
+#define __IGNORE_oldstat
+#define __IGNORE_oldfstat
+#define __IGNORE_oldlstat
+#define __IGNORE_oldolduname
+#define __IGNORE_olduname
+#define __IGNORE_umount2
+#define __IGNORE_umount
+#define __IGNORE_waitpid
+#define __IGNORE_stime
+#define __IGNORE_nice
+#define __IGNORE_signal
+#define __IGNORE_sigaction
+#define __IGNORE_sgetmask
+#define __IGNORE_sigsuspend
+#define __IGNORE_sigpending
+#define __IGNORE_ssetmask
+#define __IGNORE_readdir
+#define __IGNORE_socketcall
+#define __IGNORE_ipc
+#define __IGNORE_sigreturn
+#define __IGNORE_sigprocmask
+#define __IGNORE_bdflush
+#define __IGNORE__llseek
+#define __IGNORE__newselect
+#define __IGNORE_create_module
+#define __IGNORE_delete_module
+#define __IGNORE_query_module
+#define __IGNORE_get_kernel_syms
+/* ... including the "new" 32-bit uid syscalls */
+#define __IGNORE_lchown32
+#define __IGNORE_getuid32
+#define __IGNORE_getgid32
+#define __IGNORE_geteuid32
+#define __IGNORE_getegid32
+#define __IGNORE_setreuid32
+#define __IGNORE_setregid32
+#define __IGNORE_getgroups32
+#define __IGNORE_setgroups32
+#define __IGNORE_fchown32
+#define __IGNORE_setresuid32
+#define __IGNORE_getresuid32
+#define __IGNORE_setresgid32
+#define __IGNORE_getresgid32
+#define __IGNORE_chown32
+#define __IGNORE_setuid32
+#define __IGNORE_setgid32
+#define __IGNORE_setfsuid32
+#define __IGNORE_setfsgid32
+
+/* Unmerged syscalls for AFS, STREAMS, etc. */
+#define __IGNORE_afs_syscall
+#define __IGNORE_getpmsg
+#define __IGNORE_putpmsg
+#define __IGNORE_vserver
+EOF
+}
+
+syscall_list() {
+sed -n -e '/^\#define/ { s/[^_]*__NR_\([^[:space:]]*\).*/\
+\#if !defined \(__NR_\1\) \&\& !defined \(__IGNORE_\1\)\
+\#warning syscall \1 not implemented\
+\#endif/p }' $1
+}
+
+(ignore_list && syscall_list ${srctree}/include/asm-i386/unistd.h) | \
+$* -E -x c - > /dev/null

+ 126 - 0
scripts/cleanfile

@@ -0,0 +1,126 @@
+#!/usr/bin/perl -w
+#
+# Clean a text file -- or directory of text files -- of stealth whitespace.
+# WARNING: this can be a highly destructive operation.  Use with caution.
+#
+
+use bytes;
+use File::Basename;
+
+#
+# Clean up space-tab sequences, either by removing spaces or
+# replacing them with tabs.
+sub clean_space_tabs($)
+{
+    no bytes;			# Tab alignment depends on characters
+
+    my($li) = @_;
+    my($lo) = '';
+    my $pos = 0;
+    my $nsp = 0;
+    my($i, $c);
+
+    for ($i = 0; $i < length($li); $i++) {
+	$c = substr($li, $i, 1);
+	if ($c eq "\t") {
+	    my $npos = ($pos+$nsp+8) & ~7;
+	    my $ntab = ($npos >> 3) - ($pos >> 3);
+	    $lo .= "\t" x $ntab;
+	    $pos = $npos;
+	    $nsp = 0;
+	} elsif ($c eq "\n" || $c eq "\r") {
+	    $lo .= " " x $nsp;
+	    $pos += $nsp;
+	    $nsp = 0;
+	    $lo .= $c;
+	    $pos = 0;
+	} elsif ($c eq " ") {
+	    $nsp++;
+	} else {
+	    $lo .= " " x $nsp;
+	    $pos += $nsp;
+	    $nsp = 0;
+	    $lo .= $c;
+	    $pos++;
+	}
+    }
+    $lo .= " " x $nsp;
+    return $lo;
+}
+
+$name = basename($0);
+
+foreach $f ( @ARGV ) {
+    print STDERR "$name: $f\n";
+
+    if (! -f $f) {
+	print STDERR "$f: not a file\n";
+	next;
+    }
+
+    if (!open(FILE, '+<', $f)) {
+	print STDERR "$name: Cannot open file: $f: $!\n";
+	next;
+    }
+
+    binmode FILE;
+
+    # First, verify that it is not a binary file; consider any file
+    # with a zero byte to be a binary file.  Is there any better, or
+    # additional, heuristic that should be applied?
+    $is_binary = 0;
+
+    while (read(FILE, $data, 65536) > 0) {
+	if ($data =~ /\0/) {
+	    $is_binary = 1;
+	    last;
+	}
+    }
+
+    if ($is_binary) {
+	print STDERR "$name: $f: binary file\n";
+	next;
+    }
+
+    seek(FILE, 0, 0);
+
+    $in_bytes = 0;
+    $out_bytes = 0;
+    $blank_bytes = 0;
+
+    @blanks = ();
+    @lines  = ();
+
+    while ( defined($line = <FILE>) ) {
+	$in_bytes += length($line);
+	$line =~ s/[ \t\r]*$//;		# Remove trailing spaces
+	$line = clean_space_tabs($line);
+
+	if ( $line eq "\n" ) {
+	    push(@blanks, $line);
+	    $blank_bytes += length($line);
+	} else {
+	    push(@lines, @blanks);
+	    $out_bytes += $blank_bytes;
+	    push(@lines, $line);
+	    $out_bytes += length($line);
+	    @blanks = ();
+	    $blank_bytes = 0;
+	}
+    }
+
+    # Any blanks at the end of the file are discarded
+
+    if ($in_bytes != $out_bytes) {
+	# Only write to the file if changed
+	seek(FILE, 0, 0);
+	print FILE @lines;
+
+	if ( !defined($where = tell(FILE)) ||
+	     !truncate(FILE, $where) ) {
+	    die "$name: Failed to truncate modified file: $f: $!\n";
+	}
+    }
+
+    close(FILE);
+}

+ 206 - 0
scripts/cleanpatch

@@ -0,0 +1,206 @@
+#!/usr/bin/perl -w
+#
+# Clean a patch file -- or directory of patch files -- of stealth whitespace.
+# WARNING: this can be a highly destructive operation.  Use with caution.
+#
+
+use bytes;
+use File::Basename;
+
+#
+# Clean up space-tab sequences, either by removing spaces or
+# replacing them with tabs.
+sub clean_space_tabs($)
+{
+    no bytes;			# Tab alignment depends on characters
+
+    my($li) = @_;
+    my($lo) = '';
+    my $pos = 0;
+    my $nsp = 0;
+    my($i, $c);
+
+    for ($i = 0; $i < length($li); $i++) {
+	$c = substr($li, $i, 1);
+	if ($c eq "\t") {
+	    my $npos = ($pos+$nsp+8) & ~7;
+	    my $ntab = ($npos >> 3) - ($pos >> 3);
+	    $lo .= "\t" x $ntab;
+	    $pos = $npos;
+	    $nsp = 0;
+	} elsif ($c eq "\n" || $c eq "\r") {
+	    $lo .= " " x $nsp;
+	    $pos += $nsp;
+	    $nsp = 0;
+	    $lo .= $c;
+	    $pos = 0;
+	} elsif ($c eq " ") {
+	    $nsp++;
+	} else {
+	    $lo .= " " x $nsp;
+	    $pos += $nsp;
+	    $nsp = 0;
+	    $lo .= $c;
+	    $pos++;
+	}
+    }
+    $lo .= " " x $nsp;
+    return $lo;
+}
+
+$name = basename($0);
+
+foreach $f ( @ARGV ) {
+    print STDERR "$name: $f\n";
+
+    if (! -f $f) {
+	print STDERR "$f: not a file\n";
+	next;
+    }
+
+    if (!open(FILE, '+<', $f)) {
+	print STDERR "$name: Cannot open file: $f: $!\n";
+	next;
+    }
+
+    binmode FILE;
+
+    # First, verify that it is not a binary file; consider any file
+    # with a zero byte to be a binary file.  Is there any better, or
+    # additional, heuristic that should be applied?
+    $is_binary = 0;
+
+    while (read(FILE, $data, 65536) > 0) {
+	if ($data =~ /\0/) {
+	    $is_binary = 1;
+	    last;
+	}
+    }
+
+    if ($is_binary) {
+	print STDERR "$name: $f: binary file\n";
+	next;
+    }
+
+    seek(FILE, 0, 0);
+
+    $in_bytes = 0;
+    $out_bytes = 0;
+
+    @lines  = ();
+
+    $in_hunk = 0;
+    $err = 0;
+
+    while ( defined($line = <FILE>) ) {
+	$in_bytes += length($line);
+
+	if (!$in_hunk) {
+	    if ($line =~ /^\@\@\s+\-([0-9]+),([0-9]+)\s+\+([0-9]+),([0-9]+)\s\@\@/) {
+		$minus_lines = $2;
+		$plus_lines = $4;
+		if ($minus_lines || $plus_lines) {
+		    $in_hunk = 1;
+		    @hunk_lines = ($line);
+		}
+	    } else {
+		push(@lines, $line);
+		$out_bytes += length($line);
+	    }
+	} else {
+	    # We're in a hunk
+
+	    if ($line =~ /^\+/) {
+		$plus_lines--;
+
+		$text = substr($line, 1);
+		$text =~ s/[ \t\r]*$//;		# Remove trailing spaces
+		$text = clean_space_tabs($text);
+
+		push(@hunk_lines, '+'.$text);
+	    } elsif ($line =~ /^\-/) {
+		$minus_lines--;
+		push(@hunk_lines, $line);
+	    } elsif ($line =~ /^ /) {
+		$plus_lines--;
+		$minus_lines--;
+		push(@hunk_lines, $line);
+	    } else {
+		print STDERR "$name: $f: malformed patch\n";
+		$err = 1;
+		last;
+	    }
+
+	    if ($plus_lines < 0 || $minus_lines < 0) {
+		print STDERR "$name: $f: malformed patch\n";
+		$err = 1;
+		last;
+	    } elsif ($plus_lines == 0 && $minus_lines == 0) {
+		# End of a hunk.  Process this hunk.
+		my $i;
+		my $l;
+		my @h = ();
+		my $adj = 0;
+		my $done = 0;
+
+		for ($i = scalar(@hunk_lines)-1; $i > 0; $i--) {
+		    $l = $hunk_lines[$i];
+		    if (!$done && $l eq "+\n") {
+			$adj++; # Skip this line
+		    } elsif ($l =~ /^[ +]/) {
+			$done = 1;
+			unshift(@h, $l);
+		    } else {
+			unshift(@h, $l);
+		    }
+		}
+
+		$l = $hunk_lines[0];  # Hunk header
+		undef @hunk_lines;    # Free memory
+
+		if ($adj) {
+		    die unless
+			($l =~ /^\@\@\s+\-([0-9]+),([0-9]+)\s+\+([0-9]+),([0-9]+)\s\@\@(.*)$/);
+		    my $mstart = $1;
+		    my $mlin = $2;
+		    my $pstart = $3;
+		    my $plin = $4;
+		    my $tail = $5; # doesn't include the final newline
+
+		    $l = sprintf("@@ -%d,%d +%d,%d @@%s\n",
+				 $mstart, $mlin, $pstart, $plin-$adj,
+				 $tail);
+		}
+		unshift(@h, $l);
+
+		# Transfer to the output array
+		foreach $l (@h) {
+		    $out_bytes += length($l);
+		    push(@lines, $l);
+		}
+
+		$in_hunk = 0;
+	    }
+	}
+    }
+
+    if ($in_hunk) {
+	print STDERR "$name: $f: malformed patch\n";
+	$err = 1;
+    }
+
+    if (!$err) {
+	if ($in_bytes != $out_bytes) {
+	    # Only write to the file if changed
+	    seek(FILE, 0, 0);
+	    print FILE @lines;
+
+	    if ( !defined($where = tell(FILE)) ||
+		 !truncate(FILE, $where) ) {
+		die "$name: Failed to truncate modified file: $f: $!\n";
+	    }
+	}
+    }
+
+    close(FILE);
+}

+ 9 - 3
scripts/gen_initramfs_list.sh

@@ -171,7 +171,7 @@ dir_filelist() {
 	${dep_list}header "$1"
 	${dep_list}header "$1"
 
 
 	srcdir=$(echo "$1" | sed -e 's://*:/:g')
 	srcdir=$(echo "$1" | sed -e 's://*:/:g')
-	dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n" 2>/dev/null)
+	dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n")
 
 
 	# If $dirlist is only one line, then the directory is empty
 	# If $dirlist is only one line, then the directory is empty
 	if [  "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then
 	if [  "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then
@@ -191,9 +191,10 @@ input_file() {
 	source="$1"
 	source="$1"
 	if [ -f "$1" ]; then
 	if [ -f "$1" ]; then
 		${dep_list}header "$1"
 		${dep_list}header "$1"
-		is_cpio="$(echo "$1" | sed 's/^.*\.cpio/cpio/')"
+		is_cpio="$(echo "$1" | sed 's/^.*\.cpio\(\..*\)\?/cpio/')"
 		if [ $2 -eq 0 -a ${is_cpio} == "cpio" ]; then
 		if [ $2 -eq 0 -a ${is_cpio} == "cpio" ]; then
 			cpio_file=$1
 			cpio_file=$1
+			echo "$1" | grep -q '^.*\.cpio\..*' && is_cpio_compressed="compressed"
 			[ ! -z ${dep_list} ] && echo "$1"
 			[ ! -z ${dep_list} ] && echo "$1"
 			return 0
 			return 0
 		fi
 		fi
@@ -223,6 +224,7 @@ cpio_file=
 cpio_list=
 cpio_list=
 output="/dev/stdout"
 output="/dev/stdout"
 output_file=""
 output_file=""
+is_cpio_compressed=
 
 
 arg="$1"
 arg="$1"
 case "$arg" in
 case "$arg" in
@@ -282,7 +284,11 @@ if [ ! -z ${output_file} ]; then
 		cpio_tfile=${cpio_file}
 		cpio_tfile=${cpio_file}
 	fi
 	fi
 	rm ${cpio_list}
 	rm ${cpio_list}
-	cat ${cpio_tfile} | gzip -f -9 - > ${output_file}
+	if [ "${is_cpio_compressed}" = "compressed" ]; then
+		cat ${cpio_tfile} > ${output_file}
+	else
+		cat ${cpio_tfile} | gzip -f -9 - > ${output_file}
+	fi
 	[ -z ${cpio_file} ] && rm ${cpio_tfile}
 	[ -z ${cpio_file} ] && rm ${cpio_tfile}
 fi
 fi
 exit 0
 exit 0

+ 3 - 2
scripts/kconfig/Makefile

@@ -140,6 +140,7 @@ endif
 
 
 clean-files	:= lkc_defs.h qconf.moc .tmp_qtcheck \
 clean-files	:= lkc_defs.h qconf.moc .tmp_qtcheck \
 		   .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c
 		   .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c
+clean-files     += mconf qconf gconf
 
 
 # Needed for systems without gettext
 # Needed for systems without gettext
 KBUILD_HAVE_NLS := $(shell \
 KBUILD_HAVE_NLS := $(shell \
@@ -183,8 +184,8 @@ $(obj)/.tmp_qtcheck:
 	  done; \
 	  done; \
 	  if [ -z "$$dir" ]; then \
 	  if [ -z "$$dir" ]; then \
 	    echo "*"; \
 	    echo "*"; \
-	    echo "* Unable to find the QT installation. Please make sure that"; \
-	    echo "* the QT development package is correctly installed and"; \
+	    echo "* Unable to find the QT3 installation. Please make sure that"; \
+	    echo "* the QT3 development package is correctly installed and"; \
 	    echo "* either install pkg-config or set the QTDIR environment"; \
 	    echo "* either install pkg-config or set the QTDIR environment"; \
 	    echo "* variable to the correct location."; \
 	    echo "* variable to the correct location."; \
 	    echo "*"; \
 	    echo "*"; \

+ 1 - 0
scripts/kconfig/conf.c

@@ -558,6 +558,7 @@ int main(int ac, char **av)
 		if (stat(".config", &tmpstat)) {
 		if (stat(".config", &tmpstat)) {
 			printf(_("***\n"
 			printf(_("***\n"
 				"*** You have not yet configured your kernel!\n"
 				"*** You have not yet configured your kernel!\n"
+				"*** (missing kernel .config file)\n"
 				"***\n"
 				"***\n"
 				"*** Please run some configurator (e.g. \"make oldconfig\" or\n"
 				"*** Please run some configurator (e.g. \"make oldconfig\" or\n"
 				"*** \"make menuconfig\" or \"make xconfig\").\n"
 				"*** \"make menuconfig\" or \"make xconfig\").\n"

+ 1 - 1
scripts/kconfig/lex.zconf.c_shipped

@@ -2264,7 +2264,7 @@ FILE *zconf_fopen(const char *name)
 	FILE *f;
 	FILE *f;
 
 
 	f = fopen(name, "r");
 	f = fopen(name, "r");
-	if (!f && name[0] != '/') {
+	if (!f && name != NULL && name[0] != '/') {
 		env = getenv(SRCTREE);
 		env = getenv(SRCTREE);
 		if (env) {
 		if (env) {
 			sprintf(fullname, "%s/%s", env, name);
 			sprintf(fullname, "%s/%s", env, name);

+ 1 - 0
scripts/kconfig/lkc.h

@@ -64,6 +64,7 @@ int zconf_lineno(void);
 char *zconf_curname(void);
 char *zconf_curname(void);
 
 
 /* confdata.c */
 /* confdata.c */
+const char *conf_get_configname(void);
 char *conf_get_default_confname(void);
 char *conf_get_default_confname(void);
 void sym_set_change_count(int count);
 void sym_set_change_count(int count);
 void sym_add_change_count(int count);
 void sym_add_change_count(int count);

+ 1 - 0
scripts/kconfig/lxdialog/dialog.h

@@ -188,6 +188,7 @@ int on_key_esc(WINDOW *win);
 int on_key_resize(void);
 int on_key_resize(void);
 
 
 void init_dialog(const char *backtitle);
 void init_dialog(const char *backtitle);
+void set_dialog_backtitle(const char *backtitle);
 void reset_dialog(void);
 void reset_dialog(void);
 void end_dialog(void);
 void end_dialog(void);
 void attr_clear(WINDOW * win, int height, int width, chtype attr);
 void attr_clear(WINDOW * win, int height, int width, chtype attr);

+ 7 - 2
scripts/kconfig/lxdialog/util.c

@@ -272,6 +272,11 @@ void init_dialog(const char *backtitle)
 	color_setup(getenv("MENUCONFIG_COLOR"));
 	color_setup(getenv("MENUCONFIG_COLOR"));
 }
 }
 
 
+void set_dialog_backtitle(const char *backtitle)
+{
+	dlg.backtitle = backtitle;
+}
+
 void reset_dialog(void)
 void reset_dialog(void)
 {
 {
 	initscr();		/* Init curses */
 	initscr();		/* Init curses */
@@ -336,7 +341,7 @@ void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x)
 		newl = 1;
 		newl = 1;
 		word = tempstr;
 		word = tempstr;
 		while (word && *word) {
 		while (word && *word) {
-			sp = index(word, ' ');
+			sp = strchr(word, ' ');
 			if (sp)
 			if (sp)
 				*sp++ = 0;
 				*sp++ = 0;
 
 
@@ -348,7 +353,7 @@ void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x)
 			if (wlen > room ||
 			if (wlen > room ||
 			    (newl && wlen < 4 && sp
 			    (newl && wlen < 4 && sp
 			     && wlen + 1 + strlen(sp) > room
 			     && wlen + 1 + strlen(sp) > room
-			     && (!(sp2 = index(sp, ' '))
+			     && (!(sp2 = strchr(sp, ' '))
 				 || wlen + 1 + (sp2 - sp) > room))) {
 				 || wlen + 1 + (sp2 - sp) > room))) {
 				cur_y++;
 				cur_y++;
 				cur_x = x;
 				cur_x = x;

+ 31 - 12
scripts/kconfig/mconf.c

@@ -26,7 +26,6 @@
 #include "lkc.h"
 #include "lkc.h"
 #include "lxdialog/dialog.h"
 #include "lxdialog/dialog.h"
 
 
-static char menu_backtitle[128];
 static const char mconf_readme[] = N_(
 static const char mconf_readme[] = N_(
 "Overview\n"
 "Overview\n"
 "--------\n"
 "--------\n"
@@ -271,7 +270,6 @@ search_help[] = N_(
 	"          USB$ => find all CONFIG_ symbols ending with USB\n"
 	"          USB$ => find all CONFIG_ symbols ending with USB\n"
 	"\n");
 	"\n");
 
 
-static char filename[PATH_MAX+1] = ".config";
 static int indent;
 static int indent;
 static struct termios ios_org;
 static struct termios ios_org;
 static int rows = 0, cols = 0;
 static int rows = 0, cols = 0;
@@ -395,6 +393,28 @@ static struct gstr get_relations_str(struct symbol **sym_arr)
 	return res;
 	return res;
 }
 }
 
 
+static char filename[PATH_MAX+1];
+static void set_config_filename(const char *config_filename)
+{
+	static char menu_backtitle[PATH_MAX+128];
+	int size;
+	struct symbol *sym;
+
+	sym = sym_lookup("KERNELVERSION", 0);
+	sym_calc_value(sym);
+	size = snprintf(menu_backtitle, sizeof(menu_backtitle),
+	                _("%s - Linux Kernel v%s Configuration"),
+		        config_filename, sym_get_string_value(sym));
+	if (size >= sizeof(menu_backtitle))
+		menu_backtitle[sizeof(menu_backtitle)-1] = '\0';
+	set_dialog_backtitle(menu_backtitle);
+
+	size = snprintf(filename, sizeof(filename), "%s", config_filename);
+	if (size >= sizeof(filename))
+		filename[sizeof(filename)-1] = '\0';
+}
+
+
 static void search_conf(void)
 static void search_conf(void)
 {
 {
 	struct symbol **sym_arr;
 	struct symbol **sym_arr;
@@ -816,8 +836,10 @@ static void conf_load(void)
 		case 0:
 		case 0:
 			if (!dialog_input_result[0])
 			if (!dialog_input_result[0])
 				return;
 				return;
-			if (!conf_read(dialog_input_result))
+			if (!conf_read(dialog_input_result)) {
+				set_config_filename(dialog_input_result);
 				return;
 				return;
+			}
 			show_textbox(NULL, _("File does not exist!"), 5, 38);
 			show_textbox(NULL, _("File does not exist!"), 5, 38);
 			break;
 			break;
 		case 1:
 		case 1:
@@ -840,8 +862,10 @@ static void conf_save(void)
 		case 0:
 		case 0:
 			if (!dialog_input_result[0])
 			if (!dialog_input_result[0])
 				return;
 				return;
-			if (!conf_write(dialog_input_result))
+			if (!conf_write(dialog_input_result)) {
+				set_config_filename(dialog_input_result);
 				return;
 				return;
+			}
 			show_textbox(NULL, _("Can't create file!  Probably a nonexistent directory."), 5, 60);
 			show_textbox(NULL, _("Can't create file!  Probably a nonexistent directory."), 5, 60);
 			break;
 			break;
 		case 1:
 		case 1:
@@ -860,7 +884,6 @@ static void conf_cleanup(void)
 
 
 int main(int ac, char **av)
 int main(int ac, char **av)
 {
 {
-	struct symbol *sym;
 	char *mode;
 	char *mode;
 	int res;
 	int res;
 
 
@@ -871,11 +894,6 @@ int main(int ac, char **av)
 	conf_parse(av[1]);
 	conf_parse(av[1]);
 	conf_read(NULL);
 	conf_read(NULL);
 
 
-	sym = sym_lookup("KERNELVERSION", 0);
-	sym_calc_value(sym);
-	sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"),
-		sym_get_string_value(sym));
-
 	mode = getenv("MENUCONFIG_MODE");
 	mode = getenv("MENUCONFIG_MODE");
 	if (mode) {
 	if (mode) {
 		if (!strcasecmp(mode, "single_menu"))
 		if (!strcasecmp(mode, "single_menu"))
@@ -886,7 +904,8 @@ int main(int ac, char **av)
 	atexit(conf_cleanup);
 	atexit(conf_cleanup);
 	init_wsize();
 	init_wsize();
 	reset_dialog();
 	reset_dialog();
-	init_dialog(menu_backtitle);
+	init_dialog(NULL);
+	set_config_filename(conf_get_configname());
 	do {
 	do {
 		conf(&rootmenu);
 		conf(&rootmenu);
 		dialog_clear();
 		dialog_clear();
@@ -903,7 +922,7 @@ int main(int ac, char **av)
 
 
 	switch (res) {
 	switch (res) {
 	case 0:
 	case 0:
-		if (conf_write(NULL)) {
+		if (conf_write(filename)) {
 			fprintf(stderr, _("\n\n"
 			fprintf(stderr, _("\n\n"
 				"Error during writing of the kernel configuration.\n"
 				"Error during writing of the kernel configuration.\n"
 				"Your kernel configuration changes were NOT saved."
 				"Your kernel configuration changes were NOT saved."

+ 1 - 1
scripts/kconfig/menu.c

@@ -203,7 +203,7 @@ void sym_check_prop(struct symbol *sym)
 			else if (sym2->type == S_UNKNOWN)
 			else if (sym2->type == S_UNKNOWN)
 				prop_warn(prop,
 				prop_warn(prop,
 				    "'select' used by config symbol '%s' "
 				    "'select' used by config symbol '%s' "
-				    "refer to undefined symbol '%s'",
+				    "refers to undefined symbol '%s'",
 				    sym->name, sym2->name);
 				    sym->name, sym2->name);
 			else if (sym2->type != S_BOOLEAN && sym2->type != S_TRISTATE)
 			else if (sym2->type != S_BOOLEAN && sym2->type != S_TRISTATE)
 				prop_warn(prop,
 				prop_warn(prop,

+ 4 - 1
scripts/kconfig/qconf.cc

@@ -1182,7 +1182,7 @@ void ConfigInfoView::contentsContextMenuEvent(QContextMenuEvent *e)
 	Parent::contentsContextMenuEvent(e);
 	Parent::contentsContextMenuEvent(e);
 }
 }
 
 
-ConfigSearchWindow::ConfigSearchWindow(QWidget* parent, const char *name)
+ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *name)
 	: Parent(parent, name), result(NULL)
 	: Parent(parent, name), result(NULL)
 {
 {
 	setCaption("Search Config");
 	setCaption("Search Config");
@@ -1206,6 +1206,9 @@ ConfigSearchWindow::ConfigSearchWindow(QWidget* parent, const char *name)
 	info = new ConfigInfoView(split, name);
 	info = new ConfigInfoView(split, name);
 	connect(list->list, SIGNAL(menuChanged(struct menu *)),
 	connect(list->list, SIGNAL(menuChanged(struct menu *)),
 		info, SLOT(setInfo(struct menu *)));
 		info, SLOT(setInfo(struct menu *)));
+	connect(list->list, SIGNAL(menuChanged(struct menu *)),
+		parent, SLOT(setMenuLink(struct menu *)));
+
 	layout1->addWidget(split);
 	layout1->addWidget(split);
 
 
 	if (name) {
 	if (name) {

+ 1 - 1
scripts/kconfig/qconf.h

@@ -279,7 +279,7 @@ class ConfigSearchWindow : public QDialog {
 	Q_OBJECT
 	Q_OBJECT
 	typedef class QDialog Parent;
 	typedef class QDialog Parent;
 public:
 public:
-	ConfigSearchWindow(QWidget* parent, const char *name = 0);
+	ConfigSearchWindow(ConfigMainWindow* parent, const char *name = 0);
 
 
 public slots:
 public slots:
 	void saveSettings(void);
 	void saveSettings(void);

+ 5 - 8
scripts/kconfig/symbol.c

@@ -786,13 +786,15 @@ static struct symbol *sym_check_expr_deps(struct expr *e)
 	return NULL;
 	return NULL;
 }
 }
 
 
+/* return NULL when dependencies are OK */
 struct symbol *sym_check_deps(struct symbol *sym)
 struct symbol *sym_check_deps(struct symbol *sym)
 {
 {
 	struct symbol *sym2;
 	struct symbol *sym2;
 	struct property *prop;
 	struct property *prop;
 
 
 	if (sym->flags & SYMBOL_CHECK) {
 	if (sym->flags & SYMBOL_CHECK) {
-		printf("Warning! Found recursive dependency: %s", sym->name);
+		fprintf(stderr, "%s:%d:error: found recursive dependency: %s",
+		        sym->prop->file->name, sym->prop->lineno, sym->name);
 		return sym;
 		return sym;
 	}
 	}
 	if (sym->flags & SYMBOL_CHECKED)
 	if (sym->flags & SYMBOL_CHECKED)
@@ -816,13 +818,8 @@ struct symbol *sym_check_deps(struct symbol *sym)
 			goto out;
 			goto out;
 	}
 	}
 out:
 out:
-	if (sym2) {
-		printf(" %s", sym->name);
-		if (sym2 == sym) {
-			printf("\n");
-			sym2 = NULL;
-		}
-	}
+	if (sym2)
+		fprintf(stderr, " -> %s%s", sym->name, sym2 == sym? "\n": "");
 	sym->flags &= ~SYMBOL_CHECK;
 	sym->flags &= ~SYMBOL_CHECK;
 	return sym2;
 	return sym2;
 }
 }

+ 1 - 1
scripts/kconfig/zconf.l

@@ -265,7 +265,7 @@ FILE *zconf_fopen(const char *name)
 	FILE *f;
 	FILE *f;
 
 
 	f = fopen(name, "r");
 	f = fopen(name, "r");
-	if (!f && name[0] != '/') {
+	if (!f && name != NULL && name[0] != '/') {
 		env = getenv(SRCTREE);
 		env = getenv(SRCTREE);
 		if (env) {
 		if (env) {
 			sprintf(fullname, "%s/%s", env, name);
 			sprintf(fullname, "%s/%s", env, name);

+ 4 - 2
scripts/kconfig/zconf.tab.c_shipped

@@ -2132,9 +2132,11 @@ void conf_parse(const char *name)
 	}
 	}
 	menu_finalize(&rootmenu);
 	menu_finalize(&rootmenu);
 	for_all_symbols(i, sym) {
 	for_all_symbols(i, sym) {
-		sym_check_deps(sym);
+		if (sym_check_deps(sym))
+			zconfnerrs++;
         }
         }
-
+	if (zconfnerrs)
+		exit(1);
 	sym_set_change_count(1);
 	sym_set_change_count(1);
 }
 }
 
 

+ 4 - 2
scripts/kconfig/zconf.y

@@ -501,9 +501,11 @@ void conf_parse(const char *name)
 	}
 	}
 	menu_finalize(&rootmenu);
 	menu_finalize(&rootmenu);
 	for_all_symbols(i, sym) {
 	for_all_symbols(i, sym) {
-		sym_check_deps(sym);
+		if (sym_check_deps(sym))
+			zconfnerrs++;
         }
         }
-
+	if (zconfnerrs)
+		exit(1);
 	sym_set_change_count(1);
 	sym_set_change_count(1);
 }
 }
 
 

+ 20 - 7
scripts/mkcompile_h

@@ -18,19 +18,32 @@ fi
 # Do not expand names
 # Do not expand names
 set -f
 set -f
 
 
-if [ -r .version ]; then
-  VERSION=`cat .version`
+# Fix the language to get consistent output
+LC_ALL=C
+export LC_ALL
+
+if [ -z "$KBUILD_BUILD_VERSION" ]; then
+	if [ -r .version ]; then
+		VERSION=`cat .version`
+	else
+		VERSION=0
+		echo 0 > .version
+	fi
 else
 else
-  VERSION=0
-  echo 0 > .version
+	VERSION=$KBUILD_BUILD_VERSION
 fi
 fi
 
 
+if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then
+	TIMESTAMP=`date`
+else
+	TIMESTAMP=$KBUILD_BUILD_TIMESTAMP
+fi
 
 
 UTS_VERSION="#$VERSION"
 UTS_VERSION="#$VERSION"
 CONFIG_FLAGS=""
 CONFIG_FLAGS=""
 if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
 if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
 if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
 if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
-UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS `LC_ALL=C LANG=C date`"
+UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
 
 
 # Truncate to maximum length
 # Truncate to maximum length
 
 
@@ -46,7 +59,7 @@ UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
 
 
   echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
   echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
 
 
-  echo \#define LINUX_COMPILE_TIME \"`LC_ALL=C LANG=C date +%T`\"
+  echo \#define LINUX_COMPILE_TIME \"`date +%T`\"
   echo \#define LINUX_COMPILE_BY \"`whoami`\"
   echo \#define LINUX_COMPILE_BY \"`whoami`\"
   echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
   echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
 
 
@@ -58,7 +71,7 @@ UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
     echo \#define LINUX_COMPILE_DOMAIN
     echo \#define LINUX_COMPILE_DOMAIN
   fi
   fi
 
 
-  echo \#define LINUX_COMPILER \"`LC_ALL=C LANG=C $CC -v 2>&1 | tail -n 1`\"
+  echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\"
 ) > .tmpcompile
 ) > .tmpcompile
 
 
 # Only replace the real compile.h if the new one is different,
 # Only replace the real compile.h if the new one is different,

+ 1 - 1
scripts/mkuboot.sh

@@ -4,7 +4,7 @@
 # Build U-Boot image when `mkimage' tool is available.
 # Build U-Boot image when `mkimage' tool is available.
 #
 #
 
 
-MKIMAGE=$(type -path ${CROSS_COMPILE}mkimage)
+MKIMAGE=$(type -path "${CROSS_COMPILE}mkimage")
 
 
 if [ -z "${MKIMAGE}" ]; then
 if [ -z "${MKIMAGE}" ]; then
 	MKIMAGE=$(type -path mkimage)
 	MKIMAGE=$(type -path mkimage)

+ 11 - 10
scripts/mod/file2alias.c

@@ -37,7 +37,6 @@ typedef unsigned char	__u8;
  * even potentially has different endianness and word sizes, since
  * even potentially has different endianness and word sizes, since
  * we handle those differences explicitly below */
  * we handle those differences explicitly below */
 #include "../../include/linux/mod_devicetable.h"
 #include "../../include/linux/mod_devicetable.h"
-#include "../../include/linux/input.h"
 
 
 #define ADD(str, sep, cond, field)                              \
 #define ADD(str, sep, cond, field)                              \
 do {                                                            \
 do {                                                            \
@@ -416,31 +415,33 @@ static int do_input_entry(const char *filename, struct input_device_id *id,
 
 
 	sprintf(alias + strlen(alias), "-e*");
 	sprintf(alias + strlen(alias), "-e*");
 	if (id->flags & INPUT_DEVICE_ID_MATCH_EVBIT)
 	if (id->flags & INPUT_DEVICE_ID_MATCH_EVBIT)
-		do_input(alias, id->evbit, 0, EV_MAX);
+		do_input(alias, id->evbit, 0, INPUT_DEVICE_ID_EV_MAX);
 	sprintf(alias + strlen(alias), "k*");
 	sprintf(alias + strlen(alias), "k*");
 	if (id->flags & INPUT_DEVICE_ID_MATCH_KEYBIT)
 	if (id->flags & INPUT_DEVICE_ID_MATCH_KEYBIT)
-		do_input(alias, id->keybit, KEY_MIN_INTERESTING, KEY_MAX);
+		do_input(alias, id->keybit,
+			 INPUT_DEVICE_ID_KEY_MIN_INTERESTING,
+			 INPUT_DEVICE_ID_KEY_MAX);
 	sprintf(alias + strlen(alias), "r*");
 	sprintf(alias + strlen(alias), "r*");
 	if (id->flags & INPUT_DEVICE_ID_MATCH_RELBIT)
 	if (id->flags & INPUT_DEVICE_ID_MATCH_RELBIT)
-		do_input(alias, id->relbit, 0, REL_MAX);
+		do_input(alias, id->relbit, 0, INPUT_DEVICE_ID_REL_MAX);
 	sprintf(alias + strlen(alias), "a*");
 	sprintf(alias + strlen(alias), "a*");
 	if (id->flags & INPUT_DEVICE_ID_MATCH_ABSBIT)
 	if (id->flags & INPUT_DEVICE_ID_MATCH_ABSBIT)
-		do_input(alias, id->absbit, 0, ABS_MAX);
+		do_input(alias, id->absbit, 0, INPUT_DEVICE_ID_ABS_MAX);
 	sprintf(alias + strlen(alias), "m*");
 	sprintf(alias + strlen(alias), "m*");
 	if (id->flags & INPUT_DEVICE_ID_MATCH_MSCIT)
 	if (id->flags & INPUT_DEVICE_ID_MATCH_MSCIT)
-		do_input(alias, id->mscbit, 0, MSC_MAX);
+		do_input(alias, id->mscbit, 0, INPUT_DEVICE_ID_MSC_MAX);
 	sprintf(alias + strlen(alias), "l*");
 	sprintf(alias + strlen(alias), "l*");
 	if (id->flags & INPUT_DEVICE_ID_MATCH_LEDBIT)
 	if (id->flags & INPUT_DEVICE_ID_MATCH_LEDBIT)
-		do_input(alias, id->ledbit, 0, LED_MAX);
+		do_input(alias, id->ledbit, 0, INPUT_DEVICE_ID_LED_MAX);
 	sprintf(alias + strlen(alias), "s*");
 	sprintf(alias + strlen(alias), "s*");
 	if (id->flags & INPUT_DEVICE_ID_MATCH_SNDBIT)
 	if (id->flags & INPUT_DEVICE_ID_MATCH_SNDBIT)
-		do_input(alias, id->sndbit, 0, SND_MAX);
+		do_input(alias, id->sndbit, 0, INPUT_DEVICE_ID_SND_MAX);
 	sprintf(alias + strlen(alias), "f*");
 	sprintf(alias + strlen(alias), "f*");
 	if (id->flags & INPUT_DEVICE_ID_MATCH_FFBIT)
 	if (id->flags & INPUT_DEVICE_ID_MATCH_FFBIT)
-		do_input(alias, id->ffbit, 0, FF_MAX);
+		do_input(alias, id->ffbit, 0, INPUT_DEVICE_ID_FF_MAX);
 	sprintf(alias + strlen(alias), "w*");
 	sprintf(alias + strlen(alias), "w*");
 	if (id->flags & INPUT_DEVICE_ID_MATCH_SWBIT)
 	if (id->flags & INPUT_DEVICE_ID_MATCH_SWBIT)
-		do_input(alias, id->swbit, 0, SW_MAX);
+		do_input(alias, id->swbit, 0, INPUT_DEVICE_ID_SW_MAX);
 	return 1;
 	return 1;
 }
 }
 
 

+ 108 - 33
scripts/mod/modpost.c

@@ -55,6 +55,17 @@ void warn(const char *fmt, ...)
 	va_end(arglist);
 	va_end(arglist);
 }
 }
 
 
+void merror(const char *fmt, ...)
+{
+	va_list arglist;
+
+	fprintf(stderr, "ERROR: ");
+
+	va_start(arglist, fmt);
+	vfprintf(stderr, fmt, arglist);
+	va_end(arglist);
+}
+
 static int is_vmlinux(const char *modname)
 static int is_vmlinux(const char *modname)
 {
 {
 	const char *myname;
 	const char *myname;
@@ -333,10 +344,10 @@ void release_file(void *file, unsigned long size)
 	munmap(file, size);
 	munmap(file, size);
 }
 }
 
 
-static void parse_elf(struct elf_info *info, const char *filename)
+static int parse_elf(struct elf_info *info, const char *filename)
 {
 {
 	unsigned int i;
 	unsigned int i;
-	Elf_Ehdr *hdr = info->hdr;
+	Elf_Ehdr *hdr;
 	Elf_Shdr *sechdrs;
 	Elf_Shdr *sechdrs;
 	Elf_Sym  *sym;
 	Elf_Sym  *sym;
 
 
@@ -346,9 +357,18 @@ static void parse_elf(struct elf_info *info, const char *filename)
 		exit(1);
 		exit(1);
 	}
 	}
 	info->hdr = hdr;
 	info->hdr = hdr;
-	if (info->size < sizeof(*hdr))
-		goto truncated;
-
+	if (info->size < sizeof(*hdr)) {
+		/* file too small, assume this is an empty .o file */
+		return 0;
+	}
+	/* Is this a valid ELF file? */
+	if ((hdr->e_ident[EI_MAG0] != ELFMAG0) ||
+	    (hdr->e_ident[EI_MAG1] != ELFMAG1) ||
+	    (hdr->e_ident[EI_MAG2] != ELFMAG2) ||
+	    (hdr->e_ident[EI_MAG3] != ELFMAG3)) {
+		/* Not an ELF file - silently ignore it */
+		return 0;
+	}
 	/* Fix endianness in ELF header */
 	/* Fix endianness in ELF header */
 	hdr->e_shoff    = TO_NATIVE(hdr->e_shoff);
 	hdr->e_shoff    = TO_NATIVE(hdr->e_shoff);
 	hdr->e_shstrndx = TO_NATIVE(hdr->e_shstrndx);
 	hdr->e_shstrndx = TO_NATIVE(hdr->e_shstrndx);
@@ -371,8 +391,10 @@ static void parse_elf(struct elf_info *info, const char *filename)
 			= (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
 			= (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
 		const char *secname;
 		const char *secname;
 
 
-		if (sechdrs[i].sh_offset > info->size)
-			goto truncated;
+		if (sechdrs[i].sh_offset > info->size) {
+			fatal("%s is truncated. sechdrs[i].sh_offset=%u > sizeof(*hrd)=%ul\n", filename, (unsigned int)sechdrs[i].sh_offset, sizeof(*hdr));
+			return 0;
+		}
 		secname = secstrings + sechdrs[i].sh_name;
 		secname = secstrings + sechdrs[i].sh_name;
 		if (strcmp(secname, ".modinfo") == 0) {
 		if (strcmp(secname, ".modinfo") == 0) {
 			info->modinfo = (void *)hdr + sechdrs[i].sh_offset;
 			info->modinfo = (void *)hdr + sechdrs[i].sh_offset;
@@ -407,10 +429,7 @@ static void parse_elf(struct elf_info *info, const char *filename)
 		sym->st_value = TO_NATIVE(sym->st_value);
 		sym->st_value = TO_NATIVE(sym->st_value);
 		sym->st_size  = TO_NATIVE(sym->st_size);
 		sym->st_size  = TO_NATIVE(sym->st_size);
 	}
 	}
-	return;
-
- truncated:
-	fatal("%s is truncated.\n", filename);
+	return 1;
 }
 }
 
 
 static void parse_elf_finish(struct elf_info *info)
 static void parse_elf_finish(struct elf_info *info)
@@ -581,9 +600,17 @@ static int strrcmp(const char *s, const char *sub)
  *   the pattern is identified by:
  *   the pattern is identified by:
  *   tosec   = .init.text | .exit.text | .init.data
  *   tosec   = .init.text | .exit.text | .init.data
  *   fromsec = .data
  *   fromsec = .data
- *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one
+ *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console
  *
  *
  * Pattern 3:
  * Pattern 3:
+ *   Whitelist all references from .pci_fixup* section to .init.text
+ *   This is part of the PCI init when built-in
+ *
+ * Pattern 4:
+ *   Whitelist all refereces from .text.head to .init.data
+ *   Whitelist all refereces from .text.head to .init.text
+ *
+ * Pattern 5:
  *   Some symbols belong to init section but still it is ok to reference
  *   Some symbols belong to init section but still it is ok to reference
  *   these from non-init sections as these symbols don't have any memory
  *   these from non-init sections as these symbols don't have any memory
  *   allocated for them and symbol address and value are same. So even
  *   allocated for them and symbol address and value are same. So even
@@ -591,6 +618,30 @@ static int strrcmp(const char *s, const char *sub)
  *   For ex. symbols marking the init section boundaries.
  *   For ex. symbols marking the init section boundaries.
  *   This pattern is identified by
  *   This pattern is identified by
  *   refsymname = __init_begin, _sinittext, _einittext
  *   refsymname = __init_begin, _sinittext, _einittext
+ *
+ * Pattern 6:
+ *   During the early init phase we have references from .init.text to
+ *   .text we have an intended section mismatch - do not warn about it.
+ *   See kernel_init() in init/main.c
+ *   tosec   = .init.text
+ *   fromsec = .text
+ *   atsym = kernel_init
+ *
+ * Pattern 7:
+ *  Logos used in drivers/video/logo reside in __initdata but the
+ *  funtion that references them are EXPORT_SYMBOL() so cannot be
+ *  marker __init. So we whitelist them here.
+ *  The pattern is:
+ *  tosec      = .init.data
+ *  fromsec    = .text*
+ *  refsymname = logo_
+ *
+ * Pattern 8:
+ *  Symbols contained in .paravirtprobe may safely reference .init.text.
+ *  The pattern is:
+ *  tosec   = .init.text
+ *  fromsec  = .paravirtprobe
+ *
  **/
  **/
 static int secref_whitelist(const char *modname, const char *tosec,
 static int secref_whitelist(const char *modname, const char *tosec,
 			    const char *fromsec, const char *atsym,
 			    const char *fromsec, const char *atsym,
@@ -642,25 +693,39 @@ static int secref_whitelist(const char *modname, const char *tosec,
 	if (f1 && f2)
 	if (f1 && f2)
 		return 1;
 		return 1;
 
 
-	/* Whitelist all references from .pci_fixup section if vmlinux
-	 * Whitelist all refereces from .text.head to .init.data if vmlinux
-	 * Whitelist all refereces from .text.head to .init.text if vmlinux
-	 */
-	if (is_vmlinux(modname)) {
-		if ((strcmp(fromsec, ".pci_fixup") == 0) &&
-		    (strcmp(tosec, ".init.text") == 0))
+	/* Check for pattern 3 */
+	if ((strncmp(fromsec, ".pci_fixup", strlen(".pci_fixup")) == 0) &&
+	    (strcmp(tosec, ".init.text") == 0))
+	return 1;
+
+	/* Check for pattern 4 */
+	if ((strcmp(fromsec, ".text.head") == 0) &&
+		((strcmp(tosec, ".init.data") == 0) ||
+		(strcmp(tosec, ".init.text") == 0)))
+	return 1;
+
+	/* Check for pattern 5 */
+	for (s = pat3refsym; *s; s++)
+		if (strcmp(refsymname, *s) == 0)
+			return 1;
+
+	/* Check for pattern 6 */
+	if ((strcmp(tosec, ".init.text") == 0) &&
+	    (strcmp(fromsec, ".text") == 0) &&
+	    (strcmp(refsymname, "kernel_init") == 0))
 		return 1;
 		return 1;
 
 
-		if ((strcmp(fromsec, ".text.head") == 0) &&
-			((strcmp(tosec, ".init.data") == 0) ||
-			(strcmp(tosec, ".init.text") == 0)))
+	/* Check for pattern 7 */
+	if ((strcmp(tosec, ".init.data") == 0) &&
+	    (strncmp(fromsec, ".text", strlen(".text")) == 0) &&
+	    (strncmp(refsymname, "logo_", strlen("logo_")) == 0))
+		return 1;
+
+	/* Check for pattern 8 */
+	if ((strcmp(tosec, ".init.text") == 0) &&
+	    (strcmp(fromsec, ".paravirtprobe") == 0))
 		return 1;
 		return 1;
 
 
-		/* Check for pattern 3 */
-		for (s = pat3refsym; *s; s++)
-			if (strcmp(refsymname, *s) == 0)
-				return 1;
-	}
 	return 0;
 	return 0;
 }
 }
 
 
@@ -1090,7 +1155,8 @@ static void read_symbols(char *modname)
 	struct elf_info info = { };
 	struct elf_info info = { };
 	Elf_Sym *sym;
 	Elf_Sym *sym;
 
 
-	parse_elf(&info, modname);
+	if (!parse_elf(&info, modname))
+		return;
 
 
 	mod = new_module(modname);
 	mod = new_module(modname);
 
 
@@ -1265,9 +1331,14 @@ static int add_versions(struct buffer *b, struct module *mod)
 		exp = find_symbol(s->name);
 		exp = find_symbol(s->name);
 		if (!exp || exp->module == mod) {
 		if (!exp || exp->module == mod) {
 			if (have_vmlinux && !s->weak) {
 			if (have_vmlinux && !s->weak) {
-				warn("\"%s\" [%s.ko] undefined!\n",
-				     s->name, mod->name);
-				err = warn_unresolved ? 0 : 1;
+				if (warn_unresolved) {
+					warn("\"%s\" [%s.ko] undefined!\n",
+					     s->name, mod->name);
+				} else {
+					merror("\"%s\" [%s.ko] undefined!\n",
+					          s->name, mod->name);
+					err = 1;
+				}
 			}
 			}
 			continue;
 			continue;
 		}
 		}
@@ -1318,6 +1389,7 @@ static void add_depends(struct buffer *b, struct module *mod,
 	buf_printf(b, "__attribute__((section(\".modinfo\"))) =\n");
 	buf_printf(b, "__attribute__((section(\".modinfo\"))) =\n");
 	buf_printf(b, "\"depends=");
 	buf_printf(b, "\"depends=");
 	for (s = mod->unres; s; s = s->next) {
 	for (s = mod->unres; s; s = s->next) {
+		const char *p;
 		if (!s->module)
 		if (!s->module)
 			continue;
 			continue;
 
 
@@ -1325,8 +1397,11 @@ static void add_depends(struct buffer *b, struct module *mod,
 			continue;
 			continue;
 
 
 		s->module->seen = 1;
 		s->module->seen = 1;
-		buf_printf(b, "%s%s", first ? "" : ",",
-			   strrchr(s->module->name, '/') + 1);
+		if ((p = strrchr(s->module->name, '/')) != NULL)
+			p++;
+		else
+			p = s->module->name;
+		buf_printf(b, "%s%s", first ? "" : ",", p);
 		first = 0;
 		first = 0;
 	}
 	}
 	buf_printf(b, "\";\n");
 	buf_printf(b, "\";\n");

+ 1 - 0
scripts/mod/modpost.h

@@ -145,3 +145,4 @@ void release_file(void *file, unsigned long size);
 
 
 void fatal(const char *fmt, ...);
 void fatal(const char *fmt, ...);
 void warn(const char *fmt, ...);
 void warn(const char *fmt, ...);
+void merror(const char *fmt, ...);

+ 2 - 3
scripts/mod/sumversion.c

@@ -397,10 +397,9 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen)
 		(int) strlen(basename) - 2, basename);
 		(int) strlen(basename) - 2, basename);
 
 
 	file = grab_file(filelist, &len);
 	file = grab_file(filelist, &len);
-	if (!file) {
-		warn("could not find versions for %s\n", filelist);
+	if (!file)
+		/* not a module or .mod file missing - ignore */
 		return;
 		return;
-	}
 
 
 	sources = strchr(file, '\n');
 	sources = strchr(file, '\n');
 	if (!sources) {
 	if (!sources) {

+ 1 - 1
usr/Kconfig

@@ -17,7 +17,7 @@ config INITRAMFS_SOURCE
 	  When multiple directories and files are specified then the
 	  When multiple directories and files are specified then the
 	  initramfs image will be the aggregate of all of them.
 	  initramfs image will be the aggregate of all of them.
 
 
-	  See <file:Documentation/early-userspace/README for more details.
+	  See <file:Documentation/early-userspace/README> for more details.
 
 
 	  If you are not sure, leave it blank.
 	  If you are not sure, leave it blank.