public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: u-boot@lists.denx.de
Subject: [PATCH] imx: mkimage_fit_atf: fix file size reporting
Date: Tue,  6 Apr 2021 21:04:09 -0700	[thread overview]
Message-ID: <20210407040409.12796-1-tharvey@gateworks.com> (raw)

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>
---
 arch/arm/mach-imx/mkimage_fit_atf.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-imx/mkimage_fit_atf.sh b/arch/arm/mach-imx/mkimage_fit_atf.sh
index fe12b7bb4b..2a17968794 100755
--- a/arch/arm/mach-imx/mkimage_fit_atf.sh
+++ b/arch/arm/mach-imx/mkimage_fit_atf.sh
@@ -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
 
 
-- 
2.17.1

             reply	other threads:[~2021-04-07  4:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07  4:04 Tim Harvey [this message]
2021-05-02 11:42 ` [PATCH] imx: mkimage_fit_atf: fix file size reporting stefano.babic at babic.homelinux.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210407040409.12796-1-tharvey@gateworks.com \
    --to=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox