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 18 17 dst := $(INSTALL_DTBS_PATH) !! 19 include include/config/auto.conf 18 !! 20 include scripts/Kbuild.include 19 quiet_cmd_dtb_install = INSTALL $@ !! 21 include $(src)/Makefile 20 cmd_dtb_install = install -D -m 0644 $< << 21 22 22 $(dst)/%: $(obj)/% !! 23 PHONY += __dtbs_install_prep 23 $(call cmd,dtb_install) !! 24 __dtbs_install_prep: >> 25 ifeq ("$(dtbinst-root)", "$(obj)") >> 26 $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi >> 27 $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi >> 28 $(Q)mkdir -p $(INSTALL_DTBS_PATH) >> 29 endif 24 30 25 dtbs := $(patsubst $(obj)/%,%,$(call read-file !! 31 dtbinst-files := $(dtb-y) >> 32 dtbinst-dirs := $(dts-dirs) 26 33 27 ifdef CONFIG_ARCH_WANT_FLAT_DTB_INSTALL !! 34 # Helper targets for Installing DTBs into the boot directory >> 35 quiet_cmd_dtb_install = INSTALL $< >> 36 cmd_dtb_install = mkdir -p $(2); cp $< $(2) 28 37 29 define gen_install_rules !! 38 install-dir = $(patsubst $(dtbinst-root)%,$(INSTALL_DTBS_PATH)%,$(obj)) 30 $(dst)/%: $(obj)/$(1)% << 31 $$(call cmd,dtb_install) << 32 endef << 33 39 34 $(foreach d, $(sort $(dir $(dtbs))), $(eval $( !! 40 $(dtbinst-files) $(dtbinst-dirs): | __dtbs_install_prep 35 41 36 dtbs := $(notdir $(dtbs)) !! 42 $(dtbinst-files): %.dtb: $(obj)/%.dtb >> 43 $(call cmd,dtb_install,$(install-dir)) 37 44 38 endif # CONFIG_ARCH_WANT_FLAT_DTB_INSTALL !! 45 $(dtbinst-dirs): >> 46 $(Q)$(MAKE) $(dtbinst)=$(obj)/$@ 39 47 40 __dtbs_install: $(addprefix $(dst)/, $(dtbs)) !! 48 PHONY += $(dtbinst-files) $(dtbinst-dirs) 41 @: !! 49 __dtbs_install: $(dtbinst-files) $(dtbinst-dirs) 42 50 43 .PHONY: $(PHONY) 51 .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.