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