explicitly track the gauge process PID and terminate it after bmaptool finishes

Message ID 20250806054344.3318247-1-kasturi.shekar@siemens.com
State New
Headers show
Series explicitly track the gauge process PID and terminate it after bmaptool finishes | expand

Commit Message

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

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