From patchwork Tue Feb 4 12:41:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 24097 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8A9D320445 for ; Tue, 4 Feb 2014 12:42:02 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id c9sf21009555qcz.1 for ; Tue, 04 Feb 2014 04:42:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=RIKdCGMyHVgp1HWdN1CJmEf/neQfjW7kbgyRLXRd4JM=; b=c68PSSlm5xDF4qqC1W3ud5z9qsoTKcUVxZZWCXBtjoZvEoct7d+3tlxstjHBkBQySg JGqswm2ibOv5a86mDQmmtaAjLnHVZxpnE8zol+AXTIiQtAz+LBchOhnczFcmd0h/0dX+ joYxGO3EdoplhD6pfEKrxafMJfJGHG2Tq9PJeTb1wKZcj/1Ko2JHvtOhcSlj0Wj4yv7O //1EnymGE24BdiVNIVjYSR4NWvKZXf2ALTF8Z4ZJrUo0qwKdf2NMsGey+YyrtkUHnKMy KfX5N8lfGUdDX6rlAYxrvZuLZd/r/sXxqp0AmsYzTXiRCGgG/1gDDOsMdHidMX30OIUe hXCg== X-Gm-Message-State: ALoCoQl9rjNOJH8hFTwK6OrQ1K5ESAGpBZ2r3DAgcynwV28do6zLpqiTdHbsY43PLgHVY5Bml2X8 X-Received: by 10.236.86.238 with SMTP id w74mr13083773yhe.23.1391517721502; Tue, 04 Feb 2014 04:42:01 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.240 with SMTP id b103ls2268502qge.57.gmail; Tue, 04 Feb 2014 04:42:01 -0800 (PST) X-Received: by 10.58.100.100 with SMTP id ex4mr32960586veb.2.1391517721422; Tue, 04 Feb 2014 04:42:01 -0800 (PST) Received: from mail-vb0-f51.google.com (mail-vb0-f51.google.com [209.85.212.51]) by mx.google.com with ESMTPS id d11si8101898vcd.92.2014.02.04.04.42.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 04:42:01 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.51 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.51; Received: by mail-vb0-f51.google.com with SMTP id 11so5646222vbe.38 for ; Tue, 04 Feb 2014 04:42:01 -0800 (PST) X-Received: by 10.220.95.139 with SMTP id d11mr9098072vcn.21.1391517721312; Tue, 04 Feb 2014 04:42:01 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp231384vcz; Tue, 4 Feb 2014 04:42:00 -0800 (PST) X-Received: by 10.68.194.97 with SMTP id hv1mr9320002pbc.162.1391517720321; Tue, 04 Feb 2014 04:42:00 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ds4si24494048pbb.319.2014.02.04.04.41.59; Tue, 04 Feb 2014 04:41:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753934AbaBDMl6 (ORCPT + 9 others); Tue, 4 Feb 2014 07:41:58 -0500 Received: from mail-wg0-f52.google.com ([74.125.82.52]:62917 "EHLO mail-wg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbaBDMl5 (ORCPT ); Tue, 4 Feb 2014 07:41:57 -0500 Received: by mail-wg0-f52.google.com with SMTP id b13so12821833wgh.19 for ; Tue, 04 Feb 2014 04:41:56 -0800 (PST) X-Received: by 10.180.94.67 with SMTP id da3mr12683178wib.38.1391517716816; Tue, 04 Feb 2014 04:41:56 -0800 (PST) Received: from trevor.secretlab.ca (host81-147-189-92.range81-147.btcentralplus.com. [81.147.189.92]) by mx.google.com with ESMTPSA id ff7sm1521008wic.10.2014.02.04.04.41.54 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 04:41:55 -0800 (PST) Received: by trevor.secretlab.ca (Postfix, from userid 1000) id 8057CC407C9; Tue, 4 Feb 2014 12:41:50 +0000 (GMT) From: Grant Likely To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Jason Cooper , Grant Likely , Michal Marek , Russell King , Rob Herring Subject: [PATCH] kbuild: dtbs_install: new make target Date: Tue, 4 Feb 2014 12:41:40 +0000 Message-Id: <1391517700-13103-1-git-send-email-grant.likely@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <20140110182923.GM19878@titan.lakedaemon.net> References: <20140110182923.GM19878@titan.lakedaemon.net> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: grant.likely@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.51 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Jason Cooper 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 Signed-off-by: Grant Likely Cc: Michal Marek Cc: Russell King Cc: Rob Herring --- Makefile | 7 +++++++ arch/arm/Makefile | 7 ++++--- arch/arm/boot/dts/Makefile | 4 +++- scripts/Makefile.lib | 12 ++++++++++++ 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 export INSTALL_PATH ?= /boot # +# INSTALL_DTBS_PATH specifies a prefix for relocations required by build roots. +# Like INSTALL_MOD_PATH, it isn't defined in the Makefile, but can be passed as +# an argument if needed. Otherwise it defaults to the kernel install path +# +export INSTALL_DTBS_PATH ?= $(INSTALL_PATH)/dtbs/$(KERNELRELEASE) + +# # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory # relocations required by build roots. This is not defined in the # 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): %.dtb: | scripts $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@ -PHONY += dtbs -dtbs: scripts - $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) dtbs +PHONY += dtbs dtbs_install +dtbs dtbs_install: prepare scripts + $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $@ # We use MRPROPER_FILES and CLEAN_FILES now archclean: @@ -331,6 +331,7 @@ define archhelp echo ' bootpImage - Combined zImage and initial RAM disk' echo ' (supply initrd image via make variable INITRD=)' echo '* dtbs - Build device tree blobs for enabled boards' + echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)' echo ' install - Install uncompressed kernel' echo ' zinstall - Install compressed kernel' 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 \ zynq-zc706.dtb \ zynq-zed.dtb -targets += dtbs +targets += dtbs dtbs_install targets += $(dtb-y) endif @@ -331,3 +331,5 @@ dtbs: $(addprefix $(obj)/, $(dtb-y)) $(Q)rm -f $(obj)/../*.dtb clean-files := *.dtb + +dtbs_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 dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) +# Helper targets for Installing DTBs into the boot directory +quiet_cmd_dtb_install = INSTALL $< + cmd_dtb_install = cp $< $(2) + +_dtbinst_pre_: + $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi + $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi + $(Q)mkdir -p $(INSTALL_DTBS_PATH) + +%.dtb_dtbinst_: $(obj)/%.dtb _dtbinst_pre_ + $(call cmd,dtb_install,$(INSTALL_DTBS_PATH)) + # Bzip2 # ---------------------------------------------------------------------------