aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2018-10-25 08:32:40 +0000
committerStefano Babic <sbabic@denx.de>2018-10-25 11:47:53 +0200
commitd79611598fb74dc0f7cb37d855fff28d77ba8d53 (patch)
treee1fca983dd440d4bfd5b0798f7363be47ee2866e /tools
parentbb839ad931840e49472bf65c7e54d61aef8f6736 (diff)
downloadu-boot-d79611598fb74dc0f7cb37d855fff28d77ba8d53.zip
u-boot-d79611598fb74dc0f7cb37d855fff28d77ba8d53.tar.gz
u-boot-d79611598fb74dc0f7cb37d855fff28d77ba8d53.tar.bz2
imx: mkimage: avoid stop CI when required files not exists
Introduce a new script to check whether file exists and use that check in Makefile to avoid break CI system. The script return 1 when the required files not exists, return 0 when files exists. The script will ignore check to u-boot-dtb.bin, because if there is something wrong to generate u-boot-dtb.bin, there must be some code error. Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/imx_cntr_image.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/imx_cntr_image.sh b/tools/imx_cntr_image.sh
new file mode 100755
index 0000000..4c629e8
--- /dev/null
+++ b/tools/imx_cntr_image.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0+
+#
+# script to check whether the file exists in imximage.cfg for i.MX8
+#
+# usage: $0 <imximage.cfg>
+
+file=$1
+
+blobs=`awk '/^APPEND/ {print $2} /^IMAGE/ || /^DATA/ {print $3}' $file`
+for f in $blobs; do
+ tmp=$srctree/$f
+ if [ $f == "u-boot-dtb.bin" ]; then
+ continue
+ fi
+
+ if [ -f $f ]; then
+ continue
+ fi
+
+ if [ ! -f $tmp ]; then
+ echo "WARNING '$tmp' not found, resulting binary is not-functional" >&2
+ exit 1
+ fi
+
+ sed -in "s;$f;$tmp;" $file
+done
+
+exit 0