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

Configure Feed

Select the types of activity you want to include in your feed.

kbuild: create a list of all built DTB files

It is useful to have a list of all *.dtb and *.dtbo files generated
from the current build.

With this commit, 'make dtbs' creates arch/*/boot/dts/dtbs-list, which
lists the dtb(o) files created in the current build. It maintains the
order of the dtb-y additions in Makefiles although the order is not
important for DTBs. It is a (good) side effect through the reuse of the
modules.order rule.

Please note this list only includes the files directly added to dtb-y.

For example, consider this case:

foo-dtbs := foo_base.dtb foo_overlay.dtbo
dtb-y := foo.dtb

In this example, the list will include foo.dtb, but not foo_base.dtb
or foo_overlay.dtbo.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+21 -10
+1
.gitignore
··· 52 52 *.xz 53 53 *.zst 54 54 Module.symvers 55 + dtbs-list 55 56 modules.order 56 57 57 58 #
+2 -2
Makefile
··· 1393 1393 1394 1394 PHONY += dtbs dtbs_prepare dtbs_install dtbs_check 1395 1395 dtbs: dtbs_prepare 1396 - $(Q)$(MAKE) $(build)=$(dtstree) 1396 + $(Q)$(MAKE) $(build)=$(dtstree) need-dtbslist=1 1397 1397 1398 1398 # include/config/kernel.release is actually needed when installing DTBs because 1399 1399 # INSTALL_DTBS_PATH contains $(KERNELRELEASE). However, we do not want to make ··· 1932 1932 -o -name '*.ko.*' \ 1933 1933 -o -name '*.dtb' -o -name '*.dtbo' \ 1934 1934 -o -name '*.dtb.S' -o -name '*.dtbo.S' \ 1935 - -o -name '*.dt.yaml' \ 1935 + -o -name '*.dt.yaml' -o -name 'dtbs-list' \ 1936 1936 -o -name '*.dwo' -o -name '*.lst' \ 1937 1937 -o -name '*.su' -o -name '*.mod' \ 1938 1938 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
+12 -8
scripts/Makefile.build
··· 71 71 # subdir-builtin and subdir-modorder may contain duplications. Use $(sort ...) 72 72 subdir-builtin := $(sort $(filter %/built-in.a, $(real-obj-y))) 73 73 subdir-modorder := $(sort $(filter %/modules.order, $(obj-m))) 74 + subdir-dtbslist := $(sort $(filter %/dtbs-list, $(dtb-y))) 74 75 75 76 targets-for-builtin := $(extra-y) 76 77 ··· 389 388 # To build objects in subdirs, we need to descend into the directories 390 389 $(subdir-builtin): $(obj)/%/built-in.a: $(obj)/% ; 391 390 $(subdir-modorder): $(obj)/%/modules.order: $(obj)/% ; 391 + $(subdir-dtbslist): $(obj)/%/dtbs-list: $(obj)/% ; 392 392 393 393 # 394 394 # Rule to compile a set of .o files into one .a file (without symbol table) ··· 406 404 $(call if_changed,ar_builtin) 407 405 408 406 # 409 - # Rule to create modules.order file 407 + # Rule to create modules.order and dtbs-list 410 408 # 411 - # Create commands to either record .ko file or cat modules.order from 412 - # a subdirectory 413 - # Add $(obj-m) as the prerequisite to avoid updating the timestamp of 414 - # modules.order unless contained modules are updated. 409 + # This is a list of build artifacts (module or dtb) from the current Makefile 410 + # and its sub-directories. The timestamp should be updated when any of the 411 + # member files. 415 412 416 - cmd_modules_order = { $(foreach m, $(real-prereqs), \ 417 - $(if $(filter %/modules.order, $m), cat $m, echo $m);) :; } \ 413 + cmd_gen_order = { $(foreach m, $(real-prereqs), \ 414 + $(if $(filter %/$(notdir $@), $m), cat $m, echo $m);) :; } \ 418 415 > $@ 419 416 420 417 $(obj)/modules.order: $(obj-m) FORCE 421 - $(call if_changed,modules_order) 418 + $(call if_changed,gen_order) 419 + 420 + $(obj)/dtbs-list: $(dtb-y) FORCE 421 + $(call if_changed,gen_order) 422 422 423 423 # 424 424 # Rule to compile a set of .o files into one .a file (with symbol table)
+6
scripts/Makefile.lib
··· 45 45 obj-y := $(filter-out %/, $(obj-y)) 46 46 endif 47 47 48 + ifdef need-dtbslist 49 + dtb-y += $(addsuffix /dtbs-list, $(subdir-ym)) 50 + always-y += dtbs-list 51 + endif 52 + 48 53 # Expand $(foo-objs) $(foo-y) etc. by replacing their individuals 49 54 suffix-search = $(strip $(foreach s, $3, $($(1:%$(strip $2)=%$s)))) 50 55 # List composite targets that are constructed by combining other targets ··· 104 99 real-obj-y := $(addprefix $(obj)/,$(real-obj-y)) 105 100 real-obj-m := $(addprefix $(obj)/,$(real-obj-m)) 106 101 multi-obj-m := $(addprefix $(obj)/, $(multi-obj-m)) 102 + dtb-y := $(addprefix $(obj)/, $(dtb-y)) 107 103 multi-dtb-y := $(addprefix $(obj)/, $(multi-dtb-y)) 108 104 real-dtb-y := $(addprefix $(obj)/, $(real-dtb-y)) 109 105 subdir-ym := $(addprefix $(obj)/,$(subdir-ym))