[PATCH] installer: Auto-select image when only one is available

14 views
Skip to first unread message

Shivaschandra KL

unread,
Jul 15, 2026, 6:31:05 AM (10 days ago) Jul 15
to isar-...@googlegroups.com, 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 <shivasch...@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

Shivaschandra KL

unread,
Jul 15, 2026, 6:31:06 AM (10 days ago) Jul 15
to isar-...@googlegroups.com, Shivaschandra KL
Reply all
Reply to author
Forward
0 new messages