public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] isar-installer: Generate textual output only in unattended mode.
@ 2025-09-22 16:43 alexander.heinisch via isar-users
  2025-10-14 14:59 ` Zhihang Wei
  0 siblings, 1 reply; 2+ messages in thread
From: alexander.heinisch via isar-users @ 2025-09-22 16:43 UTC (permalink / raw)
  To: isar-users; +Cc: kasturi.shekar, Alexander Heinisch

From: Alexander Heinisch <alexander.heinisch@siemens.com>

Dialog renders textual output unreadable, thus, useless.
Thus, logs output via a serial, or piped to a file are useless when combined with dialog.

Signed-off-by: Alexander Heinisch <alexander.heinisch@siemens.com>
---
 .../files/usr/bin/deploy-image-wic.sh         | 52 ++++++++++---------
 1 file changed, 27 insertions(+), 25 deletions(-)

diff --git a/meta-isar/recipes-installer/deploy-image/files/usr/bin/deploy-image-wic.sh b/meta-isar/recipes-installer/deploy-image/files/usr/bin/deploy-image-wic.sh
index 333762f1..779ed34a 100755
--- a/meta-isar/recipes-installer/deploy-image/files/usr/bin/deploy-image-wic.sh
+++ b/meta-isar/recipes-installer/deploy-image/files/usr/bin/deploy-image-wic.sh
@@ -157,32 +157,34 @@ version_ge() {
     fi
 }
 
-# Get bmap-tools version
-bmap_version=$(bmaptool --version | awk '{ print $NF }')
-
-if version_ge "$bmap_version" "3.6"; then
-    # Create a named pipe for progress communication
-    progress_pipe="/tmp/progress"
-    if ! mkfifo "$progress_pipe"; then
-        echo "Error: Failed to create named pipe $progress_pipe"
-        exit 1
-    fi
-
-    # Add psplash pipe to bmap_options
-    bmap_options="$bmap_options --psplash-pipe=$progress_pipe"
-    quiet_flag="-q"
-
-    # Initialize the dialog gauge and update it dynamically
-    (
-        while true; do
-            if read -r line < "$progress_pipe"; then
-                percentage=$(echo "$line" | awk '{ print $2 }')
-                echo "$percentage"
-            fi
-        done
-    ) | dialog --gauge "Flashing image, please wait..." 10 70 0 &
+if ! $installer_unattended; then
+    # Get bmap-tools version
+    bmap_version=$(bmaptool --version | awk '{ print $NF }')
+
+    if version_ge "$bmap_version" "3.6"; then
+        # Create a named pipe for progress communication
+        progress_pipe="/tmp/progress"
+        if ! mkfifo "$progress_pipe"; then
+            echo "Error: Failed to create named pipe $progress_pipe"
+            exit 1
+        fi
 
-    gauge_pid=$!
+        # Add psplash pipe to bmap_options
+        bmap_options="$bmap_options --psplash-pipe=$progress_pipe"
+        quiet_flag="-q"
+
+        # Initialize the dialog gauge and update it dynamically
+        (
+            while true; do
+                if read -r line < "$progress_pipe"; then
+                    percentage=$(echo "$line" | awk '{ print $2 }')
+                    echo "$percentage"
+                fi
+            done
+        ) | dialog --gauge "Flashing image, please wait..." 10 70 0 &
+
+        gauge_pid=$!
+    fi
 fi
 
 if ! bmaptool $quiet_flag copy $bmap_options "$installer_image_uri" "$installer_target_dev"; then
-- 
2.39.5

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20250922164359.1322947-1-alexander.heinisch%40siemens.com.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-14 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-22 16:43 [PATCH] isar-installer: Generate textual output only in unattended mode alexander.heinisch via isar-users
2025-10-14 14:59 ` Zhihang Wei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox