public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 1/3] installer: add reusable progress gauge
@ 2026-10-27 11:05 srinuvasan.a via isar-users
  2026-10-27 11:06 ` [PATCH 2/3] deploy-image: report the result of the console holding the lock srinuvasan.a via isar-users
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: srinuvasan.a via isar-users @ 2026-10-27 11:05 UTC (permalink / raw)
  To: isar-users; +Cc: cedric.hombourger, Srinuvasan A, Shivaschandra K L

From: Srinuvasan A <srinuvasan.a@siemens.com>

Add an independent percentage consumer for operations reporting progress.
Drain progress if dialog exits early, preserving producer execution.
Keep existing image-copy and RAID progress handling unchanged.

Signed-off-by: Shivaschandra K L <shivaschandra.k-l@siemens.com>
Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
Suggested-by: Cedric Hombourger <cedric.hombourger@siemens.com>
---
 .../files/usr/bin/installer_ui.sh             | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh b/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh
index 133d7c70..aa906221 100644
--- a/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh
+++ b/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh
@@ -185,6 +185,30 @@ ui_start_progress_gauge() {
     UI_GAUGE_PID=$!
 }
 
+#--------------------------------------------------------------------------
+# ui_progress_gauge <message>
+#
+# Reads integer percentages (0-100), one per line, from stdin.
+# No dialog is opened until the first percentage arrives.
+# If dialog exits early, drain the remaining input so the operation is
+# not interrupted by SIGPIPE. Callers must check the producer's status
+# using PIPESTATUS[0]; a completed gauge does not imply operation success.
+# Returns dialog's status after all progress input has been consumed.
+#--------------------------------------------------------------------------
+ui_progress_gauge() {
+    local message="$1"
+    local status=0
+    local percent
+
+    IFS= read -r percent || return 0
+    dialog --gauge "$message" 10 70 "$percent" || status=$?
+    if [ "$status" -ne 0 ]; then
+        echo "Warning: progress dialog failed; waiting for the operation to finish." >&2
+    fi
+    cat >/dev/null
+    return "$status"
+}
+
 #--------------------------------------------------------------------------
 # ui_stop_progress_gauge
 #
-- 
2.34.1

-- 
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/20261027110601.1197504-1-srinuvasan.a%40siemens.com.

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

end of thread, other threads:[~2026-10-30 16:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27 11:05 [PATCH 1/3] installer: add reusable progress gauge srinuvasan.a via isar-users
2026-10-27 11:06 ` [PATCH 2/3] deploy-image: report the result of the console holding the lock srinuvasan.a via isar-users
2026-10-27 11:06 ` [PATCH 3/3] deploy-image: re-encrypt LUKS volumes with new master keys srinuvasan.a via isar-users
2026-10-30 16:16 ` [PATCH 1/3] installer: add reusable progress gauge Zhihang Wei

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