1 # SPDX-License-Identifier: GPL-2.0 << 2 # ============================================ 1 # ========================================================================== 3 # Installing dtb files 2 # Installing dtb files 4 # 3 # 5 # Installs all dtb files listed in $(dtb-y) ei 4 # Installs all dtb files listed in $(dtb-y) either in the 6 # INSTALL_DTBS_PATH directory or the default l 5 # INSTALL_DTBS_PATH directory or the default location: 7 # 6 # 8 # $INSTALL_PATH/dtbs/$KERNELRELEASE 7 # $INSTALL_PATH/dtbs/$KERNELRELEASE >> 8 # >> 9 # Traverse through subdirectories listed in $(dts-dirs). 9 # ============================================ 10 # ========================================================================== 10 11 >> 12 src := $(obj) >> 13 11 PHONY := __dtbs_install 14 PHONY := __dtbs_install 12 __dtbs_install: 15 __dtbs_install: 13 16 14 include include/config/auto.conf !! 17 export dtbinst_root ?= $(obj) 15 include $(srctree)/scripts/Kbuild.include << 16 << 17 dst := $(INSTALL_DTBS_PATH) << 18 18 19 quiet_cmd_dtb_install = INSTALL $@ !! 19 include include/config/auto.conf 20 cmd_dtb_install = install -D -m 0644 $< !! 20 include scripts/Kbuild.include 21 !! 21 include $(src)/Makefile 22 $(dst)/%: $(obj)/% << 23 $(call cmd,dtb_install) << 24 << 25 dtbs := $(patsubst $(obj)/%,%,$(call read-file << 26 22 27 ifdef CONFIG_ARCH_WANT_FLAT_DTB_INSTALL !! 23 dtbinst-files := $(dtb-y) >> 24 dtbinst-dirs := $(dts-dirs) 28 25 29 define gen_install_rules !! 26 # Helper targets for Installing DTBs into the boot directory 30 $(dst)/%: $(obj)/$(1)% !! 27 quiet_cmd_dtb_install = INSTALL $< 31 $$(call cmd,dtb_install) !! 28 cmd_dtb_install = mkdir -p $(2); cp $< $(2) 32 endef << 33 29 34 $(foreach d, $(sort $(dir $(dtbs))), $(eval $( !! 30 install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj)) 35 31 36 dtbs := $(notdir $(dtbs)) !! 32 $(dtbinst-files): %.dtb: $(obj)/%.dtb >> 33 $(call cmd,dtb_install,$(install-dir)) 37 34 38 endif # CONFIG_ARCH_WANT_FLAT_DTB_INSTALL !! 35 $(dtbinst-dirs): >> 36 $(Q)$(MAKE) $(dtbinst)=$(obj)/$@ 39 37 40 __dtbs_install: $(addprefix $(dst)/, $(dtbs)) !! 38 PHONY += $(dtbinst-files) $(dtbinst-dirs) 41 @: !! 39 __dtbs_install: $(dtbinst-files) $(dtbinst-dirs) 42 40 43 .PHONY: $(PHONY) 41 .PHONY: $(PHONY)
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.