From patchwork Tue Jan 21 13:50:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 23439 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f69.google.com (mail-pb0-f69.google.com [209.85.160.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D9C58203BE for ; Tue, 21 Jan 2014 13:50:29 +0000 (UTC) Received: by mail-pb0-f69.google.com with SMTP id md12sf8557481pbc.8 for ; Tue, 21 Jan 2014 05:50:29 -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=sWrvgbLJzGsTvm5xyvaH5up2bvmdDgTEPHZ+78htTS8=; b=X1qud8n7tOVM27uNUMBaVatfhhCJ7XFnL8stfCw9pqnyG9wf3zKebyPQSooZgvvR4E A/QmK96pOZnzNy1oojPDOvImlvcHHtQnE5ofdVZ7EuEo/PeWkoHEJurlQ9QgiFmWlNHZ EiVsPK0kTqpPBCp2HDD3jWWqDkrmzBVVxpUaN7iAsU9buoj233yvensw9nRRaUwxnLLR ph8dnl88WPX24+500DJ1PLszGewvwBs2uUBW3uzgb2j2QC2dhpdnXG13Vj/OtpASViK1 rycyDrnaC+eGTehlLysfOOrx+hVkDb0JAbPp1GJ80hJIJ4YShZfJ/b9SZ6iCOjoAXeM8 447Q== X-Gm-Message-State: ALoCoQkwL06naAYOFOYuV/NBWZ34GW0Dgce7RXpQqUP6FTxcYjanK73E69PurnH2kGEgC39eXiQy X-Received: by 10.66.149.67 with SMTP id ty3mr8524247pab.27.1390312228923; Tue, 21 Jan 2014 05:50:28 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.110 with SMTP id n101ls1257661qga.87.gmail; Tue, 21 Jan 2014 05:50:28 -0800 (PST) X-Received: by 10.58.66.137 with SMTP id f9mr9049526vet.11.1390312228763; Tue, 21 Jan 2014 05:50:28 -0800 (PST) Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53]) by mx.google.com with ESMTPS id vi9si2059369vec.94.2014.01.21.05.50.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Jan 2014 05:50:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.53 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.53; Received: by mail-vb0-f53.google.com with SMTP id p17so3445035vbe.26 for ; Tue, 21 Jan 2014 05:50:28 -0800 (PST) X-Received: by 10.220.174.200 with SMTP id u8mr14593534vcz.6.1390312228675; Tue, 21 Jan 2014 05:50:28 -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 u4csp118323vcz; Tue, 21 Jan 2014 05:50:28 -0800 (PST) X-Received: by 10.68.245.200 with SMTP id xq8mr24647822pbc.21.1390312227617; Tue, 21 Jan 2014 05:50:27 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7si5534447pbk.207.2014.01.21.05.50.26; Tue, 21 Jan 2014 05:50:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 S1754679AbaAUNuV (ORCPT + 27 others); Tue, 21 Jan 2014 08:50:21 -0500 Received: from mail-ee0-f43.google.com ([74.125.83.43]:47796 "EHLO mail-ee0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754658AbaAUNuO (ORCPT ); Tue, 21 Jan 2014 08:50:14 -0500 Received: by mail-ee0-f43.google.com with SMTP id c41so4068844eek.16 for ; Tue, 21 Jan 2014 05:50:13 -0800 (PST) X-Received: by 10.14.198.195 with SMTP id v43mr18534633een.62.1390312213369; Tue, 21 Jan 2014 05:50:13 -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 o47sm15031261eem.21.2014.01.21.05.50.11 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Jan 2014 05:50:12 -0800 (PST) Received: by trevor.secretlab.ca (Postfix, from userid 1000) id DB8CCC405D1; Tue, 21 Jan 2014 13:50:09 +0000 (GMT) From: Grant Likely To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Grant Likely Subject: [PATCH 3/3] scripts/dtc: Add a script to update to mainline dtc source Date: Tue, 21 Jan 2014 13:50:01 +0000 Message-Id: <1390312201-22754-4-git-send-email-grant.likely@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1390312201-22754-1-git-send-email-grant.likely@linaro.org> References: <1390312201-22754-1-git-send-email-grant.likely@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@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.53 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: , A very simple script that automates pulling in a newer version of DTC. Not particularly robust, but a whole lot better than doing it by hand every time. Signed-off-by: Grant Likely --- scripts/dtc/update-dtc-source.sh | 54 ++++++++++++++++++++++++++++++++++++++++ scripts/dtc/version_gen.h | 2 +- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100755 scripts/dtc/update-dtc-source.sh diff --git a/scripts/dtc/update-dtc-source.sh b/scripts/dtc/update-dtc-source.sh new file mode 100755 index 000000000000..feb01ef26be4 --- /dev/null +++ b/scripts/dtc/update-dtc-source.sh @@ -0,0 +1,54 @@ +#!/bin/sh +# Simple script to update the version of DTC carried by the Linux kernel +# +# This script assumes that the dtc and the linux git trees are in the +# same directory. After building dtc in the dtc directory, it copies the +# source files and generated source files into the scripts/dtc directory +# in the kernel and creates a git commit updating them to the new +# version. +# +# Usage: from the top level Linux source tree, run: +# $ ./scripts/dtc/update-dtc-source.sh +# +# The script will change into the dtc tree, build and test dtc, copy the +# relevant files into the kernel tree and create a git commit. The commit +# message will need to be modified to reflect the version of DTC being +# imported +# +# TODO: +# This script is pretty basic, but it is seldom used so a few manual tasks +# aren't a big deal. If anyone is interested in making it more robust, the +# the following would be nice: +# * Actually fail to complete if any testcase fails. +# - The dtc "make check" target needs to return a failure +# * Extract the version number from the dtc repo for the commit message +# * Build dtc in the kernel tree +# * run 'make check" on dtc built from the kernel tree + +set -ev + +DTC_UPSTREAM_PATH=`pwd`/../dtc +DTC_LINUX_PATH=`pwd`/scripts/dtc + +DTC_SOURCE="checks.c data.c dtc.c dtc.h flattree.c fstree.c livetree.c srcpos.c \ + srcpos.h treesource.c util.c util.h version_gen.h Makefile.dtc \ + dtc-lexer.l dtc-parser.y" +DTC_GENERATED="dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h" + +# Build DTC +cd $DTC_UPSTREAM_PATH +make clean +make check + +# Copy the files into the Linux tree +cd $DTC_LINUX_PATH +for f in $DTC_SOURCE; do + cp ${DTC_UPSTREAM_PATH}/${f} ${f} + git add ${f} +done +for f in $DTC_GENERATED; do + cp ${DTC_UPSTREAM_PATH}/$f ${f}_shipped + git add ${f}_shipped +done + +git commit -e -v -m "scripts/dtc: Update to upstream version [CHANGEME]" diff --git a/scripts/dtc/version_gen.h b/scripts/dtc/version_gen.h index e0b82fe8e7de..54d4e904433a 100644 --- a/scripts/dtc/version_gen.h +++ b/scripts/dtc/version_gen.h @@ -1 +1 @@ -#define DTC_VERSION "DTC 1.4.0" +#define DTC_VERSION "DTC 1.4.0-dirty"