From 800eca1371b1c87e1c7a4af5aff444f2b6059327 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Wed, 15 Apr 2026 07:46:06 +0200 Subject: [PATCH] scripts: mkemmc.sh: Fix output pollution on missing images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reorder the redirections so that the 2>/dev/null can actually take effect. Signed-off-by: Jan Kiszka Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Jerome Forissier Message-ID: Signed-off-by: Philippe Mathieu-Daudé --- scripts/mkemmc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mkemmc.sh b/scripts/mkemmc.sh index 429388213c..3d8546cdaa 100755 --- a/scripts/mkemmc.sh +++ b/scripts/mkemmc.sh @@ -40,7 +40,7 @@ process_size() { alignment=$3 image_arg=$4 if [ "${image_arg#*:}" = "$image_arg" ]; then - if ! size=$(wc -c < "$image_file" 2>/dev/null); then + if ! size=$(wc -c 2>/dev/null < "$image_file"); then echo "Missing $name image '$image_file'." >&2 exit 1 fi @@ -102,7 +102,7 @@ check_truncation() { if [ "$image_file" = "/dev/zero" ]; then return fi - if ! actual_size=$(wc -c < "$image_file" 2>/dev/null); then + if ! actual_size=$(wc -c 2>/dev/null < "$image_file"); then echo "Missing image '$image_file'." >&2 exit 1 fi