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: simplify dtbs_install by reading the list of compiled DTBs

Retrieve the list of *.dtb(o) files from arch/*/boot/dts/dtbs-list
instead of traversing the directory tree again.

Please note that 'make dtbs_install' installs *.dtb(o) files directly
added to dtb-y because scripts/Makefile.dtbinst installs $(dtb-y)
without expanding the -dtbs suffix.

This commit preserves this behavior.

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

+19 -21
+1 -1
Makefile
··· 1411 1411 dtbs_check: dtbs 1412 1412 1413 1413 dtbs_install: 1414 - $(Q)$(MAKE) $(dtbinst)=$(dtstree) dst=$(INSTALL_DTBS_PATH) 1414 + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.dtbinst obj=$(dtstree) 1415 1415 1416 1416 ifdef CONFIG_OF_EARLY_FLATTREE 1417 1417 all: dtbs
-6
scripts/Kbuild.include
··· 114 114 build := -f $(srctree)/scripts/Makefile.build obj 115 115 116 116 ### 117 - # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.dtbinst obj= 118 - # Usage: 119 - # $(Q)$(MAKE) $(dtbinst)=dir 120 - dtbinst := -f $(srctree)/scripts/Makefile.dtbinst obj 121 - 122 - ### 123 117 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj= 124 118 # Usage: 125 119 # $(Q)$(MAKE) $(clean)=dir
+18 -14
scripts/Makefile.dtbinst
··· 8 8 # $INSTALL_PATH/dtbs/$KERNELRELEASE 9 9 # ========================================================================== 10 10 11 - src := $(obj) 12 - 13 11 PHONY := __dtbs_install 14 12 __dtbs_install: 15 13 16 14 include include/config/auto.conf 17 15 include $(srctree)/scripts/Kbuild.include 18 - include $(kbuild-file) 19 16 20 - dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-))) 21 - subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m)) 22 - 23 - __dtbs_install: $(dtbs) $(subdirs) 24 - @: 17 + dst := $(INSTALL_DTBS_PATH) 25 18 26 19 quiet_cmd_dtb_install = INSTALL $@ 27 20 cmd_dtb_install = install -D $< $@ 28 21 29 - $(dst)/%.dtb: $(obj)/%.dtb 22 + $(dst)/%: $(obj)/% 30 23 $(call cmd,dtb_install) 31 24 32 - $(dst)/%.dtbo: $(obj)/%.dtbo 33 - $(call cmd,dtb_install) 25 + dtbs := $(patsubst $(obj)/%,%,$(call read-file, $(obj)/dtbs-list)) 34 26 35 - PHONY += $(subdirs) 36 - $(subdirs): 37 - $(Q)$(MAKE) $(dtbinst)=$@ dst=$(if $(CONFIG_ARCH_WANT_FLAT_DTB_INSTALL),$(dst),$(patsubst $(obj)/%,$(dst)/%,$@)) 27 + ifdef CONFIG_ARCH_WANT_FLAT_DTB_INSTALL 28 + 29 + define gen_install_rules 30 + $(dst)/%: $(obj)/$(1)% 31 + $$(call cmd,dtb_install) 32 + endef 33 + 34 + $(foreach d, $(sort $(dir $(dtbs))), $(eval $(call gen_install_rules,$(d)))) 35 + 36 + dtbs := $(notdir $(dtbs)) 37 + 38 + endif # CONFIG_ARCH_WANT_FLAT_DTB_INSTALL 39 + 40 + __dtbs_install: $(addprefix $(dst)/, $(dtbs)) 41 + @: 38 42 39 43 .PHONY: $(PHONY)