public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] installer: Auto-select image when only one is available
@ 2026-07-15 10:17 'Shivaschandra KL' via isar-users
  2026-07-29  7:06 ` Zhihang Wei
  0 siblings, 1 reply; 3+ messages in thread
From: 'Shivaschandra KL' via isar-users @ 2026-07-15 10:17 UTC (permalink / raw)
  To: isar-users; +Cc: Shivaschandra KL

Currently, the image selection dialog is always shown,
even when only a single image is available. Even when the single
image is availble, first window asks to select image and second window
asks to start installation of same image.No selection required if there
is only one image.

This change modifies ui_select_image_menu() to automatically select the
image when only one installable entry is found, while preserving the
dialog for multiple images.

Benefits:
- Improved user experience for single-image installations
- Maintains existing behavior for multi-image scenarios

Signed-off-by: Shivaschandra KL <shivaschandra.k-l@siemens.com>
---
 .../deploy-image/files/usr/bin/installer_ui.sh         | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh b/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh
index 9d3ba5de..133d7c70 100644
--- a/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh
+++ b/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh
@@ -66,7 +66,8 @@ ui_countdown_allow_attended_switch() {
 # ui_select_image_menu <install_data_dir>
 #
 # Uses sys_list_installable_entries backend API and returns selected
-# relative image path on stdout.
+# relative image path on stdout. If only one image is available, it is
+# automatically selected without showing a dialog.
 #--------------------------------------------------------------------------
 ui_select_image_menu() {
     local install_data_dir="$1"
@@ -83,6 +84,13 @@ ui_select_image_menu() {
         return 1
     fi
 
+    # If only one image is available, select it automatically
+    if [ "${#list[@]}" -eq 2 ]; then  # list has pairs: path and description
+        echo "${list[0]}"
+        return 0
+    fi
+
+    # Multiple images available, show selection dialog
     selected=$(dialog --no-tags \
         --menu "Select image to be installed" 12 70 6 \
         "${list[@]}" --output-fd 1) || return 2
-- 
2.39.2

-- 
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/20260715101748.2873544-1-shivaschandra.k-l%40siemens.com.

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

* Re: [PATCH] installer: Auto-select image when only one is available
  2026-07-15 10:17 [PATCH] installer: Auto-select image when only one is available 'Shivaschandra KL' via isar-users
@ 2026-07-29  7:06 ` Zhihang Wei
  0 siblings, 0 replies; 3+ messages in thread
From: Zhihang Wei @ 2026-07-29  7:06 UTC (permalink / raw)
  To: Shivaschandra KL, isar-users

Applied to next, thanks.

Zhihang

On 7/15/26 12:17, 'Shivaschandra KL' via isar-users wrote:
> Currently, the image selection dialog is always shown,
> even when only a single image is available. Even when the single
> image is availble, first window asks to select image and second window
> asks to start installation of same image.No selection required if there
> is only one image.
>
> This change modifies ui_select_image_menu() to automatically select the
> image when only one installable entry is found, while preserving the
> dialog for multiple images.
>
> Benefits:
> - Improved user experience for single-image installations
> - Maintains existing behavior for multi-image scenarios
>
> Signed-off-by: Shivaschandra KL <shivaschandra.k-l@siemens.com>
> ---
>   .../deploy-image/files/usr/bin/installer_ui.sh         | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh b/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh
> index 9d3ba5de..133d7c70 100644
> --- a/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh
> +++ b/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh
> @@ -66,7 +66,8 @@ ui_countdown_allow_attended_switch() {
>   # ui_select_image_menu <install_data_dir>
>   #
>   # Uses sys_list_installable_entries backend API and returns selected
> -# relative image path on stdout.
> +# relative image path on stdout. If only one image is available, it is
> +# automatically selected without showing a dialog.
>   #--------------------------------------------------------------------------
>   ui_select_image_menu() {
>       local install_data_dir="$1"
> @@ -83,6 +84,13 @@ ui_select_image_menu() {
>           return 1
>       fi
>   
> +    # If only one image is available, select it automatically
> +    if [ "${#list[@]}" -eq 2 ]; then  # list has pairs: path and description
> +        echo "${list[0]}"
> +        return 0
> +    fi
> +
> +    # Multiple images available, show selection dialog
>       selected=$(dialog --no-tags \
>           --menu "Select image to be installed" 12 70 6 \
>           "${list[@]}" --output-fd 1) || return 2

-- 
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/6e6ed561-dccc-42d7-aeca-8d31b6f23104%40ilbers.de.

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

* [PATCH] installer: Auto-select image when only one is available
@ 2026-07-14 15:11 'Shivaschandra KL' via isar-users
  0 siblings, 0 replies; 3+ messages in thread
From: 'Shivaschandra KL' via isar-users @ 2026-07-14 15:11 UTC (permalink / raw)
  To: isar-users; +Cc: Shivaschandra KL

Currently, the image selection dialog is always shown,
even when only a single image is available. Even when the single
image is availble, first window asks to select image and second window
asks to start installation of same image.No selection required if there
is only one image.

This change modifies ui_select_image_menu() to automatically select the
image when only one installable entry is found, while preserving the
dialog for multiple images.

Benefits:
- Improved user experience for single-image installations
- Maintains existing behavior for multi-image scenarios

Signed-off-by: Shivaschandra KL <shivaschandra.k-l@siemens.com>
---
 .../deploy-image/files/usr/bin/installer_ui.sh         | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh b/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh
index 9d3ba5de..133d7c70 100644
--- a/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh
+++ b/meta-isar/recipes-installer/deploy-image/files/usr/bin/installer_ui.sh
@@ -66,7 +66,8 @@ ui_countdown_allow_attended_switch() {
 # ui_select_image_menu <install_data_dir>
 #
 # Uses sys_list_installable_entries backend API and returns selected
-# relative image path on stdout.
+# relative image path on stdout. If only one image is available, it is
+# automatically selected without showing a dialog.
 #--------------------------------------------------------------------------
 ui_select_image_menu() {
     local install_data_dir="$1"
@@ -83,6 +84,13 @@ ui_select_image_menu() {
         return 1
     fi
 
+    # If only one image is available, select it automatically
+    if [ "${#list[@]}" -eq 2 ]; then  # list has pairs: path and description
+        echo "${list[0]}"
+        return 0
+    fi
+
+    # Multiple images available, show selection dialog
     selected=$(dialog --no-tags \
         --menu "Select image to be installed" 12 70 6 \
         "${list[@]}" --output-fd 1) || return 2
-- 
2.39.2

-- 
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/20260714151127.2855627-1-shivaschandra.k-l%40siemens.com.

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

end of thread, other threads:[~2026-07-29  7:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-15 10:17 [PATCH] installer: Auto-select image when only one is available 'Shivaschandra KL' via isar-users
2026-07-29  7:06 ` Zhihang Wei
  -- strict thread matches above, loose matches on Subject: below --
2026-07-14 15:11 'Shivaschandra KL' via isar-users

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