[PATCH v5 0/2] fix premature success dialog

8 views
Skip to first unread message

Kasturi Shekar

unread,
Sep 4, 2025, 5:51:59 AM (3 days ago) Sep 4
to isar-...@googlegroups.com, Kasturi Shekar
Changes since v5:
- Fixed bmaptool invocation by removing quotes around option variables to ensure arguments are parsed correctly

Changes since v4:
- added cover letter for maintainers understanding

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

Kasturi Shekar

unread,
Sep 4, 2025, 5:52:01 AM (3 days ago) Sep 4
to isar-...@googlegroups.com, Kasturi Shekar
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...@siemens.com>
---
.../deploy-image/files/usr/bin/deploy-image-wic.sh | 4 ++++
1 file changed, 4 insertions(+)

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
--
2.39.5

Kasturi Shekar

unread,
Sep 4, 2025, 5:52:03 AM (3 days ago) Sep 4
to isar-...@googlegroups.com, Kasturi Shekar
No functional changes, only style and readability fixes
without altering runtime behavior

Signed-off-by: Kasturi Shekar <kasturi...@siemens.com>
---
.../deploy-image/files/usr/bin/deploy-image-wic.sh | 11 ++++++-----
1 file changed, 6 insertions(+), 5 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 fa1061c1..333762f1 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
@@ -8,8 +8,7 @@ installdata=${INSTALL_DATA:-/install}

SCRIPT_DIR=$( dirname -- "$( readlink -f -- "$0"; )"; )

-. ${SCRIPT_DIR}/../lib/deploy-image-wic/handle-config.sh
-
+. "${SCRIPT_DIR}/../lib/deploy-image-wic/handle-config.sh"

if ! $installer_unattended; then
installer_image_uri=$(find "$installdata" -type f -iname "*.wic*" -a -not -iname "*.wic.bmap" -exec basename {} \;)
@@ -37,7 +36,7 @@ if ! $installer_unattended; then
# inspired by poky/meta/recipes-core/initrdscripts/files/install-efi.sh
target_device_list=""
current_root_dev_type=$(findmnt / -o fstype -n)
- if [ ${current_root_dev_type} = "nfs" ]; then
+ if [ "$current_root_dev_type" = "nfs" ]; then
current_root_dev="nfs"
else
current_root_dev=$(readlink -f "$(findmnt / -o source -n)")
@@ -108,7 +107,7 @@ if ! $installer_unattended; then
exit 0
fi
else
- installer_target_dev=/dev/$(echo "$target_device_list" | tr -d " ")
+ installer_target_dev="/dev/$(echo "$target_device_list" | tr -d " ")"
fi
TARGET_DEVICE_SIZE=$(lsblk --nodeps --noheadings -o SIZE "$installer_target_dev" | tr -d " ")
if ! dialog --yes-label Ok --no-label Cancel \
@@ -186,11 +185,13 @@ if version_ge "$bmap_version" "3.6"; then
gauge_pid=$!
fi

-if ! bmaptool ${quiet_flag} copy ${bmap_options} "$installer_image_uri" "${installer_target_dev}"; then
+if ! bmaptool $quiet_flag copy $bmap_options "$installer_image_uri" "$installer_target_dev"; then
kill "$gauge_pid"
exit 1
fi

+# Attempt to terminate the gauge process if still running.
+# Errors are ignored since the process may already have exited.
kill "$gauge_pid" 2>/dev/null

if ! $installer_unattended; then
--
2.39.5

Reply all
Reply to author
Forward
0 new messages