xref: /openbmc/u-boot/tools/imx_cntr_image.sh (revision d7961159)
1*d7961159SPeng Fan#!/bin/sh
2*d7961159SPeng Fan# SPDX-License-Identifier: GPL-2.0+
3*d7961159SPeng Fan#
4*d7961159SPeng Fan# script to check whether the file exists in imximage.cfg for i.MX8
5*d7961159SPeng Fan#
6*d7961159SPeng Fan# usage: $0 <imximage.cfg>
7*d7961159SPeng Fan
8*d7961159SPeng Fanfile=$1
9*d7961159SPeng Fan
10*d7961159SPeng Fanblobs=`awk '/^APPEND/ {print $2} /^IMAGE/ || /^DATA/ {print $3}' $file`
11*d7961159SPeng Fanfor f in $blobs; do
12*d7961159SPeng Fan	tmp=$srctree/$f
13*d7961159SPeng Fan	if [ $f == "u-boot-dtb.bin" ]; then
14*d7961159SPeng Fan		continue
15*d7961159SPeng Fan	fi
16*d7961159SPeng Fan
17*d7961159SPeng Fan	if [ -f $f ]; then
18*d7961159SPeng Fan		continue
19*d7961159SPeng Fan	fi
20*d7961159SPeng Fan
21*d7961159SPeng Fan	if [ ! -f $tmp ]; then
22*d7961159SPeng Fan		echo "WARNING '$tmp' not found, resulting binary is not-functional" >&2
23*d7961159SPeng Fan		exit 1
24*d7961159SPeng Fan	fi
25*d7961159SPeng Fan
26*d7961159SPeng Fan	sed -in "s;$f;$tmp;" $file
27*d7961159SPeng Fandone
28*d7961159SPeng Fan
29*d7961159SPeng Fanexit 0
30