public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Shivaschandra KL' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: Shivaschandra KL <shivaschandra.k-l@siemens.com>
Subject: [PATCH] installer: Auto-select image when only one is available
Date: Wed, 15 Jul 2026 06:17:48 -0400	[thread overview]
Message-ID: <20260715101748.2873544-1-shivaschandra.k-l@siemens.com> (raw)

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.

             reply	other threads:[~2026-07-15 10:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15 10:17 'Shivaschandra KL' via isar-users [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260715101748.2873544-1-shivaschandra.k-l@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=shivaschandra.k-l@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox