aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-05-10 11:46:45 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-05-10 11:46:45 +0000
commit4022f5a9f4c15ccf8e95ea5ae0f562a5dc3df718 (patch)
treeeb76b8d5465ce4ca8edeed71ee7e2809c2c0edd3 /scripts
parent3a8303ca9e67326a05375bfb858d976939173e04 (diff)
downloadupstream-4022f5a9f4c15ccf8e95ea5ae0f562a5dc3df718.tar.gz
upstream-4022f5a9f4c15ccf8e95ea5ae0f562a5dc3df718.tar.bz2
upstream-4022f5a9f4c15ccf8e95ea5ae0f562a5dc3df718.zip
build: make device-tree arg optional in mkits.sh
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 <mathieu@qca.qualcomm.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45659 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mkits.sh40
1 files changed, 21 insertions, 19 deletions
diff --git a/scripts/mkits.sh b/scripts/mkits.sh
index c360c73a56..6b5100e1a2 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}