Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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
...

+766 -168
+3 -6
Documentation/DocBook/Makefile
··· 41 41 PDF := $(patsubst %.xml, %.pdf, $(BOOKS)) 42 42 pdfdocs: $(PDF) 43 43 44 - HTML := $(patsubst %.xml, %.html, $(BOOKS)) 44 + HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS))) 45 45 htmldocs: $(HTML) 46 46 47 47 MAN := $(patsubst %.xml, %.9, $(BOOKS)) ··· 152 152 @(which xmlto > /dev/null 2>&1) || \ 153 153 (echo "*** You need to install xmlto ***"; \ 154 154 exit 1) 155 + $(Q)mkdir -p $(obj)/man 155 156 $(call cmd,db2man) 156 157 @touch $@ 157 158 ··· 213 212 $(patsubst %.xml, %.9, $(DOCBOOKS)) \ 214 213 $(C-procfs-example) 215 214 216 - clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) 217 - 218 - #man put files in man subdir - traverse down 219 - subdir- := man/ 220 - 215 + clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man 221 216 222 217 # Declare the contents of the .PHONY variable as phony. We keep that 223 218 # information in a variable se we can use it in if_changed and friends.
-3
Documentation/DocBook/man/Makefile
··· 1 - # Rules are put in Documentation/DocBook 2 - 3 - clean-files := *.9.gz *.sgml manpage.links manpage.refs
+1 -1
Documentation/kbuild/modules.txt
··· 249 249 --> filename: Makefile 250 250 KERNELDIR := /lib/modules/`uname -r`/build 251 251 all:: 252 - $(MAKE) -C $KERNELDIR M=`pwd` $@ 252 + $(MAKE) -C $(KERNELDIR) M=`pwd` $@ 253 253 254 254 # Module specific targets 255 255 genbin:
+11
Kbuild
··· 2 2 # Kbuild for top-level directory of the kernel 3 3 # This file takes care of the following: 4 4 # 1) Generate asm-offsets.h 5 + # 2) Check for missing system calls 5 6 6 7 ##### 7 8 # 1) Generate asm-offsets.h ··· 47 46 $(Q)mkdir -p $(dir $@) 48 47 $(call cmd,offsets) 49 48 49 + ##### 50 + # 2) Check for missing system calls 51 + # 52 + 53 + quiet_cmd_syscalls = CALL $< 54 + cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) 55 + 56 + PHONY += missing-syscalls 57 + missing-syscalls: scripts/checksyscalls.sh FORCE 58 + $(call cmd,syscalls)
+9 -6
Makefile
··· 576 576 # --------------------------------------------------------------------------- 577 577 # vmlinux is built from the objects selected by $(vmlinux-init) and 578 578 # $(vmlinux-main). Most are built-in.o files from top-level directories 579 - # in the kernel tree, others are specified in arch/$(ARCH)Makefile. 579 + # in the kernel tree, others are specified in arch/$(ARCH)/Makefile. 580 580 # Ordering when linking is important, and $(vmlinux-init) must be first. 581 581 # 582 582 # vmlinux ··· 603 603 vmlinux-main := $(core-y) $(libs-y) $(drivers-y) $(net-y) 604 604 vmlinux-all := $(vmlinux-init) $(vmlinux-main) 605 605 vmlinux-lds := arch/$(ARCH)/kernel/vmlinux.lds 606 + export KBUILD_VMLINUX_OBJS := $(vmlinux-all) 606 607 607 608 # Rule to link vmlinux - also used during CONFIG_KALLSYMS 608 609 # May be overridden by arch/$(ARCH)/Makefile ··· 856 855 857 856 prepare0: archprepare FORCE 858 857 $(Q)$(MAKE) $(build)=. 858 + $(Q)$(MAKE) $(build)=. missing-syscalls 859 859 860 860 # All the preparing.. 861 861 prepare: prepare0 ··· 1279 1277 ALLSOURCE_ARCHS := $(ARCH) 1280 1278 1281 1279 define find-sources 1282 - ( find $(__srctree) $(RCS_FIND_IGNORE) \ 1283 - \( -name include -o -name arch \) -prune -o \ 1284 - -name $1 -print; \ 1285 - for ARCH in $(ALLSOURCE_ARCHS) ; do \ 1280 + ( for ARCH in $(ALLSOURCE_ARCHS) ; do \ 1286 1281 find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \ 1287 1282 -name $1 -print; \ 1288 1283 done ; \ ··· 1293 1294 -name $1 -print; \ 1294 1295 done ; \ 1295 1296 find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \ 1296 - -name $1 -print ) 1297 + -name $1 -print; \ 1298 + find $(__srctree) $(RCS_FIND_IGNORE) \ 1299 + \( -name include -o -name arch \) -prune -o \ 1300 + -name $1 -print; \ 1301 + ) 1297 1302 endef 1298 1303 1299 1304 define all-sources
+2 -2
drivers/mtd/devices/Kconfig
··· 49 49 50 50 If you want to compile this driver as a module ( = code which can be 51 51 inserted in and removed from the running kernel whenever you want), 52 - say M here and read <file:Documentation/modules.txt>. The module will 53 - be called ms02-nv.o. 52 + say M here and read <file:Documentation/kbuild/modules.txt>. 53 + The module will be called ms02-nv.ko. 54 54 55 55 config MTD_DATAFLASH 56 56 tristate "Support for AT45xxx DataFlash"
+3 -3
drivers/net/Kconfig
··· 833 833 This driver is also available as a module ( = code which can be 834 834 inserted in and removed from the running kernel whenever you want). 835 835 The module will be called smc91x. If you want to compile it as a 836 - module, say M here and read <file:Documentation/modules.txt> as well 837 - as <file:Documentation/networking/net-modules.txt>. 836 + module, say M here and read <file:Documentation/kbuild/modules.txt> 837 + as well as <file:Documentation/networking/net-modules.txt>. 838 838 839 839 config SMC9194 840 840 tristate "SMC 9194 support" ··· 889 889 890 890 This driver is also available as a module. The module will be 891 891 called smc911x. If you want to compile it as a module, say M 892 - here and read <file:Documentation/modules.txt> 892 + here and read <file:Documentation/kbuild/modules.txt> 893 893 894 894 config NET_VENDOR_RACAL 895 895 bool "Racal-Interlan (Micom) NI cards"
+6 -6
drivers/net/wireless/Kconfig
··· 153 153 154 154 If you want to compile the driver as a module ( = code which can be 155 155 inserted in and removed from the running kernel whenever you want), 156 - say M here and read <file:Documentation/modules.txt>. The module 157 - will be called ipw2100.ko. 156 + say M here and read <file:Documentation/kbuild/modules.txt>. 157 + The module will be called ipw2100.ko. 158 158 159 159 config IPW2100_MONITOR 160 160 bool "Enable promiscuous mode" ··· 208 208 209 209 If you want to compile the driver as a module ( = code which can be 210 210 inserted in and removed from the running kernel whenever you want), 211 - say M here and read <file:Documentation/modules.txt>. The module 212 - will be called ipw2200.ko. 211 + say M here and read <file:Documentation/kbuild/modules.txt>. 212 + The module will be called ipw2200.ko. 213 213 214 214 config IPW2200_MONITOR 215 215 bool "Enable promiscuous mode" ··· 517 517 518 518 If you want to compile the driver as a module ( = code which can be 519 519 inserted in and removed from the running kernel whenever you want), 520 - say M here and read <file:Documentation/modules.txt>. The module 521 - will be called prism54.ko. 520 + say M here and read <file:Documentation/kbuild/modules.txt>. 521 + The module will be called prism54.ko. 522 522 523 523 config USB_ZD1201 524 524 tristate "USB ZD1201 based Wireless device support"
+2 -2
drivers/scsi/Kconfig
··· 170 170 171 171 If you want to compile this as a module ( = code which can be 172 172 inserted in and removed from the running kernel whenever you want), 173 - say M here and read <file:Documentation/modules.txt> and 173 + say M here and read <file:Documentation/kbuild/modules.txt> and 174 174 <file:Documentation/scsi.txt>. The module will be called ch.o. 175 175 If unsure, say N. 176 176 ··· 1783 1783 1784 1784 This driver is also available as a module. This module will be 1785 1785 called zfcp. If you want to compile it as a module, say M here 1786 - and read <file:Documentation/modules.txt>. 1786 + and read <file:Documentation/kbuild/modules.txt>. 1787 1787 1788 1788 config SCSI_SRP 1789 1789 tristate "SCSI RDMA Protocol helper library"
+4 -4
drivers/video/Kconfig
··· 191 191 192 192 If you want to compile this as a module (=code which can be 193 193 inserted into and removed from the running kernel), say M 194 - here and read <file:Documentation/modules.txt>. The module 194 + here and read <file:Documentation/kbuild/modules.txt>. The module 195 195 will be called amba-clcd. 196 196 197 197 choice ··· 1494 1494 This driver is also available as a module ( = code which can be 1495 1495 inserted and removed from the running kernel whenever you want). The 1496 1496 module will be called pxafb. If you want to compile it as a module, 1497 - say M here and read <file:Documentation/modules.txt>. 1497 + say M here and read <file:Documentation/kbuild/modules.txt>. 1498 1498 1499 1499 If unsure, say N. 1500 1500 ··· 1547 1547 This driver is also available as a module ( = code which can be 1548 1548 inserted and removed from the running kernel whenever you want). The 1549 1549 module will be called w100fb. If you want to compile it as a module, 1550 - say M here and read <file:Documentation/modules.txt>. 1550 + say M here and read <file:Documentation/kbuild/modules.txt>. 1551 1551 1552 1552 If unsure, say N. 1553 1553 ··· 1564 1564 This driver is also available as a module ( = code which can be 1565 1565 inserted and removed from the running kernel whenever you want). The 1566 1566 module will be called s3c2410fb. If you want to compile it as a module, 1567 - say M here and read <file:Documentation/modules.txt>. 1567 + say M here and read <file:Documentation/kbuild/modules.txt>. 1568 1568 1569 1569 If unsure, say N. 1570 1570 config FB_S3C2410_DEBUG
+4
include/linux/input.h
··· 990 990 #error "EV_MAX and INPUT_DEVICE_ID_EV_MAX do not match" 991 991 #endif 992 992 993 + #if KEY_MIN_INTERESTING != INPUT_DEVICE_ID_KEY_MIN_INTERESTING 994 + #error "KEY_MIN_INTERESTING and INPUT_DEVICE_ID_KEY_MIN_INTERESTING do not match" 995 + #endif 996 + 993 997 #if KEY_MAX != INPUT_DEVICE_ID_KEY_MAX 994 998 #error "KEY_MAX and INPUT_DEVICE_ID_KEY_MAX do not match" 995 999 #endif
+1
include/linux/mod_devicetable.h
··· 262 262 263 263 /* Input */ 264 264 #define INPUT_DEVICE_ID_EV_MAX 0x1f 265 + #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71 265 266 #define INPUT_DEVICE_ID_KEY_MAX 0x1ff 266 267 #define INPUT_DEVICE_ID_REL_MAX 0x0f 267 268 #define INPUT_DEVICE_ID_ABS_MAX 0x3f
+10 -6
init/Kconfig
··· 80 80 default y 81 81 help 82 82 This will try to automatically determine if the current tree is a 83 - release tree by looking for git tags that 84 - belong to the current top of tree revision. 83 + release tree by looking for git tags that belong to the current 84 + top of tree revision. 85 85 86 86 A string of the format -gxxxxxxxx will be added to the localversion 87 - if a git based tree is found. The string generated by this will be 87 + if a git-based tree is found. The string generated by this will be 88 88 appended after any matching localversion* files, and after the value 89 - set in CONFIG_LOCALVERSION 89 + set in CONFIG_LOCALVERSION. 90 90 91 - Note: This requires Perl, and a git repository, but not necessarily 92 - the git or cogito tools to be installed. 91 + (The actual string used here is the first eight characters produced 92 + by running the command: 93 + 94 + $ git rev-parse --verify HEAD 95 + 96 + which is done within the script "scripts/setlocalversion".) 93 97 94 98 config SWAP 95 99 bool "Support for paging of anonymous memory (swap)"
+3 -3
init/main.c
··· 82 82 #warning gcc-4.1.0 is known to miscompile the kernel. A different compiler version is recommended. 83 83 #endif 84 84 85 - static int init(void *); 85 + static int kernel_init(void *); 86 86 87 87 extern void init_IRQ(void); 88 88 extern void fork_init(unsigned long); ··· 431 431 static void noinline rest_init(void) 432 432 __releases(kernel_lock) 433 433 { 434 - kernel_thread(init, NULL, CLONE_FS | CLONE_SIGHAND); 434 + kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND); 435 435 numa_default_policy(); 436 436 unlock_kernel(); 437 437 ··· 768 768 panic("No init found. Try passing init= option to kernel."); 769 769 } 770 770 771 - static int __init init(void * unused) 771 + static int __init kernel_init(void * unused) 772 772 { 773 773 lock_kernel(); 774 774 /*
+3
lib/Kconfig.debug
··· 333 333 help 334 334 If you say Y here the resulting kernel image will include 335 335 debugging info resulting in a larger kernel image. 336 + This adds debug symbols to the kernel and modules (gcc -g), and 337 + is needed if you intend to use kernel crashdump or binary object 338 + tools like crash, kgdb, LKCD, gdb, etc on the kernel. 336 339 Say Y here only if you plan to debug the kernel. 337 340 338 341 If unsure, say N.
+1 -1
net/ipv6/netfilter/Kconfig
··· 198 198 and OUTPUT chains. 199 199 200 200 If you want to compile it as a module, say M here and read 201 - <file:Documentation/modules.txt>. If unsure, say `N'. 201 + <file:Documentation/kbuild/modules.txt>. If unsure, say `N'. 202 202 203 203 endmenu 204 204
+12 -12
net/netfilter/Kconfig
··· 100 100 tracking code will be able to do state tracking on SCTP connections. 101 101 102 102 If you want to compile it as a module, say M here and read 103 - Documentation/modules.txt. If unsure, say `N'. 103 + <file:Documentation/kbuild/modules.txt>. If unsure, say `N'. 104 104 105 105 config NF_CONNTRACK_AMANDA 106 106 tristate "Amanda backup protocol support" ··· 279 279 affects the connection mark value rather than the packet mark value. 280 280 281 281 If you want to compile it as a module, say M here and read 282 - <file:Documentation/modules.txt>. The module will be called 283 - ipt_CONNMARK.o. If unsure, say `N'. 282 + <file:Documentation/kbuild/modules.txt>. The module will be called 283 + ipt_CONNMARK.ko. If unsure, say `N'. 284 284 285 285 config NETFILTER_XT_TARGET_DSCP 286 286 tristate '"DSCP" target support' ··· 341 341 no protocol helpers for the selected packets). 342 342 343 343 If you want to compile it as a module, say M here and read 344 - <file:Documentation/modules.txt>. If unsure, say `N'. 344 + <file:Documentation/kbuild/modules.txt>. If unsure, say `N'. 345 345 346 346 config NETFILTER_XT_TARGET_SECMARK 347 347 tristate '"SECMARK" target support' ··· 397 397 comments in your iptables ruleset. 398 398 399 399 If you want to compile it as a module, say M here and read 400 - <file:Documentation/modules.txt>. If unsure, say `N'. 400 + <file:Documentation/kbuild/modules.txt>. If unsure, say `N'. 401 401 402 402 config NETFILTER_XT_MATCH_CONNBYTES 403 403 tristate '"connbytes" per-connection counter match support' ··· 409 409 number of bytes and/or packets for each direction within a connection. 410 410 411 411 If you want to compile it as a module, say M here and read 412 - <file:Documentation/modules.txt>. If unsure, say `N'. 412 + <file:Documentation/kbuild/modules.txt>. If unsure, say `N'. 413 413 414 414 config NETFILTER_XT_MATCH_CONNMARK 415 415 tristate '"connmark" connection mark match support' ··· 421 421 connection mark value previously set for the session by `CONNMARK'. 422 422 423 423 If you want to compile it as a module, say M here and read 424 - <file:Documentation/modules.txt>. The module will be called 425 - ipt_connmark.o. If unsure, say `N'. 424 + <file:Documentation/kbuild/modules.txt>. The module will be called 425 + ipt_connmark.ko. If unsure, say `N'. 426 426 427 427 config NETFILTER_XT_MATCH_CONNTRACK 428 428 tristate '"conntrack" connection tracking match support' ··· 446 446 and DCCP flags. 447 447 448 448 If you want to compile it as a module, say M here and read 449 - <file:Documentation/modules.txt>. If unsure, say `N'. 449 + <file:Documentation/kbuild/modules.txt>. If unsure, say `N'. 450 450 451 451 config NETFILTER_XT_MATCH_DSCP 452 452 tristate '"DSCP" match support' ··· 565 565 byte counter. 566 566 567 567 If you want to compile it as a module, say M here and read 568 - <file:Documentation/modules.txt>. If unsure, say `N'. 568 + <file:Documentation/kbuild/modules.txt>. If unsure, say `N'. 569 569 570 570 config NETFILTER_XT_MATCH_REALM 571 571 tristate '"realm" match support' ··· 579 579 in tc world. 580 580 581 581 If you want to compile it as a module, say M here and read 582 - <file:Documentation/modules.txt>. If unsure, say `N'. 582 + <file:Documentation/kbuild/modules.txt>. If unsure, say `N'. 583 583 584 584 config NETFILTER_XT_MATCH_SCTP 585 585 tristate '"sctp" protocol match support (EXPERIMENTAL)' ··· 590 590 and SCTP chunk types. 591 591 592 592 If you want to compile it as a module, say M here and read 593 - <file:Documentation/modules.txt>. If unsure, say `N'. 593 + <file:Documentation/kbuild/modules.txt>. If unsure, say `N'. 594 594 595 595 config NETFILTER_XT_MATCH_STATE 596 596 tristate '"state" match support'
+1 -1
net/tipc/Kconfig
··· 18 18 This protocol support is also available as a module ( = code which 19 19 can be inserted in and removed from the running kernel whenever you 20 20 want). The module will be called tipc. If you want to compile it 21 - as a module, say M here and read <file:Documentation/modules.txt>. 21 + as a module, say M here and read <file:Documentation/kbuild/modules.txt>. 22 22 23 23 If in doubt, say N. 24 24
+9 -10
scripts/Makefile.build
··· 131 131 quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ 132 132 cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $< 133 133 134 - %.s: %.c FORCE 134 + $(obj)/%.s: $(src)/%.c FORCE 135 135 $(call if_changed_dep,cc_s_c) 136 136 137 137 quiet_cmd_cc_i_c = CPP $(quiet_modtag) $@ 138 138 cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $< 139 139 140 - %.i: %.c FORCE 140 + $(obj)/%.i: $(src)/%.c FORCE 141 141 $(call if_changed_dep,cc_i_c) 142 142 143 143 quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@ ··· 146 146 | $(GENKSYMS) -T $@ >/dev/null; \ 147 147 test -s $@ || rm -f $@ 148 148 149 - %.symtypes : %.c FORCE 149 + $(obj)/%.symtypes : $(src)/%.c FORCE 150 150 $(call if_changed_dep,cc_symtypes_c) 151 151 152 152 # C (.c) files ··· 198 198 endef 199 199 200 200 # Built-in and composite module parts 201 - 202 - %.o: %.c FORCE 201 + $(obj)/%.o: $(src)/%.c FORCE 203 202 $(call cmd,force_checksrc) 204 203 $(call if_changed_rule,cc_o_c) 205 204 206 205 # Single-part modules are special since we need to mark them in $(MODVERDIR) 207 206 208 - $(single-used-m): %.o: %.c FORCE 207 + $(single-used-m): $(obj)/%.o: $(src)/%.c FORCE 209 208 $(call cmd,force_checksrc) 210 209 $(call if_changed_rule,cc_o_c) 211 210 @{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod) ··· 214 215 $(CONFIG_SHELL) $(srctree)/scripts/makelst $*.o \ 215 216 System.map $(OBJDUMP) > $@ 216 217 217 - %.lst: %.c FORCE 218 + $(obj)/%.lst: $(src)/%.c FORCE 218 219 $(call if_changed_dep,cc_lst_c) 219 220 220 221 # Compile assembler sources (.S) ··· 228 229 quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ 229 230 cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< 230 231 231 - %.s: %.S FORCE 232 + $(obj)/%.s: $(src)/%.S FORCE 232 233 $(call if_changed_dep,as_s_S) 233 234 234 235 quiet_cmd_as_o_S = AS $(quiet_modtag) $@ 235 236 cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< 236 237 237 - %.o: %.S FORCE 238 + $(obj)/%.o: $(src)/%.S FORCE 238 239 $(call if_changed_dep,as_o_S) 239 240 240 241 targets += $(real-objs-y) $(real-objs-m) $(lib-y) ··· 245 246 quiet_cmd_cpp_lds_S = LDS $@ 246 247 cmd_cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -o $@ $< 247 248 248 - %.lds: %.lds.S FORCE 249 + $(obj)/%.lds: $(src)/%.lds.S FORCE 249 250 $(call if_changed_dep,cpp_lds_S) 250 251 251 252 # Build the compiled-in targets
+7 -7
scripts/Makefile.host
··· 114 114 quiet_cmd_host-csingle = HOSTCC $@ 115 115 cmd_host-csingle = $(HOSTCC) $(hostc_flags) -o $@ $< \ 116 116 $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) 117 - $(host-csingle): %: %.c FORCE 117 + $(host-csingle): $(obj)/%: $(src)/%.c FORCE 118 118 $(call if_changed_dep,host-csingle) 119 119 120 120 # Link an executable based on list of .o files, all plain c ··· 123 123 cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \ 124 124 $(addprefix $(obj)/,$($(@F)-objs)) \ 125 125 $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) 126 - $(host-cmulti): %: $(host-cobjs) $(host-cshlib) FORCE 126 + $(host-cmulti): $(obj)/%: $(host-cobjs) $(host-cshlib) FORCE 127 127 $(call if_changed,host-cmulti) 128 128 129 129 # Create .o file from a single .c file 130 130 # host-cobjs -> .o 131 131 quiet_cmd_host-cobjs = HOSTCC $@ 132 132 cmd_host-cobjs = $(HOSTCC) $(hostc_flags) -c -o $@ $< 133 - $(host-cobjs): %.o: %.c FORCE 133 + $(host-cobjs): $(obj)/%.o: $(src)/%.c FORCE 134 134 $(call if_changed_dep,host-cobjs) 135 135 136 136 # Link an executable based on list of .o files, a mixture of .c and .cc ··· 140 140 $(foreach o,objs cxxobjs,\ 141 141 $(addprefix $(obj)/,$($(@F)-$(o)))) \ 142 142 $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) 143 - $(host-cxxmulti): %: $(host-cobjs) $(host-cxxobjs) $(host-cshlib) FORCE 143 + $(host-cxxmulti): $(obj)/%: $(host-cobjs) $(host-cxxobjs) $(host-cshlib) FORCE 144 144 $(call if_changed,host-cxxmulti) 145 145 146 146 # Create .o file from a single .cc (C++) file 147 147 quiet_cmd_host-cxxobjs = HOSTCXX $@ 148 148 cmd_host-cxxobjs = $(HOSTCXX) $(hostcxx_flags) -c -o $@ $< 149 - $(host-cxxobjs): %.o: %.cc FORCE 149 + $(host-cxxobjs): $(obj)/%.o: $(src)/%.cc FORCE 150 150 $(call if_changed_dep,host-cxxobjs) 151 151 152 152 # Compile .c file, create position independent .o file 153 153 # host-cshobjs -> .o 154 154 quiet_cmd_host-cshobjs = HOSTCC -fPIC $@ 155 155 cmd_host-cshobjs = $(HOSTCC) $(hostc_flags) -fPIC -c -o $@ $< 156 - $(host-cshobjs): %.o: %.c FORCE 156 + $(host-cshobjs): $(obj)/%.o: $(src)/%.c FORCE 157 157 $(call if_changed_dep,host-cshobjs) 158 158 159 159 # Link a shared library, based on position independent .o files ··· 162 162 cmd_host-cshlib = $(HOSTCC) $(HOSTLDFLAGS) -shared -o $@ \ 163 163 $(addprefix $(obj)/,$($(@F:.so=-objs))) \ 164 164 $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) 165 - $(host-cshlib): %: $(host-cshobjs) FORCE 165 + $(host-cshlib): $(obj)/%: $(host-cshobjs) FORCE 166 166 $(call if_changed,host-cshlib) 167 167 168 168 targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\
+4 -4
scripts/Makefile.modpost
··· 63 63 $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ 64 64 $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ 65 65 $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ 66 - $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) \ 67 - $(wildcard vmlinux) $(filter-out FORCE,$^) 66 + $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) 68 67 69 68 PHONY += __modpost 70 69 __modpost: $(modules:.ko=.o) FORCE 71 - $(call cmd,modpost) 70 + $(call cmd,modpost) $(wildcard vmlinux) $(filter-out FORCE,$^) 72 71 73 72 quiet_cmd_kernel-mod = MODPOST $@ 74 - cmd_kernel-mod = $(cmd_modpost) 73 + cmd_kernel-mod = $(cmd_modpost) $(KBUILD_VMLINUX_OBJS) 75 74 75 + PHONY += vmlinux 76 76 vmlinux: FORCE 77 77 $(call cmd,kernel-mod) 78 78
+2
scripts/basic/fixdep.c
··· 249 249 found: 250 250 if (!memcmp(q - 7, "_MODULE", 7)) 251 251 q -= 7; 252 + if( (q-p-7) < 0 ) 253 + continue; 252 254 use_config(p+7, q-p-7); 253 255 } 254 256 }
+118
scripts/checksyscalls.sh
··· 1 + #!/bin/sh 2 + # 3 + # Check if current architecture are missing any function calls compared 4 + # to i386. 5 + # i386 define a number of legacy system calls that are i386 specific 6 + # and listed below so they are ignored. 7 + # 8 + # Usage: 9 + # syscallchk gcc gcc-options 10 + # 11 + 12 + ignore_list() { 13 + cat << EOF 14 + #include <asm/types.h> 15 + #include <asm/unistd.h> 16 + 17 + /* System calls for 32-bit kernels only */ 18 + #if BITS_PER_LONG == 64 19 + #define __IGNORE_sendfile64 20 + #define __IGNORE_ftruncate64 21 + #define __IGNORE_truncate64 22 + #define __IGNORE_stat64 23 + #define __IGNORE_lstat64 24 + #define __IGNORE_fstat64 25 + #define __IGNORE_fcntl64 26 + #define __IGNORE_fadvise64_64 27 + #define __IGNORE_fstatat64 28 + #define __IGNORE_fstatfs64 29 + #define __IGNORE_statfs64 30 + #endif 31 + 32 + /* i386-specific or historical system calls */ 33 + #define __IGNORE_break 34 + #define __IGNORE_stty 35 + #define __IGNORE_gtty 36 + #define __IGNORE_ftime 37 + #define __IGNORE_prof 38 + #define __IGNORE_lock 39 + #define __IGNORE_mpx 40 + #define __IGNORE_ulimit 41 + #define __IGNORE_profil 42 + #define __IGNORE_ioperm 43 + #define __IGNORE_iopl 44 + #define __IGNORE_idle 45 + #define __IGNORE_modify_ldt 46 + #define __IGNORE_ugetrlimit 47 + #define __IGNORE_mmap2 48 + #define __IGNORE_vm86 49 + #define __IGNORE_vm86old 50 + #define __IGNORE_set_thread_area 51 + #define __IGNORE_get_thread_area 52 + #define __IGNORE_madvise1 53 + #define __IGNORE_oldstat 54 + #define __IGNORE_oldfstat 55 + #define __IGNORE_oldlstat 56 + #define __IGNORE_oldolduname 57 + #define __IGNORE_olduname 58 + #define __IGNORE_umount2 59 + #define __IGNORE_umount 60 + #define __IGNORE_waitpid 61 + #define __IGNORE_stime 62 + #define __IGNORE_nice 63 + #define __IGNORE_signal 64 + #define __IGNORE_sigaction 65 + #define __IGNORE_sgetmask 66 + #define __IGNORE_sigsuspend 67 + #define __IGNORE_sigpending 68 + #define __IGNORE_ssetmask 69 + #define __IGNORE_readdir 70 + #define __IGNORE_socketcall 71 + #define __IGNORE_ipc 72 + #define __IGNORE_sigreturn 73 + #define __IGNORE_sigprocmask 74 + #define __IGNORE_bdflush 75 + #define __IGNORE__llseek 76 + #define __IGNORE__newselect 77 + #define __IGNORE_create_module 78 + #define __IGNORE_delete_module 79 + #define __IGNORE_query_module 80 + #define __IGNORE_get_kernel_syms 81 + /* ... including the "new" 32-bit uid syscalls */ 82 + #define __IGNORE_lchown32 83 + #define __IGNORE_getuid32 84 + #define __IGNORE_getgid32 85 + #define __IGNORE_geteuid32 86 + #define __IGNORE_getegid32 87 + #define __IGNORE_setreuid32 88 + #define __IGNORE_setregid32 89 + #define __IGNORE_getgroups32 90 + #define __IGNORE_setgroups32 91 + #define __IGNORE_fchown32 92 + #define __IGNORE_setresuid32 93 + #define __IGNORE_getresuid32 94 + #define __IGNORE_setresgid32 95 + #define __IGNORE_getresgid32 96 + #define __IGNORE_chown32 97 + #define __IGNORE_setuid32 98 + #define __IGNORE_setgid32 99 + #define __IGNORE_setfsuid32 100 + #define __IGNORE_setfsgid32 101 + 102 + /* Unmerged syscalls for AFS, STREAMS, etc. */ 103 + #define __IGNORE_afs_syscall 104 + #define __IGNORE_getpmsg 105 + #define __IGNORE_putpmsg 106 + #define __IGNORE_vserver 107 + EOF 108 + } 109 + 110 + syscall_list() { 111 + sed -n -e '/^\#define/ { s/[^_]*__NR_\([^[:space:]]*\).*/\ 112 + \#if !defined \(__NR_\1\) \&\& !defined \(__IGNORE_\1\)\ 113 + \#warning syscall \1 not implemented\ 114 + \#endif/p }' $1 115 + } 116 + 117 + (ignore_list && syscall_list ${srctree}/include/asm-i386/unistd.h) | \ 118 + $* -E -x c - > /dev/null
+126
scripts/cleanfile
··· 1 + #!/usr/bin/perl -w 2 + # 3 + # Clean a text file -- or directory of text files -- of stealth whitespace. 4 + # WARNING: this can be a highly destructive operation. Use with caution. 5 + # 6 + 7 + use bytes; 8 + use File::Basename; 9 + 10 + # 11 + # Clean up space-tab sequences, either by removing spaces or 12 + # replacing them with tabs. 13 + sub clean_space_tabs($) 14 + { 15 + no bytes; # Tab alignment depends on characters 16 + 17 + my($li) = @_; 18 + my($lo) = ''; 19 + my $pos = 0; 20 + my $nsp = 0; 21 + my($i, $c); 22 + 23 + for ($i = 0; $i < length($li); $i++) { 24 + $c = substr($li, $i, 1); 25 + if ($c eq "\t") { 26 + my $npos = ($pos+$nsp+8) & ~7; 27 + my $ntab = ($npos >> 3) - ($pos >> 3); 28 + $lo .= "\t" x $ntab; 29 + $pos = $npos; 30 + $nsp = 0; 31 + } elsif ($c eq "\n" || $c eq "\r") { 32 + $lo .= " " x $nsp; 33 + $pos += $nsp; 34 + $nsp = 0; 35 + $lo .= $c; 36 + $pos = 0; 37 + } elsif ($c eq " ") { 38 + $nsp++; 39 + } else { 40 + $lo .= " " x $nsp; 41 + $pos += $nsp; 42 + $nsp = 0; 43 + $lo .= $c; 44 + $pos++; 45 + } 46 + } 47 + $lo .= " " x $nsp; 48 + return $lo; 49 + } 50 + 51 + $name = basename($0); 52 + 53 + foreach $f ( @ARGV ) { 54 + print STDERR "$name: $f\n"; 55 + 56 + if (! -f $f) { 57 + print STDERR "$f: not a file\n"; 58 + next; 59 + } 60 + 61 + if (!open(FILE, '+<', $f)) { 62 + print STDERR "$name: Cannot open file: $f: $!\n"; 63 + next; 64 + } 65 + 66 + binmode FILE; 67 + 68 + # First, verify that it is not a binary file; consider any file 69 + # with a zero byte to be a binary file. Is there any better, or 70 + # additional, heuristic that should be applied? 71 + $is_binary = 0; 72 + 73 + while (read(FILE, $data, 65536) > 0) { 74 + if ($data =~ /\0/) { 75 + $is_binary = 1; 76 + last; 77 + } 78 + } 79 + 80 + if ($is_binary) { 81 + print STDERR "$name: $f: binary file\n"; 82 + next; 83 + } 84 + 85 + seek(FILE, 0, 0); 86 + 87 + $in_bytes = 0; 88 + $out_bytes = 0; 89 + $blank_bytes = 0; 90 + 91 + @blanks = (); 92 + @lines = (); 93 + 94 + while ( defined($line = <FILE>) ) { 95 + $in_bytes += length($line); 96 + $line =~ s/[ \t\r]*$//; # Remove trailing spaces 97 + $line = clean_space_tabs($line); 98 + 99 + if ( $line eq "\n" ) { 100 + push(@blanks, $line); 101 + $blank_bytes += length($line); 102 + } else { 103 + push(@lines, @blanks); 104 + $out_bytes += $blank_bytes; 105 + push(@lines, $line); 106 + $out_bytes += length($line); 107 + @blanks = (); 108 + $blank_bytes = 0; 109 + } 110 + } 111 + 112 + # Any blanks at the end of the file are discarded 113 + 114 + if ($in_bytes != $out_bytes) { 115 + # Only write to the file if changed 116 + seek(FILE, 0, 0); 117 + print FILE @lines; 118 + 119 + if ( !defined($where = tell(FILE)) || 120 + !truncate(FILE, $where) ) { 121 + die "$name: Failed to truncate modified file: $f: $!\n"; 122 + } 123 + } 124 + 125 + close(FILE); 126 + }
+206
scripts/cleanpatch
··· 1 + #!/usr/bin/perl -w 2 + # 3 + # Clean a patch file -- or directory of patch files -- of stealth whitespace. 4 + # WARNING: this can be a highly destructive operation. Use with caution. 5 + # 6 + 7 + use bytes; 8 + use File::Basename; 9 + 10 + # 11 + # Clean up space-tab sequences, either by removing spaces or 12 + # replacing them with tabs. 13 + sub clean_space_tabs($) 14 + { 15 + no bytes; # Tab alignment depends on characters 16 + 17 + my($li) = @_; 18 + my($lo) = ''; 19 + my $pos = 0; 20 + my $nsp = 0; 21 + my($i, $c); 22 + 23 + for ($i = 0; $i < length($li); $i++) { 24 + $c = substr($li, $i, 1); 25 + if ($c eq "\t") { 26 + my $npos = ($pos+$nsp+8) & ~7; 27 + my $ntab = ($npos >> 3) - ($pos >> 3); 28 + $lo .= "\t" x $ntab; 29 + $pos = $npos; 30 + $nsp = 0; 31 + } elsif ($c eq "\n" || $c eq "\r") { 32 + $lo .= " " x $nsp; 33 + $pos += $nsp; 34 + $nsp = 0; 35 + $lo .= $c; 36 + $pos = 0; 37 + } elsif ($c eq " ") { 38 + $nsp++; 39 + } else { 40 + $lo .= " " x $nsp; 41 + $pos += $nsp; 42 + $nsp = 0; 43 + $lo .= $c; 44 + $pos++; 45 + } 46 + } 47 + $lo .= " " x $nsp; 48 + return $lo; 49 + } 50 + 51 + $name = basename($0); 52 + 53 + foreach $f ( @ARGV ) { 54 + print STDERR "$name: $f\n"; 55 + 56 + if (! -f $f) { 57 + print STDERR "$f: not a file\n"; 58 + next; 59 + } 60 + 61 + if (!open(FILE, '+<', $f)) { 62 + print STDERR "$name: Cannot open file: $f: $!\n"; 63 + next; 64 + } 65 + 66 + binmode FILE; 67 + 68 + # First, verify that it is not a binary file; consider any file 69 + # with a zero byte to be a binary file. Is there any better, or 70 + # additional, heuristic that should be applied? 71 + $is_binary = 0; 72 + 73 + while (read(FILE, $data, 65536) > 0) { 74 + if ($data =~ /\0/) { 75 + $is_binary = 1; 76 + last; 77 + } 78 + } 79 + 80 + if ($is_binary) { 81 + print STDERR "$name: $f: binary file\n"; 82 + next; 83 + } 84 + 85 + seek(FILE, 0, 0); 86 + 87 + $in_bytes = 0; 88 + $out_bytes = 0; 89 + 90 + @lines = (); 91 + 92 + $in_hunk = 0; 93 + $err = 0; 94 + 95 + while ( defined($line = <FILE>) ) { 96 + $in_bytes += length($line); 97 + 98 + if (!$in_hunk) { 99 + if ($line =~ /^\@\@\s+\-([0-9]+),([0-9]+)\s+\+([0-9]+),([0-9]+)\s\@\@/) { 100 + $minus_lines = $2; 101 + $plus_lines = $4; 102 + if ($minus_lines || $plus_lines) { 103 + $in_hunk = 1; 104 + @hunk_lines = ($line); 105 + } 106 + } else { 107 + push(@lines, $line); 108 + $out_bytes += length($line); 109 + } 110 + } else { 111 + # We're in a hunk 112 + 113 + if ($line =~ /^\+/) { 114 + $plus_lines--; 115 + 116 + $text = substr($line, 1); 117 + $text =~ s/[ \t\r]*$//; # Remove trailing spaces 118 + $text = clean_space_tabs($text); 119 + 120 + push(@hunk_lines, '+'.$text); 121 + } elsif ($line =~ /^\-/) { 122 + $minus_lines--; 123 + push(@hunk_lines, $line); 124 + } elsif ($line =~ /^ /) { 125 + $plus_lines--; 126 + $minus_lines--; 127 + push(@hunk_lines, $line); 128 + } else { 129 + print STDERR "$name: $f: malformed patch\n"; 130 + $err = 1; 131 + last; 132 + } 133 + 134 + if ($plus_lines < 0 || $minus_lines < 0) { 135 + print STDERR "$name: $f: malformed patch\n"; 136 + $err = 1; 137 + last; 138 + } elsif ($plus_lines == 0 && $minus_lines == 0) { 139 + # End of a hunk. Process this hunk. 140 + my $i; 141 + my $l; 142 + my @h = (); 143 + my $adj = 0; 144 + my $done = 0; 145 + 146 + for ($i = scalar(@hunk_lines)-1; $i > 0; $i--) { 147 + $l = $hunk_lines[$i]; 148 + if (!$done && $l eq "+\n") { 149 + $adj++; # Skip this line 150 + } elsif ($l =~ /^[ +]/) { 151 + $done = 1; 152 + unshift(@h, $l); 153 + } else { 154 + unshift(@h, $l); 155 + } 156 + } 157 + 158 + $l = $hunk_lines[0]; # Hunk header 159 + undef @hunk_lines; # Free memory 160 + 161 + if ($adj) { 162 + die unless 163 + ($l =~ /^\@\@\s+\-([0-9]+),([0-9]+)\s+\+([0-9]+),([0-9]+)\s\@\@(.*)$/); 164 + my $mstart = $1; 165 + my $mlin = $2; 166 + my $pstart = $3; 167 + my $plin = $4; 168 + my $tail = $5; # doesn't include the final newline 169 + 170 + $l = sprintf("@@ -%d,%d +%d,%d @@%s\n", 171 + $mstart, $mlin, $pstart, $plin-$adj, 172 + $tail); 173 + } 174 + unshift(@h, $l); 175 + 176 + # Transfer to the output array 177 + foreach $l (@h) { 178 + $out_bytes += length($l); 179 + push(@lines, $l); 180 + } 181 + 182 + $in_hunk = 0; 183 + } 184 + } 185 + } 186 + 187 + if ($in_hunk) { 188 + print STDERR "$name: $f: malformed patch\n"; 189 + $err = 1; 190 + } 191 + 192 + if (!$err) { 193 + if ($in_bytes != $out_bytes) { 194 + # Only write to the file if changed 195 + seek(FILE, 0, 0); 196 + print FILE @lines; 197 + 198 + if ( !defined($where = tell(FILE)) || 199 + !truncate(FILE, $where) ) { 200 + die "$name: Failed to truncate modified file: $f: $!\n"; 201 + } 202 + } 203 + } 204 + 205 + close(FILE); 206 + }
+9 -3
scripts/gen_initramfs_list.sh
··· 171 171 ${dep_list}header "$1" 172 172 173 173 srcdir=$(echo "$1" | sed -e 's://*:/:g') 174 - dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n" 2>/dev/null) 174 + dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n") 175 175 176 176 # If $dirlist is only one line, then the directory is empty 177 177 if [ "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then ··· 191 191 source="$1" 192 192 if [ -f "$1" ]; then 193 193 ${dep_list}header "$1" 194 - is_cpio="$(echo "$1" | sed 's/^.*\.cpio/cpio/')" 194 + is_cpio="$(echo "$1" | sed 's/^.*\.cpio\(\..*\)\?/cpio/')" 195 195 if [ $2 -eq 0 -a ${is_cpio} == "cpio" ]; then 196 196 cpio_file=$1 197 + echo "$1" | grep -q '^.*\.cpio\..*' && is_cpio_compressed="compressed" 197 198 [ ! -z ${dep_list} ] && echo "$1" 198 199 return 0 199 200 fi ··· 224 223 cpio_list= 225 224 output="/dev/stdout" 226 225 output_file="" 226 + is_cpio_compressed= 227 227 228 228 arg="$1" 229 229 case "$arg" in ··· 284 282 cpio_tfile=${cpio_file} 285 283 fi 286 284 rm ${cpio_list} 287 - cat ${cpio_tfile} | gzip -f -9 - > ${output_file} 285 + if [ "${is_cpio_compressed}" = "compressed" ]; then 286 + cat ${cpio_tfile} > ${output_file} 287 + else 288 + cat ${cpio_tfile} | gzip -f -9 - > ${output_file} 289 + fi 288 290 [ -z ${cpio_file} ] && rm ${cpio_tfile} 289 291 fi 290 292 exit 0
+3 -2
scripts/kconfig/Makefile
··· 140 140 141 141 clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \ 142 142 .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c 143 + clean-files += mconf qconf gconf 143 144 144 145 # Needed for systems without gettext 145 146 KBUILD_HAVE_NLS := $(shell \ ··· 184 183 done; \ 185 184 if [ -z "$$dir" ]; then \ 186 185 echo "*"; \ 187 - echo "* Unable to find the QT installation. Please make sure that"; \ 188 - echo "* the QT development package is correctly installed and"; \ 186 + echo "* Unable to find the QT3 installation. Please make sure that"; \ 187 + echo "* the QT3 development package is correctly installed and"; \ 189 188 echo "* either install pkg-config or set the QTDIR environment"; \ 190 189 echo "* variable to the correct location."; \ 191 190 echo "*"; \
+1
scripts/kconfig/conf.c
··· 558 558 if (stat(".config", &tmpstat)) { 559 559 printf(_("***\n" 560 560 "*** You have not yet configured your kernel!\n" 561 + "*** (missing kernel .config file)\n" 561 562 "***\n" 562 563 "*** Please run some configurator (e.g. \"make oldconfig\" or\n" 563 564 "*** \"make menuconfig\" or \"make xconfig\").\n"
+1 -1
scripts/kconfig/lex.zconf.c_shipped
··· 2264 2264 FILE *f; 2265 2265 2266 2266 f = fopen(name, "r"); 2267 - if (!f && name[0] != '/') { 2267 + if (!f && name != NULL && name[0] != '/') { 2268 2268 env = getenv(SRCTREE); 2269 2269 if (env) { 2270 2270 sprintf(fullname, "%s/%s", env, name);
+1
scripts/kconfig/lkc.h
··· 64 64 char *zconf_curname(void); 65 65 66 66 /* confdata.c */ 67 + const char *conf_get_configname(void); 67 68 char *conf_get_default_confname(void); 68 69 void sym_set_change_count(int count); 69 70 void sym_add_change_count(int count);
+1
scripts/kconfig/lxdialog/dialog.h
··· 188 188 int on_key_resize(void); 189 189 190 190 void init_dialog(const char *backtitle); 191 + void set_dialog_backtitle(const char *backtitle); 191 192 void reset_dialog(void); 192 193 void end_dialog(void); 193 194 void attr_clear(WINDOW * win, int height, int width, chtype attr);
+7 -2
scripts/kconfig/lxdialog/util.c
··· 272 272 color_setup(getenv("MENUCONFIG_COLOR")); 273 273 } 274 274 275 + void set_dialog_backtitle(const char *backtitle) 276 + { 277 + dlg.backtitle = backtitle; 278 + } 279 + 275 280 void reset_dialog(void) 276 281 { 277 282 initscr(); /* Init curses */ ··· 341 336 newl = 1; 342 337 word = tempstr; 343 338 while (word && *word) { 344 - sp = index(word, ' '); 339 + sp = strchr(word, ' '); 345 340 if (sp) 346 341 *sp++ = 0; 347 342 ··· 353 348 if (wlen > room || 354 349 (newl && wlen < 4 && sp 355 350 && wlen + 1 + strlen(sp) > room 356 - && (!(sp2 = index(sp, ' ')) 351 + && (!(sp2 = strchr(sp, ' ')) 357 352 || wlen + 1 + (sp2 - sp) > room))) { 358 353 cur_y++; 359 354 cur_x = x;
+31 -12
scripts/kconfig/mconf.c
··· 26 26 #include "lkc.h" 27 27 #include "lxdialog/dialog.h" 28 28 29 - static char menu_backtitle[128]; 30 29 static const char mconf_readme[] = N_( 31 30 "Overview\n" 32 31 "--------\n" ··· 270 271 " USB$ => find all CONFIG_ symbols ending with USB\n" 271 272 "\n"); 272 273 273 - static char filename[PATH_MAX+1] = ".config"; 274 274 static int indent; 275 275 static struct termios ios_org; 276 276 static int rows = 0, cols = 0; ··· 392 394 str_append(&res, "No matches found.\n"); 393 395 return res; 394 396 } 397 + 398 + static char filename[PATH_MAX+1]; 399 + static void set_config_filename(const char *config_filename) 400 + { 401 + static char menu_backtitle[PATH_MAX+128]; 402 + int size; 403 + struct symbol *sym; 404 + 405 + sym = sym_lookup("KERNELVERSION", 0); 406 + sym_calc_value(sym); 407 + size = snprintf(menu_backtitle, sizeof(menu_backtitle), 408 + _("%s - Linux Kernel v%s Configuration"), 409 + config_filename, sym_get_string_value(sym)); 410 + if (size >= sizeof(menu_backtitle)) 411 + menu_backtitle[sizeof(menu_backtitle)-1] = '\0'; 412 + set_dialog_backtitle(menu_backtitle); 413 + 414 + size = snprintf(filename, sizeof(filename), "%s", config_filename); 415 + if (size >= sizeof(filename)) 416 + filename[sizeof(filename)-1] = '\0'; 417 + } 418 + 395 419 396 420 static void search_conf(void) 397 421 { ··· 836 816 case 0: 837 817 if (!dialog_input_result[0]) 838 818 return; 839 - if (!conf_read(dialog_input_result)) 819 + if (!conf_read(dialog_input_result)) { 820 + set_config_filename(dialog_input_result); 840 821 return; 822 + } 841 823 show_textbox(NULL, _("File does not exist!"), 5, 38); 842 824 break; 843 825 case 1: ··· 862 840 case 0: 863 841 if (!dialog_input_result[0]) 864 842 return; 865 - if (!conf_write(dialog_input_result)) 843 + if (!conf_write(dialog_input_result)) { 844 + set_config_filename(dialog_input_result); 866 845 return; 846 + } 867 847 show_textbox(NULL, _("Can't create file! Probably a nonexistent directory."), 5, 60); 868 848 break; 869 849 case 1: ··· 884 860 885 861 int main(int ac, char **av) 886 862 { 887 - struct symbol *sym; 888 863 char *mode; 889 864 int res; 890 865 ··· 893 870 894 871 conf_parse(av[1]); 895 872 conf_read(NULL); 896 - 897 - sym = sym_lookup("KERNELVERSION", 0); 898 - sym_calc_value(sym); 899 - sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"), 900 - sym_get_string_value(sym)); 901 873 902 874 mode = getenv("MENUCONFIG_MODE"); 903 875 if (mode) { ··· 904 886 atexit(conf_cleanup); 905 887 init_wsize(); 906 888 reset_dialog(); 907 - init_dialog(menu_backtitle); 889 + init_dialog(NULL); 890 + set_config_filename(conf_get_configname()); 908 891 do { 909 892 conf(&rootmenu); 910 893 dialog_clear(); ··· 922 903 923 904 switch (res) { 924 905 case 0: 925 - if (conf_write(NULL)) { 906 + if (conf_write(filename)) { 926 907 fprintf(stderr, _("\n\n" 927 908 "Error during writing of the kernel configuration.\n" 928 909 "Your kernel configuration changes were NOT saved."
+1 -1
scripts/kconfig/menu.c
··· 203 203 else if (sym2->type == S_UNKNOWN) 204 204 prop_warn(prop, 205 205 "'select' used by config symbol '%s' " 206 - "refer to undefined symbol '%s'", 206 + "refers to undefined symbol '%s'", 207 207 sym->name, sym2->name); 208 208 else if (sym2->type != S_BOOLEAN && sym2->type != S_TRISTATE) 209 209 prop_warn(prop,
+4 -1
scripts/kconfig/qconf.cc
··· 1182 1182 Parent::contentsContextMenuEvent(e); 1183 1183 } 1184 1184 1185 - ConfigSearchWindow::ConfigSearchWindow(QWidget* parent, const char *name) 1185 + ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *name) 1186 1186 : Parent(parent, name), result(NULL) 1187 1187 { 1188 1188 setCaption("Search Config"); ··· 1206 1206 info = new ConfigInfoView(split, name); 1207 1207 connect(list->list, SIGNAL(menuChanged(struct menu *)), 1208 1208 info, SLOT(setInfo(struct menu *))); 1209 + connect(list->list, SIGNAL(menuChanged(struct menu *)), 1210 + parent, SLOT(setMenuLink(struct menu *))); 1211 + 1209 1212 layout1->addWidget(split); 1210 1213 1211 1214 if (name) {
+1 -1
scripts/kconfig/qconf.h
··· 279 279 Q_OBJECT 280 280 typedef class QDialog Parent; 281 281 public: 282 - ConfigSearchWindow(QWidget* parent, const char *name = 0); 282 + ConfigSearchWindow(ConfigMainWindow* parent, const char *name = 0); 283 283 284 284 public slots: 285 285 void saveSettings(void);
+5 -8
scripts/kconfig/symbol.c
··· 786 786 return NULL; 787 787 } 788 788 789 + /* return NULL when dependencies are OK */ 789 790 struct symbol *sym_check_deps(struct symbol *sym) 790 791 { 791 792 struct symbol *sym2; 792 793 struct property *prop; 793 794 794 795 if (sym->flags & SYMBOL_CHECK) { 795 - printf("Warning! Found recursive dependency: %s", sym->name); 796 + fprintf(stderr, "%s:%d:error: found recursive dependency: %s", 797 + sym->prop->file->name, sym->prop->lineno, sym->name); 796 798 return sym; 797 799 } 798 800 if (sym->flags & SYMBOL_CHECKED) ··· 818 816 goto out; 819 817 } 820 818 out: 821 - if (sym2) { 822 - printf(" %s", sym->name); 823 - if (sym2 == sym) { 824 - printf("\n"); 825 - sym2 = NULL; 826 - } 827 - } 819 + if (sym2) 820 + fprintf(stderr, " -> %s%s", sym->name, sym2 == sym? "\n": ""); 828 821 sym->flags &= ~SYMBOL_CHECK; 829 822 return sym2; 830 823 }
+1 -1
scripts/kconfig/zconf.l
··· 265 265 FILE *f; 266 266 267 267 f = fopen(name, "r"); 268 - if (!f && name[0] != '/') { 268 + if (!f && name != NULL && name[0] != '/') { 269 269 env = getenv(SRCTREE); 270 270 if (env) { 271 271 sprintf(fullname, "%s/%s", env, name);
+4 -2
scripts/kconfig/zconf.tab.c_shipped
··· 2132 2132 } 2133 2133 menu_finalize(&rootmenu); 2134 2134 for_all_symbols(i, sym) { 2135 - sym_check_deps(sym); 2135 + if (sym_check_deps(sym)) 2136 + zconfnerrs++; 2136 2137 } 2137 - 2138 + if (zconfnerrs) 2139 + exit(1); 2138 2140 sym_set_change_count(1); 2139 2141 } 2140 2142
+4 -2
scripts/kconfig/zconf.y
··· 501 501 } 502 502 menu_finalize(&rootmenu); 503 503 for_all_symbols(i, sym) { 504 - sym_check_deps(sym); 504 + if (sym_check_deps(sym)) 505 + zconfnerrs++; 505 506 } 506 - 507 + if (zconfnerrs) 508 + exit(1); 507 509 sym_set_change_count(1); 508 510 } 509 511
+20 -7
scripts/mkcompile_h
··· 18 18 # Do not expand names 19 19 set -f 20 20 21 - if [ -r .version ]; then 22 - VERSION=`cat .version` 21 + # Fix the language to get consistent output 22 + LC_ALL=C 23 + export LC_ALL 24 + 25 + if [ -z "$KBUILD_BUILD_VERSION" ]; then 26 + if [ -r .version ]; then 27 + VERSION=`cat .version` 28 + else 29 + VERSION=0 30 + echo 0 > .version 31 + fi 23 32 else 24 - VERSION=0 25 - echo 0 > .version 33 + VERSION=$KBUILD_BUILD_VERSION 26 34 fi 27 35 36 + if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then 37 + TIMESTAMP=`date` 38 + else 39 + TIMESTAMP=$KBUILD_BUILD_TIMESTAMP 40 + fi 28 41 29 42 UTS_VERSION="#$VERSION" 30 43 CONFIG_FLAGS="" 31 44 if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi 32 45 if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi 33 - UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS `LC_ALL=C LANG=C date`" 46 + UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP" 34 47 35 48 # Truncate to maximum length 36 49 ··· 59 46 60 47 echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\" 61 48 62 - echo \#define LINUX_COMPILE_TIME \"`LC_ALL=C LANG=C date +%T`\" 49 + echo \#define LINUX_COMPILE_TIME \"`date +%T`\" 63 50 echo \#define LINUX_COMPILE_BY \"`whoami`\" 64 51 echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\" 65 52 ··· 71 58 echo \#define LINUX_COMPILE_DOMAIN 72 59 fi 73 60 74 - echo \#define LINUX_COMPILER \"`LC_ALL=C LANG=C $CC -v 2>&1 | tail -n 1`\" 61 + echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\" 75 62 ) > .tmpcompile 76 63 77 64 # Only replace the real compile.h if the new one is different,
+1 -1
scripts/mkuboot.sh
··· 4 4 # Build U-Boot image when `mkimage' tool is available. 5 5 # 6 6 7 - MKIMAGE=$(type -path ${CROSS_COMPILE}mkimage) 7 + MKIMAGE=$(type -path "${CROSS_COMPILE}mkimage") 8 8 9 9 if [ -z "${MKIMAGE}" ]; then 10 10 MKIMAGE=$(type -path mkimage)
+11 -10
scripts/mod/file2alias.c
··· 37 37 * even potentially has different endianness and word sizes, since 38 38 * we handle those differences explicitly below */ 39 39 #include "../../include/linux/mod_devicetable.h" 40 - #include "../../include/linux/input.h" 41 40 42 41 #define ADD(str, sep, cond, field) \ 43 42 do { \ ··· 415 416 416 417 sprintf(alias + strlen(alias), "-e*"); 417 418 if (id->flags & INPUT_DEVICE_ID_MATCH_EVBIT) 418 - do_input(alias, id->evbit, 0, EV_MAX); 419 + do_input(alias, id->evbit, 0, INPUT_DEVICE_ID_EV_MAX); 419 420 sprintf(alias + strlen(alias), "k*"); 420 421 if (id->flags & INPUT_DEVICE_ID_MATCH_KEYBIT) 421 - do_input(alias, id->keybit, KEY_MIN_INTERESTING, KEY_MAX); 422 + do_input(alias, id->keybit, 423 + INPUT_DEVICE_ID_KEY_MIN_INTERESTING, 424 + INPUT_DEVICE_ID_KEY_MAX); 422 425 sprintf(alias + strlen(alias), "r*"); 423 426 if (id->flags & INPUT_DEVICE_ID_MATCH_RELBIT) 424 - do_input(alias, id->relbit, 0, REL_MAX); 427 + do_input(alias, id->relbit, 0, INPUT_DEVICE_ID_REL_MAX); 425 428 sprintf(alias + strlen(alias), "a*"); 426 429 if (id->flags & INPUT_DEVICE_ID_MATCH_ABSBIT) 427 - do_input(alias, id->absbit, 0, ABS_MAX); 430 + do_input(alias, id->absbit, 0, INPUT_DEVICE_ID_ABS_MAX); 428 431 sprintf(alias + strlen(alias), "m*"); 429 432 if (id->flags & INPUT_DEVICE_ID_MATCH_MSCIT) 430 - do_input(alias, id->mscbit, 0, MSC_MAX); 433 + do_input(alias, id->mscbit, 0, INPUT_DEVICE_ID_MSC_MAX); 431 434 sprintf(alias + strlen(alias), "l*"); 432 435 if (id->flags & INPUT_DEVICE_ID_MATCH_LEDBIT) 433 - do_input(alias, id->ledbit, 0, LED_MAX); 436 + do_input(alias, id->ledbit, 0, INPUT_DEVICE_ID_LED_MAX); 434 437 sprintf(alias + strlen(alias), "s*"); 435 438 if (id->flags & INPUT_DEVICE_ID_MATCH_SNDBIT) 436 - do_input(alias, id->sndbit, 0, SND_MAX); 439 + do_input(alias, id->sndbit, 0, INPUT_DEVICE_ID_SND_MAX); 437 440 sprintf(alias + strlen(alias), "f*"); 438 441 if (id->flags & INPUT_DEVICE_ID_MATCH_FFBIT) 439 - do_input(alias, id->ffbit, 0, FF_MAX); 442 + do_input(alias, id->ffbit, 0, INPUT_DEVICE_ID_FF_MAX); 440 443 sprintf(alias + strlen(alias), "w*"); 441 444 if (id->flags & INPUT_DEVICE_ID_MATCH_SWBIT) 442 - do_input(alias, id->swbit, 0, SW_MAX); 445 + do_input(alias, id->swbit, 0, INPUT_DEVICE_ID_SW_MAX); 443 446 return 1; 444 447 } 445 448
+108 -33
scripts/mod/modpost.c
··· 55 55 va_end(arglist); 56 56 } 57 57 58 + void merror(const char *fmt, ...) 59 + { 60 + va_list arglist; 61 + 62 + fprintf(stderr, "ERROR: "); 63 + 64 + va_start(arglist, fmt); 65 + vfprintf(stderr, fmt, arglist); 66 + va_end(arglist); 67 + } 68 + 58 69 static int is_vmlinux(const char *modname) 59 70 { 60 71 const char *myname; ··· 344 333 munmap(file, size); 345 334 } 346 335 347 - static void parse_elf(struct elf_info *info, const char *filename) 336 + static int parse_elf(struct elf_info *info, const char *filename) 348 337 { 349 338 unsigned int i; 350 - Elf_Ehdr *hdr = info->hdr; 339 + Elf_Ehdr *hdr; 351 340 Elf_Shdr *sechdrs; 352 341 Elf_Sym *sym; 353 342 ··· 357 346 exit(1); 358 347 } 359 348 info->hdr = hdr; 360 - if (info->size < sizeof(*hdr)) 361 - goto truncated; 362 - 349 + if (info->size < sizeof(*hdr)) { 350 + /* file too small, assume this is an empty .o file */ 351 + return 0; 352 + } 353 + /* Is this a valid ELF file? */ 354 + if ((hdr->e_ident[EI_MAG0] != ELFMAG0) || 355 + (hdr->e_ident[EI_MAG1] != ELFMAG1) || 356 + (hdr->e_ident[EI_MAG2] != ELFMAG2) || 357 + (hdr->e_ident[EI_MAG3] != ELFMAG3)) { 358 + /* Not an ELF file - silently ignore it */ 359 + return 0; 360 + } 363 361 /* Fix endianness in ELF header */ 364 362 hdr->e_shoff = TO_NATIVE(hdr->e_shoff); 365 363 hdr->e_shstrndx = TO_NATIVE(hdr->e_shstrndx); ··· 391 371 = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; 392 372 const char *secname; 393 373 394 - if (sechdrs[i].sh_offset > info->size) 395 - goto truncated; 374 + if (sechdrs[i].sh_offset > info->size) { 375 + fatal("%s is truncated. sechdrs[i].sh_offset=%u > sizeof(*hrd)=%ul\n", filename, (unsigned int)sechdrs[i].sh_offset, sizeof(*hdr)); 376 + return 0; 377 + } 396 378 secname = secstrings + sechdrs[i].sh_name; 397 379 if (strcmp(secname, ".modinfo") == 0) { 398 380 info->modinfo = (void *)hdr + sechdrs[i].sh_offset; ··· 429 407 sym->st_value = TO_NATIVE(sym->st_value); 430 408 sym->st_size = TO_NATIVE(sym->st_size); 431 409 } 432 - return; 433 - 434 - truncated: 435 - fatal("%s is truncated.\n", filename); 410 + return 1; 436 411 } 437 412 438 413 static void parse_elf_finish(struct elf_info *info) ··· 600 581 * the pattern is identified by: 601 582 * tosec = .init.text | .exit.text | .init.data 602 583 * fromsec = .data 603 - * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one 584 + * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console 604 585 * 605 586 * Pattern 3: 587 + * Whitelist all references from .pci_fixup* section to .init.text 588 + * This is part of the PCI init when built-in 589 + * 590 + * Pattern 4: 591 + * Whitelist all refereces from .text.head to .init.data 592 + * Whitelist all refereces from .text.head to .init.text 593 + * 594 + * Pattern 5: 606 595 * Some symbols belong to init section but still it is ok to reference 607 596 * these from non-init sections as these symbols don't have any memory 608 597 * allocated for them and symbol address and value are same. So even ··· 618 591 * For ex. symbols marking the init section boundaries. 619 592 * This pattern is identified by 620 593 * refsymname = __init_begin, _sinittext, _einittext 594 + * 595 + * Pattern 6: 596 + * During the early init phase we have references from .init.text to 597 + * .text we have an intended section mismatch - do not warn about it. 598 + * See kernel_init() in init/main.c 599 + * tosec = .init.text 600 + * fromsec = .text 601 + * atsym = kernel_init 602 + * 603 + * Pattern 7: 604 + * Logos used in drivers/video/logo reside in __initdata but the 605 + * funtion that references them are EXPORT_SYMBOL() so cannot be 606 + * marker __init. So we whitelist them here. 607 + * The pattern is: 608 + * tosec = .init.data 609 + * fromsec = .text* 610 + * refsymname = logo_ 611 + * 612 + * Pattern 8: 613 + * Symbols contained in .paravirtprobe may safely reference .init.text. 614 + * The pattern is: 615 + * tosec = .init.text 616 + * fromsec = .paravirtprobe 617 + * 621 618 **/ 622 619 static int secref_whitelist(const char *modname, const char *tosec, 623 620 const char *fromsec, const char *atsym, ··· 693 642 if (f1 && f2) 694 643 return 1; 695 644 696 - /* Whitelist all references from .pci_fixup section if vmlinux 697 - * Whitelist all refereces from .text.head to .init.data if vmlinux 698 - * Whitelist all refereces from .text.head to .init.text if vmlinux 699 - */ 700 - if (is_vmlinux(modname)) { 701 - if ((strcmp(fromsec, ".pci_fixup") == 0) && 702 - (strcmp(tosec, ".init.text") == 0)) 645 + /* Check for pattern 3 */ 646 + if ((strncmp(fromsec, ".pci_fixup", strlen(".pci_fixup")) == 0) && 647 + (strcmp(tosec, ".init.text") == 0)) 648 + return 1; 649 + 650 + /* Check for pattern 4 */ 651 + if ((strcmp(fromsec, ".text.head") == 0) && 652 + ((strcmp(tosec, ".init.data") == 0) || 653 + (strcmp(tosec, ".init.text") == 0))) 654 + return 1; 655 + 656 + /* Check for pattern 5 */ 657 + for (s = pat3refsym; *s; s++) 658 + if (strcmp(refsymname, *s) == 0) 659 + return 1; 660 + 661 + /* Check for pattern 6 */ 662 + if ((strcmp(tosec, ".init.text") == 0) && 663 + (strcmp(fromsec, ".text") == 0) && 664 + (strcmp(refsymname, "kernel_init") == 0)) 703 665 return 1; 704 666 705 - if ((strcmp(fromsec, ".text.head") == 0) && 706 - ((strcmp(tosec, ".init.data") == 0) || 707 - (strcmp(tosec, ".init.text") == 0))) 667 + /* Check for pattern 7 */ 668 + if ((strcmp(tosec, ".init.data") == 0) && 669 + (strncmp(fromsec, ".text", strlen(".text")) == 0) && 670 + (strncmp(refsymname, "logo_", strlen("logo_")) == 0)) 708 671 return 1; 709 672 710 - /* Check for pattern 3 */ 711 - for (s = pat3refsym; *s; s++) 712 - if (strcmp(refsymname, *s) == 0) 713 - return 1; 714 - } 673 + /* Check for pattern 8 */ 674 + if ((strcmp(tosec, ".init.text") == 0) && 675 + (strcmp(fromsec, ".paravirtprobe") == 0)) 676 + return 1; 677 + 715 678 return 0; 716 679 } 717 680 ··· 1155 1090 struct elf_info info = { }; 1156 1091 Elf_Sym *sym; 1157 1092 1158 - parse_elf(&info, modname); 1093 + if (!parse_elf(&info, modname)) 1094 + return; 1159 1095 1160 1096 mod = new_module(modname); 1161 1097 ··· 1331 1265 exp = find_symbol(s->name); 1332 1266 if (!exp || exp->module == mod) { 1333 1267 if (have_vmlinux && !s->weak) { 1334 - warn("\"%s\" [%s.ko] undefined!\n", 1335 - s->name, mod->name); 1336 - err = warn_unresolved ? 0 : 1; 1268 + if (warn_unresolved) { 1269 + warn("\"%s\" [%s.ko] undefined!\n", 1270 + s->name, mod->name); 1271 + } else { 1272 + merror("\"%s\" [%s.ko] undefined!\n", 1273 + s->name, mod->name); 1274 + err = 1; 1275 + } 1337 1276 } 1338 1277 continue; 1339 1278 } ··· 1389 1318 buf_printf(b, "__attribute__((section(\".modinfo\"))) =\n"); 1390 1319 buf_printf(b, "\"depends="); 1391 1320 for (s = mod->unres; s; s = s->next) { 1321 + const char *p; 1392 1322 if (!s->module) 1393 1323 continue; 1394 1324 ··· 1397 1325 continue; 1398 1326 1399 1327 s->module->seen = 1; 1400 - buf_printf(b, "%s%s", first ? "" : ",", 1401 - strrchr(s->module->name, '/') + 1); 1328 + if ((p = strrchr(s->module->name, '/')) != NULL) 1329 + p++; 1330 + else 1331 + p = s->module->name; 1332 + buf_printf(b, "%s%s", first ? "" : ",", p); 1402 1333 first = 0; 1403 1334 } 1404 1335 buf_printf(b, "\";\n");
+1
scripts/mod/modpost.h
··· 145 145 146 146 void fatal(const char *fmt, ...); 147 147 void warn(const char *fmt, ...); 148 + void merror(const char *fmt, ...);
+2 -3
scripts/mod/sumversion.c
··· 397 397 (int) strlen(basename) - 2, basename); 398 398 399 399 file = grab_file(filelist, &len); 400 - if (!file) { 401 - warn("could not find versions for %s\n", filelist); 400 + if (!file) 401 + /* not a module or .mod file missing - ignore */ 402 402 return; 403 - } 404 403 405 404 sources = strchr(file, '\n'); 406 405 if (!sources) {
+1 -1
usr/Kconfig
··· 17 17 When multiple directories and files are specified then the 18 18 initramfs image will be the aggregate of all of them. 19 19 20 - See <file:Documentation/early-userspace/README for more details. 20 + See <file:Documentation/early-userspace/README> for more details. 21 21 22 22 If you are not sure, leave it blank. 23 23