aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Cooper <jason@lakedaemon.net>2013-12-01 18:56:28 -0500
committerGrant Likely <grant.likely@linaro.org>2014-02-20 10:53:39 -0500
commitf4d4ffc03efc864645b990e1d579bbe1b8e358a4 (patch)
tree6251d7baf9fb1e92e0712611319ff10118c9311e
parentc8a4c63f8c136d3368625d640f2dd1cb505f1fea (diff)
kbuild: dtbs_install: new make target
Unlike other build products in the Linux kernel, there is no 'make *install' mechanism to put devicetree blobs in a standard place. This commit adds a new 'dtbs_install' make target which copies all of the dtbs into the INSTALL_DTBS_PATH directory. INSTALL_DTBS_PATH can be set before calling make to change the default install directory. If not set then it defaults to: $INSTALL_PATH/dtbs/$KERNELRELEASE. This is done to keep dtbs from different kernel versions separate until things have settled down. Once the dtbs are stable, and not so strongly linked to the kernel version, the devicetree files will most likely move to their own repo. Users will need to upgrade install scripts at that time. v7: (reworked by Grant Likely) - Moved rules from arch/arm/Makefile to arch/arm/boot/dts/Makefile so that each dtb install could have a separate target and be reported as part of the make output. - Fixed dependency problem to ensure $KERNELRELEASE is calculated before attempting to install - Removed option to call external script. Copying the files should be sufficient and a build system can post-process the install directory. Despite the fact an external script is used for installing the kernel, I don't think that is a pattern that should be encouraged. I would rather see buildroot type tools post process the install directory to rename or move dtb files after installing to a staging directory. - Plus it is easy to add a hook after the fact without blocking the rest of this feature. - Move the helper targets into scripts/Makefile.lib with the rest of the common dtb rules Signed-off-by: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Grant Likely <grant.likely@linaro.org> Cc: Michal Marek <mmarek@suse.cz> Cc: Russell King <linux@arm.linux.org.uk> Cc: Rob Herring <robh+dt@kernel.org>
-rw-r--r--Makefile7
-rw-r--r--arch/arm/Makefile7
-rw-r--r--arch/arm/boot/dts/Makefile4
-rw-r--r--scripts/Makefile.lib12
4 files changed, 26 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 606ef7c4a544..90556da6959d 100644
--- a/Makefile
+++ b/Makefile
@@ -727,6 +727,13 @@ export KBUILD_IMAGE ?= vmlinux
727export INSTALL_PATH ?= /boot 727export INSTALL_PATH ?= /boot
728 728
729# 729#
730# INSTALL_DTBS_PATH specifies a prefix for relocations required by build roots.
731# Like INSTALL_MOD_PATH, it isn't defined in the Makefile, but can be passed as
732# an argument if needed. Otherwise it defaults to the kernel install path
733#
734export INSTALL_DTBS_PATH ?= $(INSTALL_PATH)/dtbs/$(KERNELRELEASE)
735
736#
730# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory 737# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
731# relocations required by build roots. This is not defined in the 738# relocations required by build roots. This is not defined in the
732# makefile but the argument can be passed to make if needed. 739# makefile but the argument can be passed to make if needed.
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 08a9ef58d9c3..fddf4beaee45 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -310,9 +310,9 @@ $(INSTALL_TARGETS):
310%.dtb: | scripts 310%.dtb: | scripts
311 $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@ 311 $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
312 312
313PHONY += dtbs 313PHONY += dtbs dtbs_install
314dtbs: scripts 314dtbs dtbs_install: prepare scripts
315 $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) dtbs 315 $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $@
316 316
317# We use MRPROPER_FILES and CLEAN_FILES now 317# We use MRPROPER_FILES and CLEAN_FILES now
318archclean: 318archclean:
@@ -331,6 +331,7 @@ define archhelp
331 echo ' bootpImage - Combined zImage and initial RAM disk' 331 echo ' bootpImage - Combined zImage and initial RAM disk'
332 echo ' (supply initrd image via make variable INITRD=<path>)' 332 echo ' (supply initrd image via make variable INITRD=<path>)'
333 echo '* dtbs - Build device tree blobs for enabled boards' 333 echo '* dtbs - Build device tree blobs for enabled boards'
334 echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'
334 echo ' install - Install uncompressed kernel' 335 echo ' install - Install uncompressed kernel'
335 echo ' zinstall - Install compressed kernel' 336 echo ' zinstall - Install compressed kernel'
336 echo ' uinstall - Install U-Boot wrapped compressed kernel' 337 echo ' uinstall - Install U-Boot wrapped compressed kernel'
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index b9d6a8b485e0..649c8e345ac5 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -321,7 +321,7 @@ dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \
321 zynq-zc706.dtb \ 321 zynq-zc706.dtb \
322 zynq-zed.dtb 322 zynq-zed.dtb
323 323
324targets += dtbs 324targets += dtbs dtbs_install
325targets += $(dtb-y) 325targets += $(dtb-y)
326endif 326endif
327 327
@@ -331,3 +331,5 @@ dtbs: $(addprefix $(obj)/, $(dtb-y))
331 $(Q)rm -f $(obj)/../*.dtb 331 $(Q)rm -f $(obj)/../*.dtb
332 332
333clean-files := *.dtb 333clean-files := *.dtb
334
335dtbs_install: $(addsuffix _dtbinst_, $(dtb-y))
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 49392ecbef17..d0c17a55a2f5 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -273,6 +273,18 @@ $(obj)/%.dtb: $(src)/%.dts FORCE
273 273
274dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) 274dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
275 275
276# Helper targets for Installing DTBs into the boot directory
277quiet_cmd_dtb_install = INSTALL $<
278 cmd_dtb_install = cp $< $(2)
279
280_dtbinst_pre_:
281 $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi
282 $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi
283 $(Q)mkdir -p $(INSTALL_DTBS_PATH)
284
285%.dtb_dtbinst_: $(obj)/%.dtb _dtbinst_pre_
286 $(call cmd,dtb_install,$(INSTALL_DTBS_PATH))
287
276# Bzip2 288# Bzip2
277# --------------------------------------------------------------------------- 289# ---------------------------------------------------------------------------
278 290