[v4,1/2] fix premature success dialog in installer script

Message ID 20250821063944.47909-1-kasturi.shekar@siemens.com
State Under Review
Headers show
Series [v4,1/2] fix premature success dialog in installer script | expand

Commit Message

Kasturi Shekar Aug. 21, 2025, 6:39 a.m. UTC
The 'Installation successful' message was displayed before the
progress bar completed. Fixed by tracking the dialog --gauge PID
and terminating it after bmaptool finishes. This ensures
the progress bar runs to 100% before showing the final message.

Changes:
- Tracked the PID of the dialog --gauge process.
- Killed gauge process after bmaptool completed.
- Ensured success message is shown only after the progress bar ends.

Signed-off-by: Kasturi Shekar <kasturi.shekar@siemens.com>
---
 .../deploy-image/files/usr/bin/deploy-image-wic.sh            | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Felix Moessbauer Aug. 21, 2025, 8:59 a.m. UTC | #1
On Thu, 2025-08-21 at 12:09 +0530, 'Kasturi Shekar' via isar-users
wrote:
> Changes since v4:
> - added cover letter for maintainers understanding

Acked-by: Felix Moessbauer <felix.moessbauer@siemens.com>

PS: Please send follow up versions of patch series as top-level email
(no in-reply-to).

Felix

> 
> Changes since v3:
> - addressed shellcheck warnings for the script
> 
> Changes since v2:
> - added more detailed commit message
> 
> Changes since v1:
> - fix premature success dialog in installer script
> 
> Kasturi Shekar (2):
>   fix premature success dialog in installer script
>   deploy-image-wic.sh: fix shellcheck warnings
> 
>  .../files/usr/bin/deploy-image-wic.sh             | 15 ++++++++++---
> --
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> -- 
> 2.39.5

Patch

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 aba81c84..fa1061c1 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
@@ -183,12 +183,16 @@  if version_ge "$bmap_version" "3.6"; then
         done
     ) | dialog --gauge "Flashing image, please wait..." 10 70 0 &
 
+    gauge_pid=$!
 fi
 
 if ! bmaptool ${quiet_flag} copy ${bmap_options} "$installer_image_uri" "${installer_target_dev}"; then
+    kill "$gauge_pid"
     exit 1
 fi
 
+kill "$gauge_pid" 2>/dev/null
+
 if ! $installer_unattended; then
     dialog --title "Reboot" \
            --msgbox "Installation was successful. System will be rebooted. Please remove the USB stick." 6 60