From e6f1aeb61d48bffd2daa4900ed9d4c7b563a9e7b Mon Sep 17 00:00:00 2001
From: Andreas Gnau <andreas.gnau@iopsys.eu>
Date: Wed, 16 Apr 2025 16:02:53 +0200
Subject: [PATCH] airoha: Get rid of unintended prints during sysupgrade

During image verification before sysupgrade, the line "bootloader-emmc"
was printed to the output of platform_check_image. When supplied with a
pre-7.1.0ALPHA3 image squashfs could be printed.  Silence the output of
the offending command.

Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
---
 airoha/base-files/lib/upgrade/platform.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/airoha/base-files/lib/upgrade/platform.sh b/airoha/base-files/lib/upgrade/platform.sh
index 0c776c85f..846449147 100644
--- a/airoha/base-files/lib/upgrade/platform.sh
+++ b/airoha/base-files/lib/upgrade/platform.sh
@@ -11,12 +11,11 @@ platform_check_image() {
 	__check_image_emmc_gpt_support "$image" "$board_name" || return
 }
 
-
 __check_image_emmc_gpt_support() {
 	local image=$1
 	local board_name=$2
 	local configuration="$(get_configuration "$image" "$board_name")" || return 1
-	if [ "$(get_root_device_type)" = emmc ] && ! get_image_component_ref "$image" bootloader-emmc "$configuration" ; then
+	if [ "$(get_root_device_type)" = emmc ] && ! get_image_component_ref "$image" bootloader-emmc "$configuration" >/dev/null; then
 		log "ERROR: Can not downgrade to image with missing eMMC GPT support."
 		return 1
 	fi
@@ -32,7 +31,7 @@ __check_image_70_65_downgrade() {
 	# those images did not have configs to begin with
 	# shellcheck disable=SC2155
 	local configuration="$(get_configuration "$image" "$board_name")"
-	if get_image_component_ref "$image" squashfs "$configuration"; then
+	if get_image_component_ref "$image" squashfs "$configuration" >/dev/null; then
 		log "ERROR: Downgrading to a version older than 7.1.0ALPHA3 is not supported."
 		return 1
 	fi
-- 
GitLab