···872872 Assignments to $(targets) are without $(obj)/ prefix.873873 if_changed may be used in conjunction with custom commands as874874 defined in 6.7 "Custom kbuild commands".875875+875876 Note: It is a typical mistake to forget the FORCE prerequisite.877877+ Another common pitfall is that whitespace is sometimes878878+ significant; for instance, the below will fail (note the extra space879879+ after the comma):880880+ target: source(s) FORCE881881+ #WRONG!# $(call if_changed, ld/objcopy/gzip)876882877883 ld878884 Link target. Often LDFLAGS_$@ is used to set specific options to ld.
+64-96
Makefile
···109109.PHONY: $(MAKECMDGOALS)110110111111$(filter-out _all,$(MAKECMDGOALS)) _all:112112- $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \113113- KBUILD_SRC=$(CURDIR) KBUILD_VERBOSE=$(KBUILD_VERBOSE) \114114- KBUILD_CHECK=$(KBUILD_CHECK) KBUILD_EXTMOD="$(KBUILD_EXTMOD)" \115115- -f $(CURDIR)/Makefile $@112112+ $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \113113+ KBUILD_SRC=$(CURDIR) \114114+ KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $@116115117116# Leave processing to above invocation of make118117skip-makefile := 1···232233 KBUILD_MODULES := 1233234endif234235235235-export KBUILD_MODULES KBUILD_BUILTIN KBUILD_VERBOSE236236+export KBUILD_MODULES KBUILD_BUILTIN236237export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD237238238239# Beautify output···308309# Look for make include files relative to root of kernel src309310MAKEFLAGS += --include-dir=$(srctree)310311312312+# We need some generic definitions313313+include $(srctree)/scripts/Kbuild.include314314+311315# For maximum performance (+ possibly random breakage, uncomment312316# the following)313317···350348351349CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)352350353353-CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \351351+CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \354352 -fno-strict-aliasing -fno-common \355353 -ffreestanding356354AFLAGS := -D__ASSEMBLY__···368366# tree rather than in the kernel tree. The kernel tree might369367# even be read-only.370368export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions371371-372372-# The temporary file to save gcc -MD generated dependencies must not373373-# contain a comma374374-comma := ,375375-depfile = $(subst $(comma),_,$(@D)/.$(@F).d)376369377370# Files to ignore in find ... statements378371···548551# images. Default is /boot, but you can set it to other values549552export INSTALL_PATH ?= /boot550553554554+# If CONFIG_LOCALVERSION_AUTO is set, we automatically perform some tests555555+# and try to determine if the current source tree is a release tree, of any sort,556556+# or if is a pure development tree.557557+#558558+# A 'release tree' is any tree with a git TAG associated559559+# with it. The primary goal of this is to make it safe for a native560560+# git/CVS/SVN user to build a release tree (i.e, 2.6.9) and also to561561+# continue developing against the current Linus tree, without having the Linus562562+# tree overwrite the 2.6.9 tree when installed.563563+#564564+# Currently, only git is supported.565565+# Other SCMs can edit scripts/setlocalversion and add the appropriate566566+# checks as needed.567567+568568+569569+ifdef CONFIG_LOCALVERSION_AUTO570570+ localversion-auto := $(shell $(PERL) $(srctree)/scripts/setlocalversion $(srctree))571571+ LOCALVERSION := $(LOCALVERSION)$(localversion-auto)572572+endif573573+551574#552575# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory553576# relocations required by build roots. This is not defined in the···708691709692# Update vmlinux version before link710693# Use + in front of this rule to silent warning about make -j1694694+# First command is ':' to allow us to use + in front of this rule711695cmd_ksym_ld = $(cmd_vmlinux__)712696define rule_ksym_ld697697+ : 713698 +$(call cmd,vmlinux_version)714699 $(call cmd,vmlinux__)715700 $(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd···740721741722# Needs to visit scripts/ before $(KALLSYMS) can be used.742723$(KALLSYMS): scripts ;724724+725725+# Generate some data for debugging strange kallsyms problems726726+debug_kallsyms: .tmp_map$(last_kallsyms)727727+728728+.tmp_map%: .tmp_vmlinux% FORCE729729+ ($(OBJDUMP) -h $< | $(AWK) '/^ +[0-9]/{print $$4 " 0 " $$2}'; $(NM) $<) | sort > $@730730+731731+.tmp_map3: .tmp_map2732732+733733+.tmp_map2: .tmp_map1743734744735endif # ifdef CONFIG_KALLSYMS745736···786757prepare2:787758ifneq ($(KBUILD_SRC),)788759 @echo ' Using $(srctree) as source for kernel'789789- $(Q)if [ -h $(srctree)/include/asm -o -f $(srctree)/.config ]; then \760760+ $(Q)if [ -f $(srctree)/.config ]; then \790761 echo " $(srctree) is not clean, please run 'make mrproper'";\791762 echo " in the '$(srctree)' directory.";\792763 /bin/false; \···798769# prepare1 creates a makefile if using a separate output directory799770prepare1: prepare2 outputmakefile800771801801-prepare0: prepare1 include/linux/version.h include/asm include/config/MARKER772772+prepare0: prepare1 include/linux/version.h include/asm \773773+ include/config/MARKER802774ifneq ($(KBUILD_MODULES),)803775 $(Q)rm -rf $(MODVERDIR)804776 $(Q)mkdir -p $(MODVERDIR)···905875906876.PHONY: _modinst_907877_modinst_:908908- @if [ -z "`$(DEPMOD) -V | grep module-init-tools`" ]; then \878878+ @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \909879 echo "Warning: you may need to install module-init-tools"; \910880 echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\911881 sleep 1; \···11891159__srctree = $(srctree)/11901160endif1191116111621162+ALLSOURCE_ARCHS := $(ARCH)11631163+11921164define all-sources11931165 ( find $(__srctree) $(RCS_FIND_IGNORE) \11941166 \( -name include -o -name arch \) -prune -o \11951167 -name '*.[chS]' -print; \11961196- find $(__srctree)arch/$(ARCH) $(RCS_FIND_IGNORE) \11971197- -name '*.[chS]' -print; \11681168+ for ARCH in $(ALLSOURCE_ARCHS) ; do \11691169+ find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \11701170+ -name '*.[chS]' -print; \11711171+ done ; \11981172 find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \11991173 -name '*.[chS]' -print; \12001174 find $(__srctree)include $(RCS_FIND_IGNORE) \12011175 \( -name config -o -name 'asm-*' \) -prune \12021176 -o -name '*.[chS]' -print; \12031203- find $(__srctree)include/asm-$(ARCH) $(RCS_FIND_IGNORE) \12041204- -name '*.[chS]' -print; \11771177+ for ARCH in $(ALLSOURCE_ARCHS) ; do \11781178+ find $(__srctree)include/asm-$${ARCH} $(RCS_FIND_IGNORE) \11791179+ -name '*.[chS]' -print; \11801180+ done ; \12051181 find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \12061182 -name '*.[chS]' -print )12071183endef1208118412091185quiet_cmd_cscope-file = FILELST cscope.files12101210- cmd_cscope-file = $(all-sources) > cscope.files11861186+ cmd_cscope-file = (echo \-k; echo \-q; $(all-sources)) > cscope.files1211118712121188quiet_cmd_cscope = MAKE cscope.out12131213- cmd_cscope = cscope -k -b -q11891189+ cmd_cscope = cscope -b1214119012151191cscope: FORCE12161192 $(call cmd,cscope-file)12171193 $(call cmd,cscope)1218119412191195quiet_cmd_TAGS = MAKE $@12201220-cmd_TAGS = $(all-sources) | etags -11961196+define cmd_TAGS11971197+ rm -f $@; \11981198+ ETAGSF=`etags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL --extra=+f"`; \11991199+ $(all-sources) | xargs etags $$ETAGSF -a12001200+endef1221120112221222-# Exuberant ctags works better with -I12021202+TAGS: FORCE12031203+ $(call cmd,TAGS)12041204+1223120512241206quiet_cmd_tags = MAKE $@12251207define cmd_tags···12391197 CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL --extra=+f"`; \12401198 $(all-sources) | xargs ctags $$CTAGSF -a12411199endef12421242-12431243-TAGS: FORCE12441244- $(call cmd,TAGS)1245120012461201tags: FORCE12471202 $(call cmd,tags)···13071268 include $(cmd_files)13081269endif1309127013101310-# Execute command and generate cmd file13111311-if_changed = $(if $(strip $? \13121312- $(filter-out $(cmd_$(1)),$(cmd_$@))\13131313- $(filter-out $(cmd_$@),$(cmd_$(1)))),\13141314- @set -e; \13151315- $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \13161316- $(cmd_$(1)); \13171317- echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd)13181318-13191319-13201320-# execute the command and also postprocess generated .d dependencies13211321-# file13221322-if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\13231323- $(filter-out $(cmd_$(1)),$(cmd_$@))\13241324- $(filter-out $(cmd_$@),$(cmd_$(1)))),\13251325- $(Q)set -e; \13261326- $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \13271327- $(cmd_$(1)); \13281328- scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \13291329- rm -f $(depfile); \13301330- mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd)13311331-13321332-# Usage: $(call if_changed_rule,foo)13331333-# will check if $(cmd_foo) changed, or any of the prequisites changed,13341334-# and if so will execute $(rule_foo)13351335-13361336-if_changed_rule = $(if $(strip $? \13371337- $(filter-out $(cmd_$(1)),$(cmd_$(@F)))\13381338- $(filter-out $(cmd_$(@F)),$(cmd_$(1)))),\13391339- $(Q)$(rule_$(1)))13401340-13411341-# If quiet is set, only print short version of command13421342-13431343-cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))13441344-13451345-# filechk is used to check if the content of a generated file is updated.13461346-# Sample usage:13471347-# define filechk_sample13481348-# echo $KERNELRELEASE13491349-# endef13501350-# version.h : Makefile13511351-# $(call filechk,sample)13521352-# The rule defined shall write to stdout the content of the new file.13531353-# The existing file will be compared with the new one.13541354-# - If no file exist it is created13551355-# - If the content differ the new file is used13561356-# - If they are equal no change, and no timestamp update13571357-13581358-define filechk13591359- @set -e; \13601360- echo ' CHK $@'; \13611361- mkdir -p $(dir $@); \13621362- $(filechk_$(1)) < $< > $@.tmp; \13631363- if [ -r $@ ] && cmp -s $@ $@.tmp; then \13641364- rm -f $@.tmp; \13651365- else \13661366- echo ' UPD $@'; \13671367- mv -f $@.tmp $@; \13681368- fi13691369-endef13701370-13711371-# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=dir13721372-# Usage:13731373-# $(Q)$(MAKE) $(build)=dir13741374-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj13751375-13761271# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir13771272# Usage:13781273# $(Q)$(MAKE) $(clean)=dir13791274clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj13801380-13811381-# $(call descend,<dir>,<target>)13821382-# Recursively call a sub-make in <dir> with target <target>13831383-# Usage is deprecated, because make does not see this as an invocation of make.13841384-descend =$(Q)$(MAKE) -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj=$(1) $(2)1385127513861276endif # skip-makefile13871277
···408408 "real" root file system, etc. See <file:Documentation/initrd.txt>409409 for details.410410411411-config INITRAMFS_SOURCE412412- string "Initramfs source file(s)"413413- default ""414414- help415415- This can be either a single cpio archive with a .cpio suffix or a416416- space-separated list of directories and files for building the417417- initramfs image. A cpio archive should contain a filesystem archive418418- to be used as an initramfs image. Directories should contain a419419- filesystem layout to be included in the initramfs image. Files420420- should contain entries according to the format described by the421421- "usr/gen_init_cpio" program in the kernel tree.422422-423423- When multiple directories and files are specified then the424424- initramfs image will be the aggregate of all of them.425425-426426- See <file:Documentation/early-userspace/README for more details.427427-428428- If you are not sure, leave it blank.429429-430430-config INITRAMFS_ROOT_UID431431- int "User ID to map to 0 (user root)"432432- depends on INITRAMFS_SOURCE!=""433433- default "0"434434- help435435- This setting is only meaningful if the INITRAMFS_SOURCE is436436- contains a directory. Setting this user ID (UID) to something437437- other than "0" will cause all files owned by that UID to be438438- owned by user root in the initial ramdisk image.439439-440440- If you are not sure, leave it set to "0".441441-442442-config INITRAMFS_ROOT_GID443443- int "Group ID to map to 0 (group root)"444444- depends on INITRAMFS_SOURCE!=""445445- default "0"446446- help447447- This setting is only meaningful if the INITRAMFS_SOURCE is448448- contains a directory. Setting this group ID (GID) to something449449- other than "0" will cause all files owned by that GID to be450450- owned by group root in the initial ramdisk image.451451-452452- If you are not sure, leave it set to "0".453411454412#XXX - it makes sense to enable this only for 32-bit subarch's, not for x86_64455413#for instance.
+9
include/asm-generic/vmlinux.lds.h
···66#define VMLINUX_SYMBOL(_sym_) _sym_77#endif8899+/* Align . to a 8 byte boundary equals to maximum function alignment. */1010+#define ALIGN_FUNCTION() . = ALIGN(8)1111+912#define RODATA \1013 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \1114 *(.rodata) *(.rodata.*) \···8279 VMLINUX_SYMBOL(__security_initcall_end) = .; \8380 }84818282+/* sched.text is aling to function alignment to secure we have same8383+ * address even at second ld pass when generating System.map */8584#define SCHED_TEXT \8585+ ALIGN_FUNCTION(); \8686 VMLINUX_SYMBOL(__sched_text_start) = .; \8787 *(.sched.text) \8888 VMLINUX_SYMBOL(__sched_text_end) = .;89899090+/* spinlock.text is aling to function alignment to secure we have same9191+ * address even at second ld pass when generating System.map */9092#define LOCK_TEXT \9393+ ALIGN_FUNCTION(); \9194 VMLINUX_SYMBOL(__lock_text_start) = .; \9295 *(.spinlock.text) \9396 VMLINUX_SYMBOL(__lock_text_end) = .;
+20-2
init/Kconfig
···7777 object and source tree, in that order. Your total string can7878 be a maximum of 64 characters.79798080+config LOCALVERSION_AUTO8181+ bool "Automatically append version information to the version string"8282+ default y8383+ help8484+ This will try to automatically determine if the current tree is a8585+ release tree by looking for git tags that8686+ belong to the current top of tree revision.8787+8888+ A string of the format -gxxxxxxxx will be added to the localversion8989+ if a git based tree is found. The string generated by this will be9090+ appended after any matching localversion* files, and after the value9191+ set in CONFIG_LOCALVERSION9292+9393+ Note: This requires Perl, and a git repository, but not necessarily9494+ the git or cogito tools to be installed.9595+8096config SWAP8197 bool "Support for paging of anonymous memory (swap)"8298 depends on MMU···254238255239 Say N if unsure.256240241241+source "usr/Kconfig"242242+257243menuconfig EMBEDDED258244 bool "Configure standard kernel features (for small systems)"259245 help···278260 help279261 Normally kallsyms only contains the symbols of functions, for nicer280262 OOPS messages. Some debuggers can use kallsyms for other281281- symbols too: say Y here to include all symbols, and you282282- don't care about adding 300k to the size of your kernel.263263+ symbols too: say Y here to include all symbols, if you need them 264264+ and you don't care about adding 300k to the size of your kernel.283265284266 Say N.285267
···11+####22+# kbuild: Generic definitions33+44+# Convinient variables55+comma := ,66+empty :=77+space := $(empty) $(empty)88+99+###1010+# The temporary file to save gcc -MD generated dependencies must not1111+# contain a comma1212+depfile = $(subst $(comma),_,$(@D)/.$(@F).d)1313+1414+###1515+# filechk is used to check if the content of a generated file is updated.1616+# Sample usage:1717+# define filechk_sample1818+# echo $KERNELRELEASE1919+# endef2020+# version.h : Makefile2121+# $(call filechk,sample)2222+# The rule defined shall write to stdout the content of the new file.2323+# The existing file will be compared with the new one.2424+# - If no file exist it is created2525+# - If the content differ the new file is used2626+# - If they are equal no change, and no timestamp update2727+# - stdin is piped in from the first prerequisite ($<) so one has2828+# to specify a valid file as first prerequisite (often the kbuild file)2929+define filechk3030+ $(Q)set -e; \3131+ echo ' CHK $@'; \3232+ mkdir -p $(dir $@); \3333+ $(filechk_$(1)) < $< > $@.tmp; \3434+ if [ -r $@ ] && cmp -s $@ $@.tmp; then \3535+ rm -f $@.tmp; \3636+ else \3737+ echo ' UPD $@'; \3838+ mv -f $@.tmp $@; \3939+ fi4040+endef4141+4242+###4343+# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=4444+# Usage:4545+# $(Q)$(MAKE) $(build)=dir4646+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj4747+4848+# If quiet is set, only print short version of command4949+cmd = @$(if $($(quiet)cmd_$(1)),\5050+ echo ' $(subst ','\'',$($(quiet)cmd_$(1)))' &&) $(cmd_$(1))5151+5252+###5353+# if_changed - execute command if any prerequisite is newer than 5454+# target, or command line has changed5555+# if_changed_dep - as if_changed, but uses fixdep to reveal dependencies5656+# including used config symbols5757+# if_changed_rule - as if_changed but execute rule instead5858+# See Documentation/kbuild/makefiles.txt for more info5959+6060+ifneq ($(KBUILD_NOCMDDEP),1)6161+# Check if both arguments has same arguments. Result in empty string if equal6262+# User may override this check using make KBUILD_NOCMDDEP=16363+arg-check = $(strip $(filter-out $(1), $(2)) $(filter-out $(2), $(1)) )6464+endif6565+6666+# echo command. Short version is $(quiet) equals quiet, otherwise full command6767+echo-cmd = $(if $($(quiet)cmd_$(1)), \6868+ echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';)6969+7070+# function to only execute the passed command if necessary7171+# >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file7272+# note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars7373+# 7474+if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \7575+ @set -e; \7676+ $(echo-cmd) \7777+ $(cmd_$(1)); \7878+ echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd)7979+8080+# execute the command and also postprocess generated .d dependencies8181+# file8282+if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\8383+ $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \8484+ @set -e; \8585+ $(echo-cmd) \8686+ $(cmd_$(1)); \8787+ scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \8888+ rm -f $(depfile); \8989+ mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd)9090+9191+# Usage: $(call if_changed_rule,foo)9292+# will check if $(cmd_foo) changed, or any of the prequisites changed,9393+# and if so will execute $(rule_foo)9494+if_changed_rule = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\9595+ @set -e; \9696+ $(rule_$(1)))
···77.PHONY: __clean88__clean:991010-include $(if $(wildcard $(obj)/Kbuild), $(obj)/Kbuild, $(obj)/Makefile)1010+# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir1111+# Usage:1212+# $(Q)$(MAKE) $(clean)=dir1313+clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj1414+1515+# The filename Kbuild has precedence over Makefile1616+kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))1717+include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)11181219# Figure out what we need to build from the various variables1320# ==========================================================================···9487# If quiet is set, only print short version of command95889689cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))9797-9898-# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir9999-# Usage:100100-# $(Q)$(MAKE) $(clean)=dir101101-clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
···11-# ===========================================================================22-# kbuild: Generic definitions33-# ===========================================================================44-55-# Standard vars66-77-comma := ,88-empty :=99-space := $(empty) $(empty)1010-111# Backward compatibility - to be removed...122extra-y += $(EXTRA_TARGETS)133# Figure out what we need to build from the various variables···7383multi-objs-m := $(addprefix $(obj)/,$(multi-objs-m))7484subdir-ym := $(addprefix $(obj)/,$(subdir-ym))7585obj-dirs := $(addprefix $(obj)/,$(obj-dirs))7676-7777-# The temporary file to save gcc -MD generated dependencies must not7878-# contain a comma7979-depfile = $(subst $(comma),_,$(@D)/.$(@F).d)80868187# These flags are needed for modversions and compiling, so we define them here8288# already···165179quiet_cmd_gzip = GZIP $@166180cmd_gzip = gzip -f -9 < $< > $@167181168168-# ===========================================================================169169-# Generic stuff170170-# ===========================================================================171171-172172-ifneq ($(KBUILD_NOCMDDEP),1)173173-# Check if both arguments has same arguments. Result in empty string if equal174174-# User may override this check using make KBUILD_NOCMDDEP=1175175-arg-check = $(strip $(filter-out $(1), $(2)) $(filter-out $(2), $(1)) )176176-177177-endif178178-179179-# echo command. Short version is $(quiet) equals quiet, otherwise full command180180-echo-cmd = $(if $($(quiet)cmd_$(1)), \181181- echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';)182182-183183-# function to only execute the passed command if necessary184184-# >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file185185-# note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars186186-# 187187-if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \188188- @set -e; \189189- $(echo-cmd) \190190- $(cmd_$(1)); \191191- echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd)192192-193193-194194-# execute the command and also postprocess generated .d dependencies195195-# file196196-197197-if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\198198- $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \199199- @set -e; \200200- $(echo-cmd) \201201- $(cmd_$(1)); \202202- scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \203203- rm -f $(depfile); \204204- mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd)205205-206206-# Usage: $(call if_changed_rule,foo)207207-# will check if $(cmd_foo) changed, or any of the prequisites changed,208208-# and if so will execute $(rule_foo)209209-210210-if_changed_rule = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\211211- @set -e; \212212- $(rule_$(1)))213213-214214-# If quiet is set, only print short version of command215215-216216-cmd = @$(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))' &&) $(cmd_$(1))217217-218218-# $(call descend,<dir>,<target>)219219-# Recursively call a sub-make in <dir> with target <target> 220220-# Usage is deprecated, because make do not see this as an invocation of make.221221-descend =$(Q)$(MAKE) -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj=$(1) $(2)222222-223223-# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=224224-# Usage:225225-# $(Q)$(MAKE) $(build)=dir226226-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj227227-228228-# filechk is used to check if the content of a generated file is updated.229229-# Sample usage:230230-# define filechk_sample231231-# echo $KERNELRELEASE232232-# endef233233-# version.h : Makefile234234-# $(call filechk,sample)235235-# The rule defined shall write to stdout the content of the new file.236236-# The existing file will be compared with the new one.237237-# - If no file exist it is created238238-# - If the content differ the new file is used239239-# - If they are equal no change, and no timestamp update240240-241241-define filechk242242- $(Q)set -e; \243243- echo ' CHK $@'; \244244- mkdir -p $(dir $@); \245245- $(filechk_$(1)) $(2) > $@.tmp; \246246- if [ -r $@ ] && cmp -s $@ $@.tmp; then \247247- rm -f $@.tmp; \248248- else \249249- echo ' UPD $@'; \250250- mv -f $@.tmp $@; \251251- fi252252-endef253182
···16651665}1666166616671667sub process_file($) {16681668- my ($file) = "$ENV{'SRCTREE'}@_";16681668+ my $file;16691669 my $identifier;16701670 my $func;16711671 my $initial_section_counter = $section_counter;1672167216731673+ if (defined($ENV{'SRCTREE'})) {16741674+ $file = "$ENV{'SRCTREE'}" . "/" . "@_";16751675+ }16761676+ else {16771677+ $file = "@_";16781678+ }16731679 if (defined($source_map{$file})) {16741680 $file = $source_map{$file};16751681 }
+1-1
scripts/lxdialog/dialog.h
···163163int dialog_checklist (const char *title, const char *prompt, int height,164164 int width, int list_height, int item_no,165165 const char * const * items, int flag);166166-extern unsigned char dialog_input_result[];166166+extern char dialog_input_result[];167167int dialog_inputbox (const char *title, const char *prompt, int height,168168 int width, const char *init);169169
+2-2
scripts/lxdialog/inputbox.c
···21212222#include "dialog.h"23232424-unsigned char dialog_input_result[MAX_LEN + 1];2424+char dialog_input_result[MAX_LEN + 1];25252626/*2727 * Print the termination buttons···4848{4949 int i, x, y, box_y, box_x, box_width;5050 int input_x = 0, scroll = 0, key = 0, button = -1;5151- unsigned char *instr = dialog_input_result;5151+ char *instr = dialog_input_result;5252 WINDOW *dialog;53535454 /* center dialog box on screen */
+8-4
scripts/mkcompile_h
···11TARGET=$122ARCH=$233SMP=$344-CC=$444+PREEMPT=$455+CC=$55667# If compile.h exists already and we don't own autoconf.h78# (i.e. we're not the same user who did make *config), don't···272628272928UTS_VERSION="#$VERSION"3030-if [ -n "$SMP" ] ; then UTS_VERSION="$UTS_VERSION SMP"; fi3131-UTS_VERSION="$UTS_VERSION `LC_ALL=C LANG=C date`"2929+CONFIG_FLAGS=""3030+if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi3131+if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi3232+UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS `LC_ALL=C LANG=C date`"32333334# Truncate to maximum length3435···4037# Generate a temporary compile.h41384239( echo /\* This file is auto generated, version $VERSION \*/4343-4040+ if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi4141+4442 echo \#define UTS_MACHINE \"$ARCH\"45434644 echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
+4-4
scripts/mod/sumversion.c
···252252}253253254254/* FIXME: Handle .s files differently (eg. # starts comments) --RR */255255-static int parse_file(const signed char *fname, struct md4_ctx *md)255255+static int parse_file(const char *fname, struct md4_ctx *md)256256{257257- signed char *file;257257+ char *file;258258 unsigned long i, len;259259260260 file = grab_file(fname, &len);···332332 Sum all files in the same dir or subdirs.333333 */334334 while ((line = get_next_line(&pos, file, flen)) != NULL) {335335- signed char* p = line;335335+ char* p = line;336336 if (strncmp(line, "deps_", sizeof("deps_")-1) == 0) {337337 check_files = 1;338338 continue;···458458 close(fd);459459}460460461461-static int strip_rcs_crap(signed char *version)461461+static int strip_rcs_crap(char *version)462462{463463 unsigned int len, full_len;464464
+19-5
scripts/package/Makefile
···5959 $(CONFIG_SHELL) $(MKSPEC) prebuilt > $@60606161binrpm-pkg: $(objtree)/binkernel.spec6262- $(MAKE)6262+ $(MAKE) KBUILD_SRC=6363 set -e; \6464 $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version6565 set -e; \···7474#7575.PHONY: deb-pkg7676deb-pkg:7777- $(MAKE)7777+ $(MAKE) KBUILD_SRC=7878 $(CONFIG_SHELL) $(srctree)/scripts/package/builddeb79798080clean-dirs += $(objtree)/debian/818182828383+# tarball targets8484+# ---------------------------------------------------------------------------8585+.PHONY: tar%pkg8686+tar%pkg:8787+ $(MAKE)8888+ $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@8989+9090+clean-dirs += $(objtree)/tar-install/9191+9292+8393# Help text displayed when executing 'make help'8494# ---------------------------------------------------------------------------8595help:8686- @echo ' rpm-pkg - Build the kernel as an RPM package'8787- @echo ' binrpm-pkg - Build an rpm package containing the compiled kernel & modules'8888- @echo ' deb-pkg - Build the kernel as an deb package'9696+ @echo ' rpm-pkg - Build the kernel as an RPM package'9797+ @echo ' binrpm-pkg - Build an rpm package containing the compiled kernel'9898+ @echo ' and modules'9999+ @echo ' deb-pkg - Build the kernel as an deb package'100100+ @echo ' tar-pkg - Build the kernel as an uncompressed tarball'101101+ @echo ' targz-pkg - Build the kernel as a gzip compressed tarball'102102+ @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball'89103
+50-6
scripts/package/builddeb
···1414# Some variables and settings used throughout the script1515version=$KERNELRELEASE1616tmpdir="$objtree/debian/tmp"1717+packagename=linux-$version1818+1919+if [ "$ARCH" == "um" ] ; then2020+ packagename=user-mode-linux-$version2121+fi17221823# Setup the directory structure1924rm -rf "$tmpdir"2025mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot"2626+if [ "$ARCH" == "um" ] ; then2727+ mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/share/doc/$packagename" "$tmpdir/usr/bin"2828+fi21292230# Build and install the kernel2323-cp System.map "$tmpdir/boot/System.map-$version"2424-cp .config "$tmpdir/boot/config-$version"2525-cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"3131+if [ "$ARCH" == "um" ] ; then3232+ $MAKE linux3333+ cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map"3434+ cp .config "$tmpdir/usr/share/doc/$packagename/config"3535+ gzip "$tmpdir/usr/share/doc/$packagename/config"3636+ cp $KBUILD_IMAGE "$tmpdir/usr/bin/linux-$version"3737+else 3838+ cp System.map "$tmpdir/boot/System.map-$version"3939+ cp .config "$tmpdir/boot/config-$version"4040+ cp $KBUILD_IMAGE "$tmpdir/boot/vmlinuz-$version"4141+fi26422743if grep -q '^CONFIG_MODULES=y' .config ; then2828- INSTALL_MOD_PATH="$tmpdir" make modules_install4444+ INSTALL_MOD_PATH="$tmpdir" make KBUILD_SRC= modules_install4545+ if [ "$ARCH" == "um" ] ; then4646+ mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/"4747+ rmdir "$tmpdir/lib/modules/$version"4848+ fi2949fi30503151# Install the maintainer scripts···7353EOF74547555# Generate a control file5656+if [ "$ARCH" == "um" ]; then5757+7658cat <<EOF > debian/control7759Source: linux7860Section: base···8260Maintainer: $name8361Standards-Version: 3.6.184628585-Package: linux-$version6363+Package: $packagename6464+Architecture: any6565+Description: User Mode Linux kernel, version $version6666+ User-mode Linux is a port of the Linux kernel to its own system call6767+ interface. It provides a kind of virtual machine, which runs Linux6868+ as a user process under another Linux kernel. This is useful for6969+ kernel development, sandboxes, jails, experimentation, and7070+ many other things.7171+ .7272+ This package contains the Linux kernel, modules and corresponding other7373+ files version $version7474+EOF7575+7676+else7777+cat <<EOF > debian/control7878+Source: linux7979+Section: base8080+Priority: optional8181+Maintainer: $name8282+Standards-Version: 3.6.18383+8484+Package: $packagename8685Architecture: any8786Description: Linux kernel, version $version8887 This package contains the Linux kernel, modules and corresponding other8989- files version $version.8888+ files version $version9089EOF9090+fi91919292# Fix some ownership and permissions9393chown -R root:root "$tmpdir"
+111
scripts/package/buildtar
···11+#!/bin/sh22+33+#44+# buildtar 0.0.355+#66+# (C) 2004-2005 by Jan-Benedict Glaw <jbglaw@lug-owl.de>77+#88+# This script is used to compile a tarball from the currently99+# prepared kernel. Based upon the builddeb script from1010+# Wichert Akkerman <wichert@wiggy.net>.1111+#1212+1313+set -e1414+1515+#1616+# Some variables and settings used throughout the script1717+#1818+version="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}${EXTRANAME}"1919+tmpdir="${objtree}/tar-install"2020+tarball="${objtree}/linux-${version}.tar"2121+2222+2323+#2424+# Figure out how to compress, if requested at all2525+#2626+case "${1}" in2727+ tar-pkg)2828+ compress="cat"2929+ file_ext=""3030+ ;;3131+ targz-pkg)3232+ compress="gzip -c9"3333+ file_ext=".gz"3434+ ;;3535+ tarbz2-pkg)3636+ compress="bzip2 -c9"3737+ file_ext=".bz2"3838+ ;;3939+ *)4040+ echo "Unknown tarball target \"${1}\" requested, please add it to ${0}." >&24141+ exit 14242+ ;;4343+esac4444+4545+4646+#4747+# Clean-up and re-create the temporary directory4848+#4949+rm -rf -- "${tmpdir}"5050+mkdir -p -- "${tmpdir}/boot"5151+5252+5353+#5454+# Try to install modules5555+#5656+if ! make INSTALL_MOD_PATH="${tmpdir}" modules_install; then5757+ echo "" >&25858+ echo "Ignoring error at module_install time, since that could be" >&25959+ echo "a result of missing local modutils/module-init-tools," >&26060+ echo "or you just didn't compile in module support at all..." >&26161+ echo "" >&26262+fi6363+6464+6565+#6666+# Install basic kernel files6767+#6868+cp -v -- System.map "${tmpdir}/boot/System.map-${version}"6969+cp -v -- .config "${tmpdir}/boot/config-${version}"7070+cp -v -- vmlinux "${tmpdir}/boot/vmlinux-${version}"7171+7272+7373+#7474+# Install arch-specific kernel image(s)7575+#7676+case "${ARCH}" in7777+ i386)7878+ [ -f arch/i386/boot/bzImage ] && cp -v -- arch/i386/boot/bzImage "${tmpdir}/boot/vmlinuz-${version}"7979+ ;;8080+ alpha)8181+ [ -f arch/alpha/boot/vmlinux.gz ] && cp -v -- arch/alpha/boot/vmlinux.gz "${tmpdir}/boot/vmlinuz-${version}"8282+ ;;8383+ vax)8484+ [ -f vmlinux.SYS ] && cp -v -- vmlinux.SYS "${tmpdir}/boot/vmlinux-${version}.SYS"8585+ [ -f vmlinux.dsk ] && cp -v -- vmlinux.dsk "${tmpdir}/boot/vmlinux-${version}.dsk"8686+ ;;8787+ *)8888+ [ -f "${KBUILD_IMAGE}" ] && cp -v -- "${KBUILD_IMAGE}" "${tmpdir}/boot/vmlinux-kbuild-${version}"8989+ echo "" >&29090+ echo '** ** ** WARNING ** ** **' >&29191+ echo "" >&29292+ echo "Your architecture did not define any architecture-dependant files" >&29393+ echo "to be placed into the tarball. Please add those to ${0} ..." >&29494+ echo "" >&29595+ sleep 59696+ ;;9797+esac9898+9999+100100+#101101+# Create the tarball102102+#103103+(104104+ cd "${tmpdir}"105105+ tar cf - . | ${compress} > "${tarball}${file_ext}"106106+)107107+108108+echo "Tarball successfully created in ${tarball}${file_ext}"109109+110110+exit 0111111+
···11+#!/usr/bin/perl22+# Copyright 2004 - Ryan Anderson <ryan@michonline.com> GPL v233+44+use strict;55+use warnings;66+use Digest::MD5;77+require 5.006;88+99+if (@ARGV != 1) {1010+ print <<EOT;1111+Usage: setlocalversion <srctree>1212+EOT1313+ exit(1);1414+}1515+1616+my ($srctree) = @ARGV;1717+chdir($srctree);1818+1919+my @LOCALVERSIONS = ();2020+2121+# We are going to use the following commands to try and determine if this2222+# repository is at a Version boundary (i.e, 2.6.10 vs 2.6.10 + some patches) We2323+# currently assume that all meaningful version boundaries are marked by a tag.2424+# We don't care what the tag is, just that something exists.2525+2626+# Git/Cogito store the top-of-tree "commit" in .git/HEAD2727+# A list of known tags sits in .git/refs/tags/2828+#2929+# The simple trick here is to just compare the two of these, and if we get a3030+# match, return nothing, otherwise, return a subset of the SHA-1 hash in3131+# .git/HEAD3232+3333+sub do_git_checks {3434+ open(H,"<.git/HEAD") or return;3535+ my $head = <H>;3636+ chomp $head;3737+ close(H);3838+3939+ opendir(D,".git/refs/tags") or return;4040+ foreach my $tagfile (grep !/^\.{1,2}$/, readdir(D)) {4141+ open(F,"<.git/refs/tags/" . $tagfile) or return;4242+ my $tag = <F>;4343+ chomp $tag;4444+ close(F);4545+ return if ($tag eq $head);4646+ }4747+ closedir(D);4848+4949+ push @LOCALVERSIONS, "g" . substr($head,0,8);5050+}5151+5252+if ( -d ".git") {5353+ do_git_checks();5454+}5555+5656+printf "-%s\n", join("-",@LOCALVERSIONS) if (scalar @LOCALVERSIONS > 0);
+46
usr/Kconfig
···11+#22+# Configuration for initramfs33+#44+55+config INITRAMFS_SOURCE66+ string "Initramfs source file(s)"77+ default ""88+ help99+ This can be either a single cpio archive with a .cpio suffix or a1010+ space-separated list of directories and files for building the1111+ initramfs image. A cpio archive should contain a filesystem archive1212+ to be used as an initramfs image. Directories should contain a1313+ filesystem layout to be included in the initramfs image. Files1414+ should contain entries according to the format described by the1515+ "usr/gen_init_cpio" program in the kernel tree.1616+1717+ When multiple directories and files are specified then the1818+ initramfs image will be the aggregate of all of them.1919+2020+ See <file:Documentation/early-userspace/README for more details.2121+2222+ If you are not sure, leave it blank.2323+2424+config INITRAMFS_ROOT_UID2525+ int "User ID to map to 0 (user root)"2626+ depends on INITRAMFS_SOURCE!=""2727+ default "0"2828+ help2929+ This setting is only meaningful if the INITRAMFS_SOURCE is3030+ contains a directory. Setting this user ID (UID) to something3131+ other than "0" will cause all files owned by that UID to be3232+ owned by user root in the initial ramdisk image.3333+3434+ If you are not sure, leave it set to "0".3535+3636+config INITRAMFS_ROOT_GID3737+ int "Group ID to map to 0 (group root)"3838+ depends on INITRAMFS_SOURCE!=""3939+ default "0"4040+ help4141+ This setting is only meaningful if the INITRAMFS_SOURCE is4242+ contains a directory. Setting this group ID (GID) to something4343+ other than "0" will cause all files owned by that GID to be4444+ owned by group root in the initial ramdisk image.4545+4646+ If you are not sure, leave it set to "0".