X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=scripts%2Fmkits.sh;h=8857996eba222fce44846242b13e6d66e456f267;hb=f532191c1cefa9950d4064dbd9dd810b90b169bd;hp=c360c73a56a93f5135a5431ff3a57a0a251cdb72;hpb=acdb0ac35c4b527b4e827809160c7478b1162817;p=openwrt%2Fstaging%2Fwigyori.git diff --git a/scripts/mkits.sh b/scripts/mkits.sh index c360c73a56..8857996eba 100755 --- a/scripts/mkits.sh +++ b/scripts/mkits.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed under the terms of the GNU GPL License version 2 or later. # @@ -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}