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

From: Kasturi Shekar <kasturi.shekar@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.shekar@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

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

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

* Re: [PATCH] installer: skip image selection when only one image is available
  2026-07-15 10:14 [PATCH] installer: skip image selection when only one image is available 'Kasturi shekar' via isar-users
@ 2026-07-29  7:07 ` Zhihang Wei
  0 siblings, 0 replies; 2+ messages in thread
From: Zhihang Wei @ 2026-07-29  7:07 UTC (permalink / raw)
  To: Kasturi shekar, isar-users

Applied to next, thanks.

Zhihang

On 7/15/26 12:14, 'Kasturi shekar' via isar-users wrote:
> From: Kasturi Shekar <kasturi.shekar@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.shekar@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

-- 
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/6cff2680-49b2-4406-96ea-76b0c731b00a%40ilbers.de.

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-15 10:14 [PATCH] installer: skip image selection when only one image is available 'Kasturi shekar' via isar-users
2026-07-29  7:07 ` Zhihang Wei

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