public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] isar-installer: show progress bar during bmaptool copy process
       [not found] <KLEL2lkm9BY>
@ 2025-03-14  6:28 ` 'Kasturi Shekar' via isar-users
  2025-03-17  5:49 ` 'Kasturi Shekar' via isar-users
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: 'Kasturi Shekar' via isar-users @ 2025-03-14  6:28 UTC (permalink / raw)
  To: isar-users; +Cc: Kasturi Shekar

- Added support for a progress gauge using a named pipe to capture and display
 percentage progress when using `bmaptool`.
- The progress bar is displayed only when the `bmaptool` version is 3.8 or above,
 as versions prior to 3.8 has some issues with `--psplash-pipe` flag.
- For `bmaptool` versions below 3.8, the image copy process continues without a
 progress bar to maintain compatibility.
- The gauge uses `dialog --gauge` to dynamically update the progress based on
 output from the `bmaptool` process.

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

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 7f552eee..7df9beef 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
@@ -149,7 +149,42 @@ if ! $installer_unattended; then
     clear
 fi
 
-if ! bmaptool copy ${bmap_options} "$installer_image_uri" "${installer_target_dev}"; then
+# Function to compare version numbers
+version_ge() {
+    if [ "$(printf '%s\n' "$1"X "$2" | sort -V | head -n 1)" != "$1"X ]; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+# Get bmap-tools version using dpkg-query
+bmap_version=$(dpkg-query -W -f='${Version}' bmap-tools | awk -F'[~+-]' '{ print $1 }')
+
+if version_ge "$bmap_version" "3.8"; 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"
+
+    # 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 &
+
+fi
+
+if ! bmaptool copy ${bmap_options} "$installer_image_uri" "$installer_target_dev"; then
     exit 1
 fi
 
-- 
2.39.5

-- 
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/20250314062818.572738-1-kasturi.shekar%40siemens.com.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] isar-installer: show progress bar during bmaptool copy process
       [not found] <KLEL2lkm9BY>
  2025-03-14  6:28 ` [PATCH] isar-installer: show progress bar during bmaptool copy process 'Kasturi Shekar' via isar-users
@ 2025-03-17  5:49 ` 'Kasturi Shekar' via isar-users
  2025-03-17 12:22   ` 'Quirin Gylstorff' via isar-users
  2025-03-18  5:20 ` 'Kasturi Shekar' via isar-users
  2025-03-19  9:42 ` [PATCH v5] " 'Kasturi Shekar' via isar-users
  3 siblings, 1 reply; 7+ messages in thread
From: 'Kasturi Shekar' via isar-users @ 2025-03-17  5:49 UTC (permalink / raw)
  To: isar-users; +Cc: Kasturi Shekar

- Added support for a progress gauge using a named pipe to capture and display
 percentage progress when using `bmaptool`.
- The progress bar is displayed only when the `bmaptool` version is 3.8 or above,
 as versions prior to 3.8 has some issues with `--psplash-pipe` flag.
- For `bmaptool` versions below 3.8, the image copy process continues without a
 progress bar to maintain compatibility.
- The gauge uses `dialog --gauge` to dynamically update the progress based on
 output from the `bmaptool` process.

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

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 7f552eee..85549d57 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
@@ -149,7 +149,43 @@ if ! $installer_unattended; then
     clear
 fi
 
-if ! bmaptool copy ${bmap_options} "$installer_image_uri" "${installer_target_dev}"; then
+# Function to compare version numbers
+version_ge() {
+    if [ "$(printf '%s\n' "$1"X "$2" | sort -V | head -n 1)" != "$1"X ]; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+# Get bmap-tools version using dpkg-query
+bmap_version=$(dpkg-query -W -f='${Version}' bmap-tools | awk -F'[~+-]' '{ print $1 }')
+
+if version_ge "$bmap_version" "3.8"; 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 &
+
+fi
+
+if ! bmaptool ${quiet_flag} copy ${bmap_options} "$installer_image_uri" "${installer_target_dev}"; then
     exit 1
 fi
 
-- 
2.39.5

-- 
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/20250317054911.578456-1-kasturi.shekar%40siemens.com.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] isar-installer: show progress bar during bmaptool copy process
  2025-03-17  5:49 ` 'Kasturi Shekar' via isar-users
@ 2025-03-17 12:22   ` 'Quirin Gylstorff' via isar-users
  0 siblings, 0 replies; 7+ messages in thread
From: 'Quirin Gylstorff' via isar-users @ 2025-03-17 12:22 UTC (permalink / raw)
  To: Kasturi Shekar, isar-users



On 3/17/25 06:49, 'Kasturi Shekar' via isar-users wrote:
> - Added support for a progress gauge using a named pipe to capture and display
>   percentage progress when using `bmaptool`.
> - The progress bar is displayed only when the `bmaptool` version is 3.8 or above,
>   as versions prior to 3.8 has some issues with `--psplash-pipe` flag.
> - For `bmaptool` versions below 3.8, the image copy process continues without a
>   progress bar to maintain compatibility.
> - The gauge uses `dialog --gauge` to dynamically update the progress based on
>   output from the `bmaptool` process.
> 
> Signed-off-by: Kasturi Shekar <kasturi.shekar@siemens.com>
> ---
>   .../files/usr/bin/deploy-image-wic.sh         | 38 ++++++++++++++++++-
>   1 file changed, 37 insertions(+), 1 deletion(-)
> 
> 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 7f552eee..85549d57 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
> @@ -149,7 +149,43 @@ if ! $installer_unattended; then
>       clear
>   fi
>   
> -if ! bmaptool copy ${bmap_options} "$installer_image_uri" "${installer_target_dev}"; then
> +# Function to compare version numbers
> +version_ge() {
> +    if [ "$(printf '%s\n' "$1"X "$2" | sort -V | head -n 1)" != "$1"X ]; then
> +        return 0
> +    else
> +        return 1
> +    fi
> +}
> +
> +# Get bmap-tools version using dpkg-query
> +bmap_version=$(dpkg-query -W -f='${Version}' bmap-tools | awk -F'[~+-]' '{ print $1 }')
I would not use dpkg -  as bmaptool has a `--version` option.

Quirin
> +
> +if version_ge "$bmap_version" "3.8"; 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 &
> +
> +fi
> +
> +if ! bmaptool ${quiet_flag} copy ${bmap_options} "$installer_image_uri" "${installer_target_dev}"; then
>       exit 1
>   fi
>   

-- 
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/ade675f2-ae84-46a0-9b16-dbf8d57804e9%40siemens.com.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] isar-installer: show progress bar during bmaptool copy process
       [not found] <KLEL2lkm9BY>
  2025-03-14  6:28 ` [PATCH] isar-installer: show progress bar during bmaptool copy process 'Kasturi Shekar' via isar-users
  2025-03-17  5:49 ` 'Kasturi Shekar' via isar-users
@ 2025-03-18  5:20 ` 'Kasturi Shekar' via isar-users
  2025-03-18  6:05   ` 'Jan Kiszka' via isar-users
  2025-03-19  9:42 ` [PATCH v5] " 'Kasturi Shekar' via isar-users
  3 siblings, 1 reply; 7+ messages in thread
From: 'Kasturi Shekar' via isar-users @ 2025-03-18  5:20 UTC (permalink / raw)
  To: isar-users; +Cc: Kasturi Shekar

- Added support for a progress gauge using a named pipe to capture and display
 percentage progress when using `bmaptool`.
- The progress bar is displayed only when the `bmaptool` version is 3.8 or above,
 as versions prior to 3.8 has some issues with `--psplash-pipe` flag.
- For `bmaptool` versions below 3.8, the image copy process continues without a
 progress bar to maintain compatibility.
- The gauge uses `dialog --gauge` to dynamically update the progress based on
 output from the `bmaptool` process.

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

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 7f552eee..66c35506 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
@@ -149,7 +149,43 @@ if ! $installer_unattended; then
     clear
 fi
 
-if ! bmaptool copy ${bmap_options} "$installer_image_uri" "${installer_target_dev}"; then
+# Function to compare version numbers
+version_ge() {
+    if [ "$(printf '%s\n' "$1"X "$2" | sort -V | head -n 1)" != "$1"X ]; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+# Get bmap-tools version
+bmap_version=$(bmaptool --version | awk '{ print $NF }')
+
+if version_ge "$bmap_version" "3.8"; 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 &
+
+fi
+
+if ! bmaptool ${quiet_flag} copy ${bmap_options} "$installer_image_uri" "${installer_target_dev}"; then
     exit 1
 fi
 
-- 
2.39.5

-- 
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/20250318052012.4701-1-kasturi.shekar%40siemens.com.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] isar-installer: show progress bar during bmaptool copy process
  2025-03-18  5:20 ` 'Kasturi Shekar' via isar-users
@ 2025-03-18  6:05   ` 'Jan Kiszka' via isar-users
  0 siblings, 0 replies; 7+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2025-03-18  6:05 UTC (permalink / raw)
  To: Kasturi Shekar, isar-users

Please always version our patches, or you will only create confusion for
reviewers and maintainers. This would be "PATCH v5" now.

Jan

On 18.03.25 06:20, 'Kasturi Shekar' via isar-users wrote:
> - Added support for a progress gauge using a named pipe to capture and display
>  percentage progress when using `bmaptool`.
> - The progress bar is displayed only when the `bmaptool` version is 3.8 or above,
>  as versions prior to 3.8 has some issues with `--psplash-pipe` flag.
> - For `bmaptool` versions below 3.8, the image copy process continues without a
>  progress bar to maintain compatibility.
> - The gauge uses `dialog --gauge` to dynamically update the progress based on
>  output from the `bmaptool` process.
> 
> Signed-off-by: Kasturi Shekar <kasturi.shekar@siemens.com>
> ---
>  .../files/usr/bin/deploy-image-wic.sh         | 38 ++++++++++++++++++-
>  1 file changed, 37 insertions(+), 1 deletion(-)
> 
> 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 7f552eee..66c35506 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
> @@ -149,7 +149,43 @@ if ! $installer_unattended; then
>      clear
>  fi
>  
> -if ! bmaptool copy ${bmap_options} "$installer_image_uri" "${installer_target_dev}"; then
> +# Function to compare version numbers
> +version_ge() {
> +    if [ "$(printf '%s\n' "$1"X "$2" | sort -V | head -n 1)" != "$1"X ]; then
> +        return 0
> +    else
> +        return 1
> +    fi
> +}
> +
> +# Get bmap-tools version
> +bmap_version=$(bmaptool --version | awk '{ print $NF }')
> +
> +if version_ge "$bmap_version" "3.8"; 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 &
> +
> +fi
> +
> +if ! bmaptool ${quiet_flag} copy ${bmap_options} "$installer_image_uri" "${installer_target_dev}"; then
>      exit 1
>  fi
>  


-- 
Siemens AG, Foundational Technologies
Linux Expert Center

-- 
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/ca6aa527-e6ad-4a5d-a29b-fd4934c16f97%40siemens.com.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v5] isar-installer: show progress bar during bmaptool copy process
       [not found] <KLEL2lkm9BY>
                   ` (2 preceding siblings ...)
  2025-03-18  5:20 ` 'Kasturi Shekar' via isar-users
@ 2025-03-19  9:42 ` 'Kasturi Shekar' via isar-users
  2025-03-27 10:32   ` Uladzimir Bely
  3 siblings, 1 reply; 7+ messages in thread
From: 'Kasturi Shekar' via isar-users @ 2025-03-19  9:42 UTC (permalink / raw)
  To: isar-users; +Cc: Kasturi Shekar

- Added support for a progress gauge using a named pipe to capture and display
 percentage progress when using `bmaptool`.
- The progress bar is displayed only when the `bmaptool` version is 3.8 or above,
 as versions prior to 3.8 has some issues with `--psplash-pipe` flag.
- For `bmaptool` versions below 3.8, the image copy process continues without a
 progress bar to maintain compatibility.
- The gauge uses `dialog --gauge` to dynamically update the progress based on
 output from the `bmaptool` process.

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

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 7f552eee..66c35506 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
@@ -149,7 +149,43 @@ if ! $installer_unattended; then
     clear
 fi
 
-if ! bmaptool copy ${bmap_options} "$installer_image_uri" "${installer_target_dev}"; then
+# Function to compare version numbers
+version_ge() {
+    if [ "$(printf '%s\n' "$1"X "$2" | sort -V | head -n 1)" != "$1"X ]; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+# Get bmap-tools version
+bmap_version=$(bmaptool --version | awk '{ print $NF }')
+
+if version_ge "$bmap_version" "3.8"; 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 &
+
+fi
+
+if ! bmaptool ${quiet_flag} copy ${bmap_options} "$installer_image_uri" "${installer_target_dev}"; then
     exit 1
 fi
 
-- 
2.39.5

-- 
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/20250319094251.604338-1-kasturi.shekar%40siemens.com.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v5] isar-installer: show progress bar during bmaptool copy process
  2025-03-19  9:42 ` [PATCH v5] " 'Kasturi Shekar' via isar-users
@ 2025-03-27 10:32   ` Uladzimir Bely
  0 siblings, 0 replies; 7+ messages in thread
From: Uladzimir Bely @ 2025-03-27 10:32 UTC (permalink / raw)
  To: Kasturi Shekar, isar-users

On Wed, 2025-03-19 at 15:12 +0530, 'Kasturi Shekar' via isar-users
wrote:
> - Added support for a progress gauge using a named pipe to capture
> and display
>  percentage progress when using `bmaptool`.
> - The progress bar is displayed only when the `bmaptool` version is
> 3.8 or above,
>  as versions prior to 3.8 has some issues with `--psplash-pipe` flag.
> - For `bmaptool` versions below 3.8, the image copy process continues
> without a
>  progress bar to maintain compatibility.
> - The gauge uses `dialog --gauge` to dynamically update the progress
> based on
>  output from the `bmaptool` process.
> 
> Signed-off-by: Kasturi Shekar <kasturi.shekar@siemens.com>
> ---
>  .../files/usr/bin/deploy-image-wic.sh         | 38
> ++++++++++++++++++-
>  1 file changed, 37 insertions(+), 1 deletion(-)
> 
> 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 7f552eee..66c35506 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
> @@ -149,7 +149,43 @@ if ! $installer_unattended; then
>      clear
>  fi
>  
> -if ! bmaptool copy ${bmap_options} "$installer_image_uri"
> "${installer_target_dev}"; then
> +# Function to compare version numbers
> +version_ge() {
> +    if [ "$(printf '%s\n' "$1"X "$2" | sort -V | head -n 1)" !=
> "$1"X ]; then
> +        return 0
> +    else
> +        return 1
> +    fi
> +}
> +
> +# Get bmap-tools version
> +bmap_version=$(bmaptool --version | awk '{ print $NF }')
> +
> +if version_ge "$bmap_version" "3.8"; 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 &
> +
> +fi
> +
> +if ! bmaptool ${quiet_flag} copy ${bmap_options}
> "$installer_image_uri" "${installer_target_dev}"; then
>      exit 1
>  fi
>  
> -- 
> 2.39.5

Applied to next, thanks.

-- 
Best regards,
Uladzimir.

-- 
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/4627b14fa88b52d3723c7675b8d5fa4febb539c9.camel%40ilbers.de.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-03-27 10:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <KLEL2lkm9BY>
2025-03-14  6:28 ` [PATCH] isar-installer: show progress bar during bmaptool copy process 'Kasturi Shekar' via isar-users
2025-03-17  5:49 ` 'Kasturi Shekar' via isar-users
2025-03-17 12:22   ` 'Quirin Gylstorff' via isar-users
2025-03-18  5:20 ` 'Kasturi Shekar' via isar-users
2025-03-18  6:05   ` 'Jan Kiszka' via isar-users
2025-03-19  9:42 ` [PATCH v5] " 'Kasturi Shekar' via isar-users
2025-03-27 10:32   ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox