[v2,2/3] kas: support bundling multiple images via menu system

Message ID 20251227231523.1872055-2-badrikesh.prusty@siemens.com
State Under Review
Headers show
Series [v2,1/3] installer: allow unattended mode to abort with configurable timeout | expand

Commit Message

Badrikesh Prusty Dec. 27, 2025, 11:15 p.m. UTC
Update kas menu system configuration to support bundling multiple target
images instead of selecting a single image.

Replace the exclusive choice with independent bundle options for Base, CI,
and Debug images. Expose each selected bundle as a string var so the chosen
images are available to BitBake and appended to INSTALLER_TARGET_IMAGES.

Show a menu hint when no images are bundled, indicating that no installer
payload is generated and images must be copied manually to the INSTALLDATA
partition.

Update unattended installation menu logic to:
* Allow unattended mode only when at least one image is bundled
* Select which bundled image is installed in unattended mode

Signed-off-by: Badrikesh Prusty <badrikesh.prusty@siemens.com>
---
 kas/image/isar-image-installer.yaml |  5 ++
 kas/installer/Kconfig               | 75 ++++++++++++++++++++---------
 2 files changed, 57 insertions(+), 23 deletions(-)

Patch

diff --git a/kas/image/isar-image-installer.yaml b/kas/image/isar-image-installer.yaml
index 336b3942..3997a162 100644
--- a/kas/image/isar-image-installer.yaml
+++ b/kas/image/isar-image-installer.yaml
@@ -17,3 +17,8 @@  local_conf_header:
     TARGET_BOOTSTRAPPER_TASK_deploy-image[script] ?= "deploy-image-wic.sh"
     TARGET_BOOTSTRAPPER_TASK_deploy-image[workdir] ?= "/usr/bin"
     TARGET_BOOTSTRAPPER_TASK_deploy-image[effort] ?= "2"
+
+  installer_target_images: |
+    INSTALLER_TARGET_IMAGES += " ${@d.getVar('INSTALLER_TARGET_IMAGE_BASE') or ''}"
+    INSTALLER_TARGET_IMAGES += " ${@d.getVar('INSTALLER_TARGET_IMAGE_CI') or ''}"
+    INSTALLER_TARGET_IMAGES += " ${@d.getVar('INSTALLER_TARGET_IMAGE_DEBUG') or ''}"
diff --git a/kas/installer/Kconfig b/kas/installer/Kconfig
index 5e733f9e..23b6f03a 100644
--- a/kas/installer/Kconfig
+++ b/kas/installer/Kconfig
@@ -7,42 +7,42 @@  config KAS_INCLUDE_IMAGE
 	string
 	default "kas/image/isar-image-installer.yaml"
 
-choice
-	prompt "Image to install"
-	default INSTALL_IMAGE_BASE
+comment "Images to bundle"
 
-config INSTALL_IMAGE_BASE
+config BUNDLE_IMAGE_BASE
 	bool "Base image"
+	default y
 	help
 	  Embed the basic Isar image into the installer image.
 
-config INSTALL_IMAGE_CI
+config BUNDLE_IMAGE_CI
 	bool "CI image"
 	help
 	  Embed the Isar CI image into the installer image.
 
-config INSTALL_IMAGE_DEBUG
+config BUNDLE_IMAGE_DEBUG
 	bool "Debug image"
 	help
 	  Embed the Isar debug image into the installer image.
 
-config INSTALL_EMPTY
-	bool "No installer payload"
-	help
-	  This will generate a installer image without payload. The user of
-	  that image needs then to copy a image to the partition labeled
-	  INSTALLDATA.
+comment "No installer payload. Copy image(s) manually to the INSTALLDATA partition"
+	depends on !BUNDLE_IMAGE_BASE && !BUNDLE_IMAGE_CI && !BUNDLE_IMAGE_DEBUG
 
-endchoice
+config INSTALL_UNATTENDED
+	bool "Run installer unattended"
+	depends on BUNDLE_IMAGE_BASE || BUNDLE_IMAGE_CI || BUNDLE_IMAGE_DEBUG
 
-config INSTALLER_TARGET_IMAGE
+config INSTALLER_TARGET_IMAGE_BASE
 	string
-	default "isar-image-base" if INSTALL_IMAGE_BASE
-	default "isar-image-ci" if INSTALL_IMAGE_CI
-	default "isar-image-debug" if INSTALL_IMAGE_DEBUG
+	default "isar-image-base" if BUNDLE_IMAGE_BASE
 
-config INSTALL_UNATTENDED
-	bool "Run installer unattended"
+config INSTALLER_TARGET_IMAGE_CI
+	string
+	default "isar-image-ci" if BUNDLE_IMAGE_CI
+
+config INSTALLER_TARGET_IMAGE_DEBUG
+	string
+	default "isar-image-debug" if BUNDLE_IMAGE_DEBUG
 
 if INSTALL_UNATTENDED
 
@@ -55,6 +55,36 @@  config INSTALLER_UNATTENDED
 	default "1" if INSTALL_UNATTENDED
 	default ""
 
+choice
+	prompt "Image to install unattended"
+
+config INSTALL_IMAGE_BASE
+	bool "Base image"
+	depends on BUNDLE_IMAGE_BASE
+	help
+	  Install the basic Isar image in unattended mode.
+
+config INSTALL_IMAGE_CI
+	bool "CI image"
+	depends on BUNDLE_IMAGE_CI
+	help
+	  Install the Isar CI image in unattended mode.
+
+config INSTALL_IMAGE_DEBUG
+	bool "Debug image"
+	depends on BUNDLE_IMAGE_DEBUG
+	help
+	  Install the Isar debug image in unattended mode.
+
+endchoice
+
+config INSTALLER_TARGET_IMAGE
+	string
+	default "isar-image-base" if INSTALL_IMAGE_BASE
+	default "isar-image-ci" if INSTALL_IMAGE_CI
+	default "isar-image-debug" if INSTALL_IMAGE_DEBUG
+
+
 config INSTALLER_TARGET_DEVICE
 	string "Target device to deploy"
 	default "/dev/sda"
@@ -76,13 +106,12 @@  config OPT_INSTALLER_TARGET_ABORT
 endchoice
 
 config INSTALLER_TARGET_OVERWRITE
-    string
-    default "OVERWRITE" if OPT_INSTALLER_TARGET_OVERWRITE
-    default "ABORT" if OPT_INSTALLER_TARGET_ABORT
+	string
+	default "OVERWRITE" if OPT_INSTALLER_TARGET_OVERWRITE
+	default "ABORT" if OPT_INSTALLER_TARGET_ABORT
 
 endif
 
-
 config INSTALLER_ADD_DEVICE_INFO_COLLECTOR
         bool "Add Device Info Collector"
         default n