imx: mkimage_fit_atf: fix file size reporting

instead using ls and awk to determine file size use stat instead.
This fixes an invalid size reporting for user or group names that have
spaces in them.

This adds a dependency on the stat application which is part of
the coreutils package which also includes ls.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
This commit is contained in:
Tim Harvey
2021-04-06 21:04:09 -07:00
committed by Stefano Babic
parent f94ce9eb05
commit 35fc3713a3

View File

@@ -16,7 +16,7 @@ if [ ! -f $BL31 ]; then
exit 0 exit 0
else else
echo "$BL31 size: " >&2 echo "$BL31 size: " >&2
ls -lct $BL31 | awk '{print $5}' >&2 stat -c %s $BL31 >&2
fi fi
BL32="tee.bin" BL32="tee.bin"
@@ -26,7 +26,7 @@ if [ ! -f $BL32 ]; then
else else
echo "Building with TEE support, make sure your $BL31 is compiled with spd. If you do not want tee, please delete $BL31" >&2 echo "Building with TEE support, make sure your $BL31 is compiled with spd. If you do not want tee, please delete $BL31" >&2
echo "$BL32 size: " >&2 echo "$BL32 size: " >&2
ls -lct $BL32 | awk '{print $5}' >&2 stat -c %s $BL32 >&2
fi fi
BL33="u-boot-nodtb.bin" BL33="u-boot-nodtb.bin"
@@ -36,13 +36,13 @@ if [ ! -f $BL33 ]; then
exit 0 exit 0
else else
echo "u-boot-nodtb.bin size: " >&2 echo "u-boot-nodtb.bin size: " >&2
ls -lct u-boot-nodtb.bin | awk '{print $5}' >&2 stat -c %s u-boot-nodtb.bin >&2
fi fi
for dtname in $* for dtname in $*
do do
echo "$dtname size: " >&2 echo "$dtname size: " >&2
ls -lct $dtname | awk '{print $5}' >&2 stat -c %s $dtname >&2
done done