From: "srinuvasan.a via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: cedric.hombourger@siemens.com,
Srinuvasan A <srinuvasan.a@siemens.com>,
Shivaschandra K L <shivaschandra.k-l@siemens.com>
Subject: [PATCH 1/3] installer: add reusable progress gauge
Date: Tue, 27 Oct 2026 16:35:59 +0530 [thread overview]
Message-ID: <20261027110601.1197504-1-srinuvasan.a@siemens.com> (raw)
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.
next reply other threads:[~2026-10-27 11:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 11:05 srinuvasan.a via isar-users [this message]
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
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=20261027110601.1197504-1-srinuvasan.a@siemens.com \
--to=isar-users@googlegroups.com \
--cc=cedric.hombourger@siemens.com \
--cc=shivaschandra.k-l@siemens.com \
--cc=srinuvasan.a@siemens.com \
/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