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

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

+547 -291
+6
Documentation/kbuild/makefiles.txt
··· 872 872 Assignments to $(targets) are without $(obj)/ prefix. 873 873 if_changed may be used in conjunction with custom commands as 874 874 defined in 6.7 "Custom kbuild commands". 875 + 875 876 Note: It is a typical mistake to forget the FORCE prerequisite. 877 + Another common pitfall is that whitespace is sometimes 878 + significant; for instance, the below will fail (note the extra space 879 + after the comma): 880 + target: source(s) FORCE 881 + #WRONG!# $(call if_changed, ld/objcopy/gzip) 876 882 877 883 ld 878 884 Link target. Often LDFLAGS_$@ is used to set specific options to ld.
+64 -96
Makefile
··· 109 109 .PHONY: $(MAKECMDGOALS) 110 110 111 111 $(filter-out _all,$(MAKECMDGOALS)) _all: 112 - $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ 113 - KBUILD_SRC=$(CURDIR) KBUILD_VERBOSE=$(KBUILD_VERBOSE) \ 114 - KBUILD_CHECK=$(KBUILD_CHECK) KBUILD_EXTMOD="$(KBUILD_EXTMOD)" \ 115 - -f $(CURDIR)/Makefile $@ 112 + $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ 113 + KBUILD_SRC=$(CURDIR) \ 114 + KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $@ 116 115 117 116 # Leave processing to above invocation of make 118 117 skip-makefile := 1 ··· 232 233 KBUILD_MODULES := 1 233 234 endif 234 235 235 - export KBUILD_MODULES KBUILD_BUILTIN KBUILD_VERBOSE 236 + export KBUILD_MODULES KBUILD_BUILTIN 236 237 export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD 237 238 238 239 # Beautify output ··· 308 309 # Look for make include files relative to root of kernel src 309 310 MAKEFLAGS += --include-dir=$(srctree) 310 311 312 + # We need some generic definitions 313 + include $(srctree)/scripts/Kbuild.include 314 + 311 315 # For maximum performance (+ possibly random breakage, uncomment 312 316 # the following) 313 317 ··· 350 348 351 349 CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) 352 350 353 - CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \ 351 + CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ 354 352 -fno-strict-aliasing -fno-common \ 355 353 -ffreestanding 356 354 AFLAGS := -D__ASSEMBLY__ ··· 368 366 # tree rather than in the kernel tree. The kernel tree might 369 367 # even be read-only. 370 368 export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions 371 - 372 - # The temporary file to save gcc -MD generated dependencies must not 373 - # contain a comma 374 - comma := , 375 - depfile = $(subst $(comma),_,$(@D)/.$(@F).d) 376 369 377 370 # Files to ignore in find ... statements 378 371 ··· 548 551 # images. Default is /boot, but you can set it to other values 549 552 export INSTALL_PATH ?= /boot 550 553 554 + # If CONFIG_LOCALVERSION_AUTO is set, we automatically perform some tests 555 + # and try to determine if the current source tree is a release tree, of any sort, 556 + # or if is a pure development tree. 557 + # 558 + # A 'release tree' is any tree with a git TAG associated 559 + # with it. The primary goal of this is to make it safe for a native 560 + # git/CVS/SVN user to build a release tree (i.e, 2.6.9) and also to 561 + # continue developing against the current Linus tree, without having the Linus 562 + # tree overwrite the 2.6.9 tree when installed. 563 + # 564 + # Currently, only git is supported. 565 + # Other SCMs can edit scripts/setlocalversion and add the appropriate 566 + # checks as needed. 567 + 568 + 569 + ifdef CONFIG_LOCALVERSION_AUTO 570 + localversion-auto := $(shell $(PERL) $(srctree)/scripts/setlocalversion $(srctree)) 571 + LOCALVERSION := $(LOCALVERSION)$(localversion-auto) 572 + endif 573 + 551 574 # 552 575 # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory 553 576 # relocations required by build roots. This is not defined in the ··· 708 691 709 692 # Update vmlinux version before link 710 693 # Use + in front of this rule to silent warning about make -j1 694 + # First command is ':' to allow us to use + in front of this rule 711 695 cmd_ksym_ld = $(cmd_vmlinux__) 712 696 define rule_ksym_ld 697 + : 713 698 +$(call cmd,vmlinux_version) 714 699 $(call cmd,vmlinux__) 715 700 $(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd ··· 740 721 741 722 # Needs to visit scripts/ before $(KALLSYMS) can be used. 742 723 $(KALLSYMS): scripts ; 724 + 725 + # Generate some data for debugging strange kallsyms problems 726 + debug_kallsyms: .tmp_map$(last_kallsyms) 727 + 728 + .tmp_map%: .tmp_vmlinux% FORCE 729 + ($(OBJDUMP) -h $< | $(AWK) '/^ +[0-9]/{print $$4 " 0 " $$2}'; $(NM) $<) | sort > $@ 730 + 731 + .tmp_map3: .tmp_map2 732 + 733 + .tmp_map2: .tmp_map1 743 734 744 735 endif # ifdef CONFIG_KALLSYMS 745 736 ··· 786 757 prepare2: 787 758 ifneq ($(KBUILD_SRC),) 788 759 @echo ' Using $(srctree) as source for kernel' 789 - $(Q)if [ -h $(srctree)/include/asm -o -f $(srctree)/.config ]; then \ 760 + $(Q)if [ -f $(srctree)/.config ]; then \ 790 761 echo " $(srctree) is not clean, please run 'make mrproper'";\ 791 762 echo " in the '$(srctree)' directory.";\ 792 763 /bin/false; \ ··· 798 769 # prepare1 creates a makefile if using a separate output directory 799 770 prepare1: prepare2 outputmakefile 800 771 801 - prepare0: prepare1 include/linux/version.h include/asm include/config/MARKER 772 + prepare0: prepare1 include/linux/version.h include/asm \ 773 + include/config/MARKER 802 774 ifneq ($(KBUILD_MODULES),) 803 775 $(Q)rm -rf $(MODVERDIR) 804 776 $(Q)mkdir -p $(MODVERDIR) ··· 905 875 906 876 .PHONY: _modinst_ 907 877 _modinst_: 908 - @if [ -z "`$(DEPMOD) -V | grep module-init-tools`" ]; then \ 878 + @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \ 909 879 echo "Warning: you may need to install module-init-tools"; \ 910 880 echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\ 911 881 sleep 1; \ ··· 1189 1159 __srctree = $(srctree)/ 1190 1160 endif 1191 1161 1162 + ALLSOURCE_ARCHS := $(ARCH) 1163 + 1192 1164 define all-sources 1193 1165 ( find $(__srctree) $(RCS_FIND_IGNORE) \ 1194 1166 \( -name include -o -name arch \) -prune -o \ 1195 1167 -name '*.[chS]' -print; \ 1196 - find $(__srctree)arch/$(ARCH) $(RCS_FIND_IGNORE) \ 1197 - -name '*.[chS]' -print; \ 1168 + for ARCH in $(ALLSOURCE_ARCHS) ; do \ 1169 + find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \ 1170 + -name '*.[chS]' -print; \ 1171 + done ; \ 1198 1172 find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \ 1199 1173 -name '*.[chS]' -print; \ 1200 1174 find $(__srctree)include $(RCS_FIND_IGNORE) \ 1201 1175 \( -name config -o -name 'asm-*' \) -prune \ 1202 1176 -o -name '*.[chS]' -print; \ 1203 - find $(__srctree)include/asm-$(ARCH) $(RCS_FIND_IGNORE) \ 1204 - -name '*.[chS]' -print; \ 1177 + for ARCH in $(ALLSOURCE_ARCHS) ; do \ 1178 + find $(__srctree)include/asm-$${ARCH} $(RCS_FIND_IGNORE) \ 1179 + -name '*.[chS]' -print; \ 1180 + done ; \ 1205 1181 find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \ 1206 1182 -name '*.[chS]' -print ) 1207 1183 endef 1208 1184 1209 1185 quiet_cmd_cscope-file = FILELST cscope.files 1210 - cmd_cscope-file = $(all-sources) > cscope.files 1186 + cmd_cscope-file = (echo \-k; echo \-q; $(all-sources)) > cscope.files 1211 1187 1212 1188 quiet_cmd_cscope = MAKE cscope.out 1213 - cmd_cscope = cscope -k -b -q 1189 + cmd_cscope = cscope -b 1214 1190 1215 1191 cscope: FORCE 1216 1192 $(call cmd,cscope-file) 1217 1193 $(call cmd,cscope) 1218 1194 1219 1195 quiet_cmd_TAGS = MAKE $@ 1220 - cmd_TAGS = $(all-sources) | etags - 1196 + define cmd_TAGS 1197 + rm -f $@; \ 1198 + ETAGSF=`etags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL --extra=+f"`; \ 1199 + $(all-sources) | xargs etags $$ETAGSF -a 1200 + endef 1221 1201 1222 - # Exuberant ctags works better with -I 1202 + TAGS: FORCE 1203 + $(call cmd,TAGS) 1204 + 1223 1205 1224 1206 quiet_cmd_tags = MAKE $@ 1225 1207 define cmd_tags ··· 1239 1197 CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL --extra=+f"`; \ 1240 1198 $(all-sources) | xargs ctags $$CTAGSF -a 1241 1199 endef 1242 - 1243 - TAGS: FORCE 1244 - $(call cmd,TAGS) 1245 1200 1246 1201 tags: FORCE 1247 1202 $(call cmd,tags) ··· 1307 1268 include $(cmd_files) 1308 1269 endif 1309 1270 1310 - # Execute command and generate cmd file 1311 - if_changed = $(if $(strip $? \ 1312 - $(filter-out $(cmd_$(1)),$(cmd_$@))\ 1313 - $(filter-out $(cmd_$@),$(cmd_$(1)))),\ 1314 - @set -e; \ 1315 - $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \ 1316 - $(cmd_$(1)); \ 1317 - echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd) 1318 - 1319 - 1320 - # execute the command and also postprocess generated .d dependencies 1321 - # file 1322 - if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ 1323 - $(filter-out $(cmd_$(1)),$(cmd_$@))\ 1324 - $(filter-out $(cmd_$@),$(cmd_$(1)))),\ 1325 - $(Q)set -e; \ 1326 - $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \ 1327 - $(cmd_$(1)); \ 1328 - scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \ 1329 - rm -f $(depfile); \ 1330 - mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd) 1331 - 1332 - # Usage: $(call if_changed_rule,foo) 1333 - # will check if $(cmd_foo) changed, or any of the prequisites changed, 1334 - # and if so will execute $(rule_foo) 1335 - 1336 - if_changed_rule = $(if $(strip $? \ 1337 - $(filter-out $(cmd_$(1)),$(cmd_$(@F)))\ 1338 - $(filter-out $(cmd_$(@F)),$(cmd_$(1)))),\ 1339 - $(Q)$(rule_$(1))) 1340 - 1341 - # If quiet is set, only print short version of command 1342 - 1343 - cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) 1344 - 1345 - # filechk is used to check if the content of a generated file is updated. 1346 - # Sample usage: 1347 - # define filechk_sample 1348 - # echo $KERNELRELEASE 1349 - # endef 1350 - # version.h : Makefile 1351 - # $(call filechk,sample) 1352 - # The rule defined shall write to stdout the content of the new file. 1353 - # The existing file will be compared with the new one. 1354 - # - If no file exist it is created 1355 - # - If the content differ the new file is used 1356 - # - If they are equal no change, and no timestamp update 1357 - 1358 - define filechk 1359 - @set -e; \ 1360 - echo ' CHK $@'; \ 1361 - mkdir -p $(dir $@); \ 1362 - $(filechk_$(1)) < $< > $@.tmp; \ 1363 - if [ -r $@ ] && cmp -s $@ $@.tmp; then \ 1364 - rm -f $@.tmp; \ 1365 - else \ 1366 - echo ' UPD $@'; \ 1367 - mv -f $@.tmp $@; \ 1368 - fi 1369 - endef 1370 - 1371 - # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=dir 1372 - # Usage: 1373 - # $(Q)$(MAKE) $(build)=dir 1374 - build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj 1375 - 1376 1271 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir 1377 1272 # Usage: 1378 1273 # $(Q)$(MAKE) $(clean)=dir 1379 1274 clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj 1380 - 1381 - # $(call descend,<dir>,<target>) 1382 - # Recursively call a sub-make in <dir> with target <target> 1383 - # Usage is deprecated, because make does not see this as an invocation of make. 1384 - descend =$(Q)$(MAKE) -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj=$(1) $(2) 1385 1275 1386 1276 endif # skip-makefile 1387 1277
+1 -1
arch/m68knommu/Makefile
··· 114 114 prepare: include/asm-$(ARCH)/asm-offsets.h 115 115 116 116 archclean: 117 - $(call descend arch/$(ARCH)/boot, subdirclean) 117 + $(Q)$(MAKE) $(clean)=arch/m68knommu/boot 118 118 119 119 include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ 120 120 include/asm include/linux/version.h \
+1 -1
arch/mips/Makefile
··· 673 673 674 674 ifdef CONFIG_LASAT 675 675 rom.bin rom.sw: vmlinux 676 - $(call descend,arch/mips/lasat/image,$@) 676 + $(Q)$(MAKE) $(build)=arch/mips/lasat/image $@ 677 677 endif 678 678 679 679 #
-42
drivers/block/Kconfig
··· 408 408 "real" root file system, etc. See <file:Documentation/initrd.txt> 409 409 for details. 410 410 411 - config INITRAMFS_SOURCE 412 - string "Initramfs source file(s)" 413 - default "" 414 - help 415 - This can be either a single cpio archive with a .cpio suffix or a 416 - space-separated list of directories and files for building the 417 - initramfs image. A cpio archive should contain a filesystem archive 418 - to be used as an initramfs image. Directories should contain a 419 - filesystem layout to be included in the initramfs image. Files 420 - should contain entries according to the format described by the 421 - "usr/gen_init_cpio" program in the kernel tree. 422 - 423 - When multiple directories and files are specified then the 424 - initramfs image will be the aggregate of all of them. 425 - 426 - See <file:Documentation/early-userspace/README for more details. 427 - 428 - If you are not sure, leave it blank. 429 - 430 - config INITRAMFS_ROOT_UID 431 - int "User ID to map to 0 (user root)" 432 - depends on INITRAMFS_SOURCE!="" 433 - default "0" 434 - help 435 - This setting is only meaningful if the INITRAMFS_SOURCE is 436 - contains a directory. Setting this user ID (UID) to something 437 - other than "0" will cause all files owned by that UID to be 438 - owned by user root in the initial ramdisk image. 439 - 440 - If you are not sure, leave it set to "0". 441 - 442 - config INITRAMFS_ROOT_GID 443 - int "Group ID to map to 0 (group root)" 444 - depends on INITRAMFS_SOURCE!="" 445 - default "0" 446 - help 447 - This setting is only meaningful if the INITRAMFS_SOURCE is 448 - contains a directory. Setting this group ID (GID) to something 449 - other than "0" will cause all files owned by that GID to be 450 - owned by group root in the initial ramdisk image. 451 - 452 - If you are not sure, leave it set to "0". 453 411 454 412 #XXX - it makes sense to enable this only for 32-bit subarch's, not for x86_64 455 413 #for instance.
+9
include/asm-generic/vmlinux.lds.h
··· 6 6 #define VMLINUX_SYMBOL(_sym_) _sym_ 7 7 #endif 8 8 9 + /* Align . to a 8 byte boundary equals to maximum function alignment. */ 10 + #define ALIGN_FUNCTION() . = ALIGN(8) 11 + 9 12 #define RODATA \ 10 13 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ 11 14 *(.rodata) *(.rodata.*) \ ··· 82 79 VMLINUX_SYMBOL(__security_initcall_end) = .; \ 83 80 } 84 81 82 + /* sched.text is aling to function alignment to secure we have same 83 + * address even at second ld pass when generating System.map */ 85 84 #define SCHED_TEXT \ 85 + ALIGN_FUNCTION(); \ 86 86 VMLINUX_SYMBOL(__sched_text_start) = .; \ 87 87 *(.sched.text) \ 88 88 VMLINUX_SYMBOL(__sched_text_end) = .; 89 89 90 + /* spinlock.text is aling to function alignment to secure we have same 91 + * address even at second ld pass when generating System.map */ 90 92 #define LOCK_TEXT \ 93 + ALIGN_FUNCTION(); \ 91 94 VMLINUX_SYMBOL(__lock_text_start) = .; \ 92 95 *(.spinlock.text) \ 93 96 VMLINUX_SYMBOL(__lock_text_end) = .;
+20 -2
init/Kconfig
··· 77 77 object and source tree, in that order. Your total string can 78 78 be a maximum of 64 characters. 79 79 80 + config LOCALVERSION_AUTO 81 + bool "Automatically append version information to the version string" 82 + default y 83 + help 84 + This will try to automatically determine if the current tree is a 85 + release tree by looking for git tags that 86 + belong to the current top of tree revision. 87 + 88 + A string of the format -gxxxxxxxx will be added to the localversion 89 + if a git based tree is found. The string generated by this will be 90 + appended after any matching localversion* files, and after the value 91 + set in CONFIG_LOCALVERSION 92 + 93 + Note: This requires Perl, and a git repository, but not necessarily 94 + the git or cogito tools to be installed. 95 + 80 96 config SWAP 81 97 bool "Support for paging of anonymous memory (swap)" 82 98 depends on MMU ··· 254 238 255 239 Say N if unsure. 256 240 241 + source "usr/Kconfig" 242 + 257 243 menuconfig EMBEDDED 258 244 bool "Configure standard kernel features (for small systems)" 259 245 help ··· 278 260 help 279 261 Normally kallsyms only contains the symbols of functions, for nicer 280 262 OOPS messages. Some debuggers can use kallsyms for other 281 - symbols too: say Y here to include all symbols, and you 282 - don't care about adding 300k to the size of your kernel. 263 + symbols too: say Y here to include all symbols, if you need them 264 + and you don't care about adding 300k to the size of your kernel. 283 265 284 266 Say N. 285 267
+2 -1
init/Makefile
··· 25 25 26 26 include/linux/compile.h: FORCE 27 27 @echo ' CHK $@' 28 - @$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)" 28 + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ 29 + "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(CFLAGS)"
+96
scripts/Kbuild.include
··· 1 + #### 2 + # kbuild: Generic definitions 3 + 4 + # Convinient variables 5 + comma := , 6 + empty := 7 + space := $(empty) $(empty) 8 + 9 + ### 10 + # The temporary file to save gcc -MD generated dependencies must not 11 + # contain a comma 12 + depfile = $(subst $(comma),_,$(@D)/.$(@F).d) 13 + 14 + ### 15 + # filechk is used to check if the content of a generated file is updated. 16 + # Sample usage: 17 + # define filechk_sample 18 + # echo $KERNELRELEASE 19 + # endef 20 + # version.h : Makefile 21 + # $(call filechk,sample) 22 + # The rule defined shall write to stdout the content of the new file. 23 + # The existing file will be compared with the new one. 24 + # - If no file exist it is created 25 + # - If the content differ the new file is used 26 + # - If they are equal no change, and no timestamp update 27 + # - stdin is piped in from the first prerequisite ($<) so one has 28 + # to specify a valid file as first prerequisite (often the kbuild file) 29 + define filechk 30 + $(Q)set -e; \ 31 + echo ' CHK $@'; \ 32 + mkdir -p $(dir $@); \ 33 + $(filechk_$(1)) < $< > $@.tmp; \ 34 + if [ -r $@ ] && cmp -s $@ $@.tmp; then \ 35 + rm -f $@.tmp; \ 36 + else \ 37 + echo ' UPD $@'; \ 38 + mv -f $@.tmp $@; \ 39 + fi 40 + endef 41 + 42 + ### 43 + # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj= 44 + # Usage: 45 + # $(Q)$(MAKE) $(build)=dir 46 + build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj 47 + 48 + # If quiet is set, only print short version of command 49 + cmd = @$(if $($(quiet)cmd_$(1)),\ 50 + echo ' $(subst ','\'',$($(quiet)cmd_$(1)))' &&) $(cmd_$(1)) 51 + 52 + ### 53 + # if_changed - execute command if any prerequisite is newer than 54 + # target, or command line has changed 55 + # if_changed_dep - as if_changed, but uses fixdep to reveal dependencies 56 + # including used config symbols 57 + # if_changed_rule - as if_changed but execute rule instead 58 + # See Documentation/kbuild/makefiles.txt for more info 59 + 60 + ifneq ($(KBUILD_NOCMDDEP),1) 61 + # Check if both arguments has same arguments. Result in empty string if equal 62 + # User may override this check using make KBUILD_NOCMDDEP=1 63 + arg-check = $(strip $(filter-out $(1), $(2)) $(filter-out $(2), $(1)) ) 64 + endif 65 + 66 + # echo command. Short version is $(quiet) equals quiet, otherwise full command 67 + echo-cmd = $(if $($(quiet)cmd_$(1)), \ 68 + echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) 69 + 70 + # function to only execute the passed command if necessary 71 + # >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file 72 + # note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars 73 + # 74 + if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ 75 + @set -e; \ 76 + $(echo-cmd) \ 77 + $(cmd_$(1)); \ 78 + echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd) 79 + 80 + # execute the command and also postprocess generated .d dependencies 81 + # file 82 + if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ 83 + $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ 84 + @set -e; \ 85 + $(echo-cmd) \ 86 + $(cmd_$(1)); \ 87 + scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \ 88 + rm -f $(depfile); \ 89 + mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd) 90 + 91 + # Usage: $(call if_changed_rule,foo) 92 + # will check if $(cmd_foo) changed, or any of the prequisites changed, 93 + # and if so will execute $(rule_foo) 94 + if_changed_rule = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\ 95 + @set -e; \ 96 + $(rule_$(1)))
+5 -2
scripts/Makefile.build
··· 10 10 # Read .config if it exist, otherwise ignore 11 11 -include .config 12 12 13 - include $(if $(wildcard $(obj)/Kbuild), $(obj)/Kbuild, $(obj)/Makefile) 13 + # The filename Kbuild has precedence over Makefile 14 + kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 15 + include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) 14 16 17 + include scripts/Kbuild.include 15 18 include scripts/Makefile.lib 16 19 17 20 ifdef host-progs ··· 172 169 -T $(@D)/.tmp_$(@F:.o=.ver); \ 173 170 rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ 174 171 else \ 175 - mv $(@D)/.tmp_$(@F) $@; \ 172 + mv -f $(@D)/.tmp_$(@F) $@; \ 176 173 fi; 177 174 endif 178 175
+8 -6
scripts/Makefile.clean
··· 7 7 .PHONY: __clean 8 8 __clean: 9 9 10 - include $(if $(wildcard $(obj)/Kbuild), $(obj)/Kbuild, $(obj)/Makefile) 10 + # Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir 11 + # Usage: 12 + # $(Q)$(MAKE) $(clean)=dir 13 + clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj 14 + 15 + # The filename Kbuild has precedence over Makefile 16 + kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 17 + include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) 11 18 12 19 # Figure out what we need to build from the various variables 13 20 # ========================================================================== ··· 94 87 # If quiet is set, only print short version of command 95 88 96 89 cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) 97 - 98 - # Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir 99 - # Usage: 100 - # $(Q)$(MAKE) $(clean)=dir 101 - clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
+2 -1
scripts/Makefile.host
··· 98 98 # Create executable from a single .c file 99 99 # host-csingle -> Executable 100 100 quiet_cmd_host-csingle = HOSTCC $@ 101 - cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(HOST_LOADLIBES) -o $@ $< 101 + cmd_host-csingle = $(HOSTCC) $(hostc_flags) -o $@ $< \ 102 + $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) 102 103 $(host-csingle): %: %.c FORCE 103 104 $(call if_changed_dep,host-csingle) 104 105
-99
scripts/Makefile.lib
··· 1 - # =========================================================================== 2 - # kbuild: Generic definitions 3 - # =========================================================================== 4 - 5 - # Standard vars 6 - 7 - comma := , 8 - empty := 9 - space := $(empty) $(empty) 10 - 11 1 # Backward compatibility - to be removed... 12 2 extra-y += $(EXTRA_TARGETS) 13 3 # Figure out what we need to build from the various variables ··· 73 83 multi-objs-m := $(addprefix $(obj)/,$(multi-objs-m)) 74 84 subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) 75 85 obj-dirs := $(addprefix $(obj)/,$(obj-dirs)) 76 - 77 - # The temporary file to save gcc -MD generated dependencies must not 78 - # contain a comma 79 - depfile = $(subst $(comma),_,$(@D)/.$(@F).d) 80 86 81 87 # These flags are needed for modversions and compiling, so we define them here 82 88 # already ··· 165 179 quiet_cmd_gzip = GZIP $@ 166 180 cmd_gzip = gzip -f -9 < $< > $@ 167 181 168 - # =========================================================================== 169 - # Generic stuff 170 - # =========================================================================== 171 - 172 - ifneq ($(KBUILD_NOCMDDEP),1) 173 - # Check if both arguments has same arguments. Result in empty string if equal 174 - # User may override this check using make KBUILD_NOCMDDEP=1 175 - arg-check = $(strip $(filter-out $(1), $(2)) $(filter-out $(2), $(1)) ) 176 - 177 - endif 178 - 179 - # echo command. Short version is $(quiet) equals quiet, otherwise full command 180 - echo-cmd = $(if $($(quiet)cmd_$(1)), \ 181 - echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) 182 - 183 - # function to only execute the passed command if necessary 184 - # >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file 185 - # note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars 186 - # 187 - if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ 188 - @set -e; \ 189 - $(echo-cmd) \ 190 - $(cmd_$(1)); \ 191 - echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd) 192 - 193 - 194 - # execute the command and also postprocess generated .d dependencies 195 - # file 196 - 197 - if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ 198 - $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ 199 - @set -e; \ 200 - $(echo-cmd) \ 201 - $(cmd_$(1)); \ 202 - scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \ 203 - rm -f $(depfile); \ 204 - mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd) 205 - 206 - # Usage: $(call if_changed_rule,foo) 207 - # will check if $(cmd_foo) changed, or any of the prequisites changed, 208 - # and if so will execute $(rule_foo) 209 - 210 - if_changed_rule = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\ 211 - @set -e; \ 212 - $(rule_$(1))) 213 - 214 - # If quiet is set, only print short version of command 215 - 216 - cmd = @$(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))' &&) $(cmd_$(1)) 217 - 218 - # $(call descend,<dir>,<target>) 219 - # Recursively call a sub-make in <dir> with target <target> 220 - # Usage is deprecated, because make do not see this as an invocation of make. 221 - descend =$(Q)$(MAKE) -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj=$(1) $(2) 222 - 223 - # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj= 224 - # Usage: 225 - # $(Q)$(MAKE) $(build)=dir 226 - build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj 227 - 228 - # filechk is used to check if the content of a generated file is updated. 229 - # Sample usage: 230 - # define filechk_sample 231 - # echo $KERNELRELEASE 232 - # endef 233 - # version.h : Makefile 234 - # $(call filechk,sample) 235 - # The rule defined shall write to stdout the content of the new file. 236 - # The existing file will be compared with the new one. 237 - # - If no file exist it is created 238 - # - If the content differ the new file is used 239 - # - If they are equal no change, and no timestamp update 240 - 241 - define filechk 242 - $(Q)set -e; \ 243 - echo ' CHK $@'; \ 244 - mkdir -p $(dir $@); \ 245 - $(filechk_$(1)) $(2) > $@.tmp; \ 246 - if [ -r $@ ] && cmp -s $@ $@.tmp; then \ 247 - rm -f $@.tmp; \ 248 - else \ 249 - echo ' UPD $@'; \ 250 - mv -f $@.tmp $@; \ 251 - fi 252 - endef 253 182
+1 -1
scripts/Makefile.modinst
··· 5 5 .PHONY: __modinst 6 6 __modinst: 7 7 8 - include scripts/Makefile.lib 8 + include scripts/Kbuild.include 9 9 10 10 # 11 11
+1
scripts/Makefile.modpost
··· 36 36 _modpost: __modpost 37 37 38 38 include .config 39 + include scripts/Kbuild.include 39 40 include scripts/Makefile.lib 40 41 41 42 symverfile := $(objtree)/Module.symvers
+1 -1
scripts/conmakehash.c
··· 33 33 34 34 int getunicode(char **p0) 35 35 { 36 - unsigned char *p = *p0; 36 + char *p = *p0; 37 37 38 38 while (*p == ' ' || *p == '\t') 39 39 p++;
+3 -3
scripts/kallsyms.c
··· 207 207 * move then they may get dropped in pass 2, which breaks the 208 208 * kallsyms rules. 209 209 */ 210 - if ((s->addr == _etext && strcmp(s->sym + offset, "_etext")) || 211 - (s->addr == _einittext && strcmp(s->sym + offset, "_einittext")) || 212 - (s->addr == _eextratext && strcmp(s->sym + offset, "_eextratext"))) 210 + if ((s->addr == _etext && strcmp((char*)s->sym + offset, "_etext")) || 211 + (s->addr == _einittext && strcmp((char*)s->sym + offset, "_einittext")) || 212 + (s->addr == _eextratext && strcmp((char*)s->sym + offset, "_eextratext"))) 213 213 return 0; 214 214 } 215 215
+1 -1
scripts/kconfig/lkc.h
··· 59 59 void menu_end_entry(void); 60 60 void menu_add_dep(struct expr *dep); 61 61 struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep); 62 - void menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); 62 + struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); 63 63 void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep); 64 64 void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep); 65 65 void menu_finalize(struct menu *parent);
+2 -2
scripts/kconfig/menu.c
··· 136 136 return prop; 137 137 } 138 138 139 - void menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep) 139 + struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep) 140 140 { 141 - menu_add_prop(type, prompt, NULL, dep); 141 + return menu_add_prop(type, prompt, NULL, dep); 142 142 } 143 143 144 144 void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep)
+4 -4
scripts/kconfig/zconf.tab.c_shipped
··· 1531 1531 1532 1532 { 1533 1533 menu_add_entry(NULL); 1534 - menu_add_prop(P_MENU, yyvsp[-1].string, NULL, NULL); 1534 + menu_add_prompt(P_MENU, yyvsp[-1].string, NULL); 1535 1535 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); 1536 1536 ;} 1537 1537 break; ··· 1586 1586 1587 1587 { 1588 1588 menu_add_entry(NULL); 1589 - menu_add_prop(P_COMMENT, yyvsp[-1].string, NULL, NULL); 1589 + menu_add_prompt(P_COMMENT, yyvsp[-1].string, NULL); 1590 1590 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); 1591 1591 ;} 1592 1592 break; ··· 1640 1640 case 86: 1641 1641 1642 1642 { 1643 - menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr); 1643 + menu_add_prompt(P_PROMPT, yyvsp[-1].string, yyvsp[0].expr); 1644 1644 ;} 1645 1645 break; 1646 1646 ··· 1925 1925 sym_init(); 1926 1926 menu_init(); 1927 1927 modules_sym = sym_lookup("MODULES", 0); 1928 - rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL); 1928 + rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); 1929 1929 1930 1930 //zconfdebug = 1; 1931 1931 zconfparse();
+4 -4
scripts/kconfig/zconf.y
··· 342 342 menu: T_MENU prompt T_EOL 343 343 { 344 344 menu_add_entry(NULL); 345 - menu_add_prop(P_MENU, $2, NULL, NULL); 345 + menu_add_prompt(P_MENU, $2, NULL); 346 346 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); 347 347 }; 348 348 ··· 392 392 comment: T_COMMENT prompt T_EOL 393 393 { 394 394 menu_add_entry(NULL); 395 - menu_add_prop(P_COMMENT, $2, NULL, NULL); 395 + menu_add_prompt(P_COMMENT, $2, NULL); 396 396 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); 397 397 }; 398 398 ··· 443 443 /* empty */ 444 444 | prompt if_expr 445 445 { 446 - menu_add_prop(P_PROMPT, $1, NULL, $2); 446 + menu_add_prompt(P_PROMPT, $1, $2); 447 447 }; 448 448 449 449 prompt: T_WORD ··· 487 487 sym_init(); 488 488 menu_init(); 489 489 modules_sym = sym_lookup("MODULES", 0); 490 - rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL); 490 + rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); 491 491 492 492 //zconfdebug = 1; 493 493 zconfparse();
+7 -1
scripts/kernel-doc
··· 1665 1665 } 1666 1666 1667 1667 sub process_file($) { 1668 - my ($file) = "$ENV{'SRCTREE'}@_"; 1668 + my $file; 1669 1669 my $identifier; 1670 1670 my $func; 1671 1671 my $initial_section_counter = $section_counter; 1672 1672 1673 + if (defined($ENV{'SRCTREE'})) { 1674 + $file = "$ENV{'SRCTREE'}" . "/" . "@_"; 1675 + } 1676 + else { 1677 + $file = "@_"; 1678 + } 1673 1679 if (defined($source_map{$file})) { 1674 1680 $file = $source_map{$file}; 1675 1681 }
+1 -1
scripts/lxdialog/dialog.h
··· 163 163 int dialog_checklist (const char *title, const char *prompt, int height, 164 164 int width, int list_height, int item_no, 165 165 const char * const * items, int flag); 166 - extern unsigned char dialog_input_result[]; 166 + extern char dialog_input_result[]; 167 167 int dialog_inputbox (const char *title, const char *prompt, int height, 168 168 int width, const char *init); 169 169
+2 -2
scripts/lxdialog/inputbox.c
··· 21 21 22 22 #include "dialog.h" 23 23 24 - unsigned char dialog_input_result[MAX_LEN + 1]; 24 + char dialog_input_result[MAX_LEN + 1]; 25 25 26 26 /* 27 27 * Print the termination buttons ··· 48 48 { 49 49 int i, x, y, box_y, box_x, box_width; 50 50 int input_x = 0, scroll = 0, key = 0, button = -1; 51 - unsigned char *instr = dialog_input_result; 51 + char *instr = dialog_input_result; 52 52 WINDOW *dialog; 53 53 54 54 /* center dialog box on screen */
+8 -4
scripts/mkcompile_h
··· 1 1 TARGET=$1 2 2 ARCH=$2 3 3 SMP=$3 4 - CC=$4 4 + PREEMPT=$4 5 + CC=$5 5 6 6 7 # If compile.h exists already and we don't own autoconf.h 7 8 # (i.e. we're not the same user who did make *config), don't ··· 27 26 28 27 29 28 UTS_VERSION="#$VERSION" 30 - if [ -n "$SMP" ] ; then UTS_VERSION="$UTS_VERSION SMP"; fi 31 - UTS_VERSION="$UTS_VERSION `LC_ALL=C LANG=C date`" 29 + CONFIG_FLAGS="" 30 + if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi 31 + if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi 32 + UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS `LC_ALL=C LANG=C date`" 32 33 33 34 # Truncate to maximum length 34 35 ··· 40 37 # Generate a temporary compile.h 41 38 42 39 ( echo /\* This file is auto generated, version $VERSION \*/ 43 - 40 + if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi 41 + 44 42 echo \#define UTS_MACHINE \"$ARCH\" 45 43 46 44 echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
+4 -4
scripts/mod/sumversion.c
··· 252 252 } 253 253 254 254 /* FIXME: Handle .s files differently (eg. # starts comments) --RR */ 255 - static int parse_file(const signed char *fname, struct md4_ctx *md) 255 + static int parse_file(const char *fname, struct md4_ctx *md) 256 256 { 257 - signed char *file; 257 + char *file; 258 258 unsigned long i, len; 259 259 260 260 file = grab_file(fname, &len); ··· 332 332 Sum all files in the same dir or subdirs. 333 333 */ 334 334 while ((line = get_next_line(&pos, file, flen)) != NULL) { 335 - signed char* p = line; 335 + char* p = line; 336 336 if (strncmp(line, "deps_", sizeof("deps_")-1) == 0) { 337 337 check_files = 1; 338 338 continue; ··· 458 458 close(fd); 459 459 } 460 460 461 - static int strip_rcs_crap(signed char *version) 461 + static int strip_rcs_crap(char *version) 462 462 { 463 463 unsigned int len, full_len; 464 464
+19 -5
scripts/package/Makefile
··· 59 59 $(CONFIG_SHELL) $(MKSPEC) prebuilt > $@ 60 60 61 61 binrpm-pkg: $(objtree)/binkernel.spec 62 - $(MAKE) 62 + $(MAKE) KBUILD_SRC= 63 63 set -e; \ 64 64 $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version 65 65 set -e; \ ··· 74 74 # 75 75 .PHONY: deb-pkg 76 76 deb-pkg: 77 - $(MAKE) 77 + $(MAKE) KBUILD_SRC= 78 78 $(CONFIG_SHELL) $(srctree)/scripts/package/builddeb 79 79 80 80 clean-dirs += $(objtree)/debian/ 81 81 82 82 83 + # tarball targets 84 + # --------------------------------------------------------------------------- 85 + .PHONY: tar%pkg 86 + tar%pkg: 87 + $(MAKE) 88 + $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@ 89 + 90 + clean-dirs += $(objtree)/tar-install/ 91 + 92 + 83 93 # Help text displayed when executing 'make help' 84 94 # --------------------------------------------------------------------------- 85 95 help: 86 - @echo ' rpm-pkg - Build the kernel as an RPM package' 87 - @echo ' binrpm-pkg - Build an rpm package containing the compiled kernel & modules' 88 - @echo ' deb-pkg - Build the kernel as an deb package' 96 + @echo ' rpm-pkg - Build the kernel as an RPM package' 97 + @echo ' binrpm-pkg - Build an rpm package containing the compiled kernel' 98 + @echo ' and modules' 99 + @echo ' deb-pkg - Build the kernel as an deb package' 100 + @echo ' tar-pkg - Build the kernel as an uncompressed tarball' 101 + @echo ' targz-pkg - Build the kernel as a gzip compressed tarball' 102 + @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball' 89 103
+50 -6
scripts/package/builddeb
··· 14 14 # Some variables and settings used throughout the script 15 15 version=$KERNELRELEASE 16 16 tmpdir="$objtree/debian/tmp" 17 + packagename=linux-$version 18 + 19 + if [ "$ARCH" == "um" ] ; then 20 + packagename=user-mode-linux-$version 21 + fi 17 22 18 23 # Setup the directory structure 19 24 rm -rf "$tmpdir" 20 25 mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" 26 + if [ "$ARCH" == "um" ] ; then 27 + mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/share/doc/$packagename" "$tmpdir/usr/bin" 28 + fi 21 29 22 30 # Build and install the kernel 23 - cp System.map "$tmpdir/boot/System.map-$version" 24 - cp .config "$tmpdir/boot/config-$version" 25 - cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version" 31 + if [ "$ARCH" == "um" ] ; then 32 + $MAKE linux 33 + cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map" 34 + cp .config "$tmpdir/usr/share/doc/$packagename/config" 35 + gzip "$tmpdir/usr/share/doc/$packagename/config" 36 + cp $KBUILD_IMAGE "$tmpdir/usr/bin/linux-$version" 37 + else 38 + cp System.map "$tmpdir/boot/System.map-$version" 39 + cp .config "$tmpdir/boot/config-$version" 40 + cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version" 41 + fi 26 42 27 43 if grep -q '^CONFIG_MODULES=y' .config ; then 28 - INSTALL_MOD_PATH="$tmpdir" make modules_install 44 + INSTALL_MOD_PATH="$tmpdir" make KBUILD_SRC= modules_install 45 + if [ "$ARCH" == "um" ] ; then 46 + mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/" 47 + rmdir "$tmpdir/lib/modules/$version" 48 + fi 29 49 fi 30 50 31 51 # Install the maintainer scripts ··· 73 53 EOF 74 54 75 55 # Generate a control file 56 + if [ "$ARCH" == "um" ]; then 57 + 76 58 cat <<EOF > debian/control 77 59 Source: linux 78 60 Section: base ··· 82 60 Maintainer: $name 83 61 Standards-Version: 3.6.1 84 62 85 - Package: linux-$version 63 + Package: $packagename 64 + Architecture: any 65 + Description: User Mode Linux kernel, version $version 66 + User-mode Linux is a port of the Linux kernel to its own system call 67 + interface. It provides a kind of virtual machine, which runs Linux 68 + as a user process under another Linux kernel. This is useful for 69 + kernel development, sandboxes, jails, experimentation, and 70 + many other things. 71 + . 72 + This package contains the Linux kernel, modules and corresponding other 73 + files version $version 74 + EOF 75 + 76 + else 77 + cat <<EOF > debian/control 78 + Source: linux 79 + Section: base 80 + Priority: optional 81 + Maintainer: $name 82 + Standards-Version: 3.6.1 83 + 84 + Package: $packagename 86 85 Architecture: any 87 86 Description: Linux kernel, version $version 88 87 This package contains the Linux kernel, modules and corresponding other 89 - files version $version. 88 + files version $version 90 89 EOF 90 + fi 91 91 92 92 # Fix some ownership and permissions 93 93 chown -R root:root "$tmpdir"
+111
scripts/package/buildtar
··· 1 + #!/bin/sh 2 + 3 + # 4 + # buildtar 0.0.3 5 + # 6 + # (C) 2004-2005 by Jan-Benedict Glaw <jbglaw@lug-owl.de> 7 + # 8 + # This script is used to compile a tarball from the currently 9 + # prepared kernel. Based upon the builddeb script from 10 + # Wichert Akkerman <wichert@wiggy.net>. 11 + # 12 + 13 + set -e 14 + 15 + # 16 + # Some variables and settings used throughout the script 17 + # 18 + version="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}${EXTRANAME}" 19 + tmpdir="${objtree}/tar-install" 20 + tarball="${objtree}/linux-${version}.tar" 21 + 22 + 23 + # 24 + # Figure out how to compress, if requested at all 25 + # 26 + case "${1}" in 27 + tar-pkg) 28 + compress="cat" 29 + file_ext="" 30 + ;; 31 + targz-pkg) 32 + compress="gzip -c9" 33 + file_ext=".gz" 34 + ;; 35 + tarbz2-pkg) 36 + compress="bzip2 -c9" 37 + file_ext=".bz2" 38 + ;; 39 + *) 40 + echo "Unknown tarball target \"${1}\" requested, please add it to ${0}." >&2 41 + exit 1 42 + ;; 43 + esac 44 + 45 + 46 + # 47 + # Clean-up and re-create the temporary directory 48 + # 49 + rm -rf -- "${tmpdir}" 50 + mkdir -p -- "${tmpdir}/boot" 51 + 52 + 53 + # 54 + # Try to install modules 55 + # 56 + if ! make INSTALL_MOD_PATH="${tmpdir}" modules_install; then 57 + echo "" >&2 58 + echo "Ignoring error at module_install time, since that could be" >&2 59 + echo "a result of missing local modutils/module-init-tools," >&2 60 + echo "or you just didn't compile in module support at all..." >&2 61 + echo "" >&2 62 + fi 63 + 64 + 65 + # 66 + # Install basic kernel files 67 + # 68 + cp -v -- System.map "${tmpdir}/boot/System.map-${version}" 69 + cp -v -- .config "${tmpdir}/boot/config-${version}" 70 + cp -v -- vmlinux "${tmpdir}/boot/vmlinux-${version}" 71 + 72 + 73 + # 74 + # Install arch-specific kernel image(s) 75 + # 76 + case "${ARCH}" in 77 + i386) 78 + [ -f arch/i386/boot/bzImage ] && cp -v -- arch/i386/boot/bzImage "${tmpdir}/boot/vmlinuz-${version}" 79 + ;; 80 + alpha) 81 + [ -f arch/alpha/boot/vmlinux.gz ] && cp -v -- arch/alpha/boot/vmlinux.gz "${tmpdir}/boot/vmlinuz-${version}" 82 + ;; 83 + vax) 84 + [ -f vmlinux.SYS ] && cp -v -- vmlinux.SYS "${tmpdir}/boot/vmlinux-${version}.SYS" 85 + [ -f vmlinux.dsk ] && cp -v -- vmlinux.dsk "${tmpdir}/boot/vmlinux-${version}.dsk" 86 + ;; 87 + *) 88 + [ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-kbuild-${version}" 89 + echo "" >&2 90 + echo '** ** ** WARNING ** ** **' >&2 91 + echo "" >&2 92 + echo "Your architecture did not define any architecture-dependant files" >&2 93 + echo "to be placed into the tarball. Please add those to ${0} ..." >&2 94 + echo "" >&2 95 + sleep 5 96 + ;; 97 + esac 98 + 99 + 100 + # 101 + # Create the tarball 102 + # 103 + ( 104 + cd "${tmpdir}" 105 + tar cf - . | ${compress} > "${tarball}${file_ext}" 106 + ) 107 + 108 + echo "Tarball successfully created in ${tarball}${file_ext}" 109 + 110 + exit 0 111 +
+9
scripts/package/mkspec
··· 62 62 fi 63 63 64 64 echo "%install" 65 + echo "%ifarch ia64" 66 + echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules' 67 + echo "%else" 65 68 echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules' 69 + echo "%endif" 66 70 67 71 echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} modules_install' 72 + echo "%ifarch ia64" 73 + echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/efi/vmlinuz-$KERNELRELEASE" 74 + echo 'ln -s '"efi/vmlinuz-$KERNELRELEASE" '$RPM_BUILD_ROOT'"/boot/" 75 + echo "%else" 68 76 echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$KERNELRELEASE" 77 + echo "%endif" 69 78 70 79 echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE" 71 80
+1
scripts/reference_discarded.pl
··· 96 96 $from !~ /\.debug_ranges$/ && 97 97 $from !~ /\.debug_line$/ && 98 98 $from !~ /\.debug_frame$/ && 99 + $from !~ /\.debug_loc$/ && 99 100 $from !~ /\.exitcall\.exit$/ && 100 101 $from !~ /\.eh_frame$/ && 101 102 $from !~ /\.stab$/)) {
+1
scripts/reference_init.pl
··· 98 98 $from !~ /\.pdr$/ && 99 99 $from !~ /\__param$/ && 100 100 $from !~ /\.altinstructions/ && 101 + $from !~ /\.eh_frame/ && 101 102 $from !~ /\.debug_/)) { 102 103 printf("Error: %s %s refers to %s\n", $object, $from, $line); 103 104 }
+56
scripts/setlocalversion
··· 1 + #!/usr/bin/perl 2 + # Copyright 2004 - Ryan Anderson <ryan@michonline.com> GPL v2 3 + 4 + use strict; 5 + use warnings; 6 + use Digest::MD5; 7 + require 5.006; 8 + 9 + if (@ARGV != 1) { 10 + print <<EOT; 11 + Usage: setlocalversion <srctree> 12 + EOT 13 + exit(1); 14 + } 15 + 16 + my ($srctree) = @ARGV; 17 + chdir($srctree); 18 + 19 + my @LOCALVERSIONS = (); 20 + 21 + # We are going to use the following commands to try and determine if this 22 + # repository is at a Version boundary (i.e, 2.6.10 vs 2.6.10 + some patches) We 23 + # currently assume that all meaningful version boundaries are marked by a tag. 24 + # We don't care what the tag is, just that something exists. 25 + 26 + # Git/Cogito store the top-of-tree "commit" in .git/HEAD 27 + # A list of known tags sits in .git/refs/tags/ 28 + # 29 + # The simple trick here is to just compare the two of these, and if we get a 30 + # match, return nothing, otherwise, return a subset of the SHA-1 hash in 31 + # .git/HEAD 32 + 33 + sub do_git_checks { 34 + open(H,"<.git/HEAD") or return; 35 + my $head = <H>; 36 + chomp $head; 37 + close(H); 38 + 39 + opendir(D,".git/refs/tags") or return; 40 + foreach my $tagfile (grep !/^\.{1,2}$/, readdir(D)) { 41 + open(F,"<.git/refs/tags/" . $tagfile) or return; 42 + my $tag = <F>; 43 + chomp $tag; 44 + close(F); 45 + return if ($tag eq $head); 46 + } 47 + closedir(D); 48 + 49 + push @LOCALVERSIONS, "g" . substr($head,0,8); 50 + } 51 + 52 + if ( -d ".git") { 53 + do_git_checks(); 54 + } 55 + 56 + printf "-%s\n", join("-",@LOCALVERSIONS) if (scalar @LOCALVERSIONS > 0);
+46
usr/Kconfig
··· 1 + # 2 + # Configuration for initramfs 3 + # 4 + 5 + config INITRAMFS_SOURCE 6 + string "Initramfs source file(s)" 7 + default "" 8 + help 9 + This can be either a single cpio archive with a .cpio suffix or a 10 + space-separated list of directories and files for building the 11 + initramfs image. A cpio archive should contain a filesystem archive 12 + to be used as an initramfs image. Directories should contain a 13 + filesystem layout to be included in the initramfs image. Files 14 + should contain entries according to the format described by the 15 + "usr/gen_init_cpio" program in the kernel tree. 16 + 17 + When multiple directories and files are specified then the 18 + initramfs image will be the aggregate of all of them. 19 + 20 + See <file:Documentation/early-userspace/README for more details. 21 + 22 + If you are not sure, leave it blank. 23 + 24 + config INITRAMFS_ROOT_UID 25 + int "User ID to map to 0 (user root)" 26 + depends on INITRAMFS_SOURCE!="" 27 + default "0" 28 + help 29 + This setting is only meaningful if the INITRAMFS_SOURCE is 30 + contains a directory. Setting this user ID (UID) to something 31 + other than "0" will cause all files owned by that UID to be 32 + owned by user root in the initial ramdisk image. 33 + 34 + If you are not sure, leave it set to "0". 35 + 36 + config INITRAMFS_ROOT_GID 37 + int "Group ID to map to 0 (group root)" 38 + depends on INITRAMFS_SOURCE!="" 39 + default "0" 40 + help 41 + This setting is only meaningful if the INITRAMFS_SOURCE is 42 + contains a directory. Setting this group ID (GID) to something 43 + other than "0" will cause all files owned by that GID to be 44 + owned by group root in the initial ramdisk image. 45 + 46 + If you are not sure, leave it set to "0".
+1 -1
usr/Makefile
··· 27 27 filechk_initramfs_list = $(CONFIG_SHELL) \ 28 28 $(srctree)/scripts/gen_initramfs_list.sh $(gen_initramfs_args) $(quotefixed_initramfs_source) 29 29 30 - $(obj)/initramfs_list: FORCE 30 + $(obj)/initramfs_list: $(obj)/Makefile FORCE 31 31 $(call filechk,initramfs_list) 32 32 33 33 quiet_cmd_cpio = CPIO $@