[PATCH] isar-installer: Generate textual output only in unattended mode.

5 views
Skip to first unread message

alexander...@siemens.com

unread,
Sep 22, 2025, 12:44:19 PM (6 days ago) Sep 22
to isar-...@googlegroups.com, kasturi...@siemens.com, Alexander Heinisch
From: Alexander Heinisch <alexander...@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...@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

Reply all
Reply to author
Forward
0 new messages