From patchwork Thu Apr 30 23:35:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Olivari X-Patchwork-Id: 466770 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 469AE140320 for ; Fri, 1 May 2015 09:36:00 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=qca.qualcomm.com header.i=@qca.qualcomm.com header.b=KrjCvvUv; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C6E9D28A5F0; Fri, 1 May 2015 01:34:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 339DD28A5F0 for ; Fri, 1 May 2015 01:34:35 +0200 (CEST) X-policyd-weight: using cached result; rate:hard: -8.5 Received: from wolverine01.qualcomm.com (wolverine01.qualcomm.com [199.106.114.254]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Fri, 1 May 2015 01:34:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1430436940; x=1461972940; h=from:to:cc:subject:date:message-id:mime-version; bh=5GfZLemOyhxxKERbzOCnHriwwOixZXnNDqxnIMsgpP0=; b=KrjCvvUvuiCeE9PGs5dzQKnCUxvDRRUr6ZM77fOh0LiivJnDbRLvsnzM Zmueg9UOiuq18FmcbDMjGsWNpcKQLXbaIu8yyaWbQ++4U/FgaVtNOAwQt 9XL5v/zzuPYQ/SbGJCeaCRkmD6JriEPF73TtyONbOt22pOD8xPENvhcvh 4=; X-IronPort-AV: E=McAfee;i="5700,7163,7787"; a="116073448" Received: from ironmsg04-r.qualcomm.com ([172.30.46.18]) by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Apr 2015 16:35:38 -0700 X-IronPort-AV: E=Sophos;i="5.11,679,1422950400"; d="scan'208";a="960648870" Received: from nasanexm01g.na.qualcomm.com ([10.85.0.33]) by Ironmsg04-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 30 Apr 2015 16:35:38 -0700 Received: from mathieu-linux.qualcomm.com (10.80.80.8) by NASANEXM01G.na.qualcomm.com (10.85.0.33) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Thu, 30 Apr 2015 16:35:38 -0700 From: Mathieu Olivari To: Date: Thu, 30 Apr 2015 16:35:24 -0700 Message-ID: <1430436925-29418-1-git-send-email-mathieu@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01C.na.qualcomm.com (10.85.0.83) To NASANEXM01G.na.qualcomm.com (10.85.0.33) Subject: [OpenWrt-Devel] [PATCH 1/2] build: make device-tree arg optional in mkits.sh X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" mkits.sh help currently shows dtb file as optional, but generates an invalid its file when this option is unspecified. We're fixing this problem by removing the use of the sed command and just including variables instead. Signed-off-by: Mathieu Olivari --- scripts/mkits.sh | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/scripts/mkits.sh b/scripts/mkits.sh index c360c73..6b5100e 100755 --- a/scripts/mkits.sh +++ b/scripts/mkits.sh @@ -55,6 +55,25 @@ fi ARCH_UPPER=`echo $ARCH | tr '[:lower:]' '[:upper:]'` +# Conditionally create fdt information +if [ -n "${DTB}" ]; then + FDT=" + fdt@1 { + description = \"${ARCH_UPPER} OpenWrt ${DEVICE} device tree blob\"; + data = /incbin/(\"${DTB}\"); + type = \"flat_dt\"; + arch = \"${ARCH}\"; + compression = \"none\"; + hash@1 { + algo = \"crc32\"; + }; + hash@2 { + algo = \"sha1\"; + }; + }; +" +fi + # Create a default, fully populated DTS file DATA="/dts-v1/; @@ -80,19 +99,8 @@ DATA="/dts-v1/; }; }; - fdt@1 { - description = \"${ARCH_UPPER} OpenWrt ${DEVICE} device tree blob\"; - data = /incbin/(\"${DTB}\"); - type = \"flat_dt\"; - arch = \"${ARCH}\"; - compression = \"none\"; - hash@1 { - algo = \"crc32\"; - }; - hash@2 { - algo = \"sha1\"; - }; - }; +${FDT} + }; configurations { @@ -105,11 +113,5 @@ DATA="/dts-v1/; }; };" -# Conditionally strip fdt information out of tree -if [ -z "${DTB}" ]; then - DATA=`echo "$DATA" | sed '/start fdt/,/end fdt/d'` - DATA=`echo "$DATA" | sed '/fdt/d'` -fi - # Write .its file to disk echo "$DATA" > ${OUTPUT}