Skip to contentSkip to conversation

imx: mkimage_fit_atf: fix file size reporting

PATCH New Tim Harvey 2 participants 2 messages Apr 7, 2021 – May 2, 2021

Subsystems (3)
lore
Share & tools
lore

Tim Harvey

author
#0 lore raw

PATCH 1/1 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.

---
 arch/arm/mach-imx/mkimage_fit_atf.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-imx/mkimage_fit_atf.sh +4 -4
index fe12b7bb4b..2a17968794 100755
@@ -16,7 +16,7 @@ if [ ! -f $BL31 ]; then
 	exit 0
 else
 	echo "$BL31 size: " >&2
-	ls -lct $BL31 | awk '{print $5}' >&2
+	stat -c %s $BL31 >&2
 fi
 
 BL32="tee.bin"
@@ -26,7 +26,7 @@ if [ ! -f $BL32 ]; then
 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 "$BL32 size: " >&2
-	ls -lct $BL32 | awk '{print $5}' >&2
+	stat -c %s $BL32 >&2
 fi
 
 BL33="u-boot-nodtb.bin"
@@ -36,13 +36,13 @@ if [ ! -f $BL33 ]; then
 	exit 0
 else
 	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
 
 for dtname in $*
 do
 	echo "$dtname size: " >&2
-	ls -lct $dtname | awk '{print $5}' >&2
+	stat -c %s $dtname >&2
 done
 
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 imx: mkimage_fit_atf: fix file size reporting

Quoted 6 lines

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.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================