u-boot/tools/imx_cntr_image.sh
Heiko Schocher 1f70e5a0e8 imx: imx_cntr_image.sh: prevent warning for missing spl
when building U-Boot on imx8qxp and the board port uses
SPL, U-boot build shows

WARNING '.../spl/u-boot-spl.bin' not found, resulting binary is not-functional

This is because U-Boot binary is build first and Makefile
calls script imx_cntr_image.sh which checks if files
exists... but of course as spl is not yet build the
file `spl/u-boot-spl.bin` does not exist yet, so prevent
this warning.

Signed-off-by: Heiko Schocher <hs@denx.de>
2024-11-25 23:07:37 -03:00

33 lines
561 B
Bash
Executable file

#!/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 = "spl/u-boot-spl.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