[PATCH] installer: skip image selection when only one image is available

Skip to first unread message

Kasturi shekar

unread,
Jul 15, 2026, 6:21:44 AMJul 15
to isar-...@googlegroups.com, Kasturi Shekar
From: Kasturi Shekar <kasturi...@siemens.com>

In attended mode, auto-select the installable image when exactly one
image is found on the installation media. keep the image selection
dialog only for cases where multiple installable images are available.

Signed-off-by: Kasturi Shekar <kasturi...@siemens.com>
---
.../files/usr/bin/deploy-image-wic.sh | 34 ++++++++++++++-----
1 file changed, 26 insertions(+), 8 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 42107d16..475b1814 100644
--- 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
@@ -34,25 +34,43 @@ flow_run_attended() {
local selected_image
local selected_target
local target_device_size
+ local installable_images=()
+ local installable_image

# In attended mode, prefer to ask the user for the image selection.
# Only use installer_image_uri when it was explicitly configured.

if [ -z "$installer_image_uri" ] || [ ! -f "$installdata/$installer_image_uri" ]; then
- selected_image=$(ui_select_image_menu "$installdata")
- case $? in
+ while IFS= read -r installable_image; do
+ [ -n "$installable_image" ] || continue
+ installable_images+=("$installable_image")
+ done < <(sys_list_installable_entries "$installdata")
+
+ case "${#installable_images[@]}" in
0)
- installer_image_uri="$selected_image"
- ;;
- 1)
ui_show_error "Could not find an image to install. Installation aborted."
return 1
;;
- 2)
- return 2
+ 1)
+ installer_image_uri="${installable_images[0]}"
;;
*)
- return 1
+ selected_image=$(ui_select_image_menu "$installdata")
+ case $? in
+ 0)
+ installer_image_uri="$selected_image"
+ ;;
+ 1)
+ ui_show_error "Could not find an image to install. Installation aborted."
+ return 1
+ ;;
+ 2)
+ return 2
+ ;;
+ *)
+ return 1
+ ;;
+ esac
;;
esac
fi
--
2.47.3

Zhihang Wei

unread,
Jul 29, 2026, 3:07:14 AM (7 days ago) Jul 29
to Kasturi shekar, isar-...@googlegroups.com
Applied to next, thanks.

Zhihang
Reply all
Reply to author
Forward
0 new messages