From patchwork Tue Nov 19 21:27:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Cooper X-Patchwork-Id: 3204111 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C38499F243 for ; Tue, 19 Nov 2013 21:29:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D19D7204E2 for ; Tue, 19 Nov 2013 21:29:19 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8BAE120522 for ; Tue, 19 Nov 2013 21:29:18 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Visqm-0002j4-8h; Tue, 19 Nov 2013 21:28:48 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Visqf-0003Pm-UP; Tue, 19 Nov 2013 21:28:41 +0000 Received: from mho-03-ewr.mailhop.org ([204.13.248.66] helo=mho-01-ewr.mailhop.org) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VisqV-0003Mo-1p for linux-arm-kernel@lists.infradead.org; Tue, 19 Nov 2013 21:28:34 +0000 Received: from pool-108-39-110-144.nrflva.fios.verizon.net ([108.39.110.144] helo=titan) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Visq7-000GTl-Mh; Tue, 19 Nov 2013 21:28:07 +0000 Received: from triton.localdomain (omega.lakedaemon.net [10.16.5.5]) by titan (Postfix) with ESMTP id C4C7F4DB7D8; Tue, 19 Nov 2013 16:28:04 -0500 (EST) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 108.39.110.144 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX180E0gWTFTNk8BiRf6+8REjmfnZpnF2GgE= From: Jason Cooper To: Rob Herring , Pawel Moll , Mark Rutland , Stephen Warren , Ian Campbell , Olof Johansson Subject: [PATCH V4] kbuild: dtbs_install: new make target Date: Tue, 19 Nov 2013 21:27:55 +0000 Message-Id: <1384896475-8744-1-git-send-email-jason@lakedaemon.net> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1384201760-16785-1-git-send-email-jason@lakedaemon.net> References: <1384201760-16785-1-git-send-email-jason@lakedaemon.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131119_162831_348189_DD847D58 X-CRM114-Status: GOOD ( 15.81 ) X-Spam-Score: -1.9 (-) Cc: devicetree@vger.kernel.org, Jason Cooper , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Unlike other build products in the Linux kernel, there is no 'make *install' mechanism to put devicetree blobs in a standard place. This patch is an attempt to fix this problem. Akin to 'make install', this creates a new make target, dtbs_install. The script that gets called defers to a distribution or user supplied installdtbs binary, if found in the system. Otherwise, the default action is to install a given dtb into /lib/modules/${kernel_version}/devicetree/${dts_filename}.dtb 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. Signed-off-by: Jason Cooper --- Question: should I make a note about the filenames not being considered an ABI, or just let it be? changes since v3: - drop renaming files to ${compat}.dtb (rmk/swarren) - move installdtbs.sh to ./scripts/ (gcl) changes since v2: - use fdtget instead of a modified dtc to get the board compat string changes since v1: - added this patch Makefile | 3 ++- arch/arm/Makefile | 4 ++++ scripts/installdtbs.sh | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 scripts/installdtbs.sh diff --git a/Makefile b/Makefile index 920ad07180c9..29d609e972d6 100644 --- a/Makefile +++ b/Makefile @@ -339,6 +339,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump AWK = awk GENKSYMS = scripts/genksyms/genksyms INSTALLKERNEL := installkernel +INSTALLDTBS := installdtbs DEPMOD = /sbin/depmod PERL = perl CHECK = sparse @@ -391,7 +392,7 @@ KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(S export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC export CPP AR NM STRIP OBJCOPY OBJDUMP -export MAKE AWK GENKSYMS INSTALLKERNEL PERL UTS_MACHINE +export MAKE AWK GENKSYMS INSTALLKERNEL INSTALLDTBS PERL UTS_MACHINE export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS diff --git a/arch/arm/Makefile b/arch/arm/Makefile index c99b1086d83d..6c7abfc5eb5e 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -314,6 +314,10 @@ PHONY += dtbs dtbs: scripts $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) dtbs +dtbs_install: dtbs + $(CONFIG_SHELL) $(srctree)/scripts/installdtbs.sh $(KERNELRELEASE) \ + "$(MODLIB)/devicetree" "$(srctree)/$(boot)/dts" + # We use MRPROPER_FILES and CLEAN_FILES now archclean: $(Q)$(MAKE) $(clean)=$(boot) diff --git a/scripts/installdtbs.sh b/scripts/installdtbs.sh new file mode 100644 index 000000000000..11027f00c3a4 --- /dev/null +++ b/scripts/installdtbs.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# This file is subject to the terms and conditions of the GNU General Public +# License. See the file "COPYING" in the main directory of this archive +# for more details. +# +# Copyright (C) 1995 by Linus Torvalds +# +# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin +# +# Further adapted from arch/x86/boot/install.sh by Jason Cooper +# +# "make dtbs_install" script +# +# Arguments: +# $1 - kernel version +# $2 - default install path (blank if root directory) +# $3 - directory containing dtbs +# + +# User may have a custom install script + +if [ -x ~/bin/${INSTALLDTBS} ]; then exec ~/bin/${INSTALLDTBS} "$@"; fi +if [ -x /sbin/${INSTALLDTBS} ]; then exec /sbin/${INSTALLDTBS} "$@"; fi + +# Default install +[ -d "$2" ] && rm -rf "$2" + +mkdir -p "$2" + +for dtb in `find "$3" -name "*.dtb"`; do + cp "$dtb" "$2/${dtb##*/}" +done