public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2 1/3] installer: allow unattended mode to abort with configurable timeout
@ 2025-12-27 23:15 'Badrikesh Prusty' via isar-users
  2025-12-27 23:15 ` [PATCH v2 2/3] kas: support bundling multiple images via menu system 'Badrikesh Prusty' via isar-users
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: 'Badrikesh Prusty' via isar-users @ 2025-12-27 23:15 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, Badrikesh Prusty

Enable users to abort unattended installations before they start by setting
INSTALLER_UNATTENDED_ABORT_ENABLE. Set an optional countdown timeout with
INSTALLER_UNATTENDED_ABORT_TIMEOUT (default 5 seconds).

Automatically append installer.unattended.abort.enable and
installer.unattended.abort.timeout=<timeout-in-seconds> to the kernel
command line only when the feature is enabled.

Abort unattended mode via keypress and switch to normal installation mode,
notifying all consoles via a shared file /tmp/attended_mode_trigger.

Signed-off-by: Badrikesh Prusty <badrikesh.prusty@siemens.com>
---
 RECIPE-API-CHANGELOG.md                       | 21 +++++++++++++++++++
 .../images/isar-image-installer.bb            |  7 +++++++
 .../files/usr/bin/deploy-image-wic.sh         | 15 +++++++++++++
 .../usr/lib/deploy-image-wic/handle-config.sh | 14 ++++++++++++-
 4 files changed, 56 insertions(+), 1 deletion(-)

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 3af91541..0bad8a44 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -941,3 +941,24 @@ Example: To bundle multiple target images, set the following in local.conf:
 ```
 INSTALLER_TARGET_IMAGES = "isar-image-base isar-image-debug isar-image-ci"
 ```
+
+### Allow unattended installation to be aborted with configurable timeout
+
+Enable users to abort unattended installations before they start by setting
+`INSTALLER_UNATTENDED_ABORT_ENABLE = 1`. Set the optional countdown timeout
+with `INSTALLER_UNATTENDED_ABORT_TIMEOUT` (default 5 seconds).
+
+Automatically append `installer.unattended.abort.enable` and
+`installer.unattended.abort.timeout=<timeout-in-seconds>` to the kernel
+command line only when the feature is enabled.
+
+Abort unattended mode via keypress and switch to normal installation mode.
+Notify all console instances via a shared file `/tmp/attended_mode_trigger`.
+
+Opt-in: Add the following to local.conf to enable the feature:
+```
+INSTALLER_UNATTENDED_ABORT_ENABLE = "1"
+
+# Optional: set countdown timeout in seconds (default 5)
+INSTALLER_UNATTENDED_ABORT_TIMEOUT = "5"
+```
diff --git a/meta-isar/recipes-core/images/isar-image-installer.bb b/meta-isar/recipes-core/images/isar-image-installer.bb
index 3511f3f6..929939af 100644
--- a/meta-isar/recipes-core/images/isar-image-installer.bb
+++ b/meta-isar/recipes-core/images/isar-image-installer.bb
@@ -21,6 +21,13 @@ ADDITIONAL_KERNEL_CMDLINE:append:unattended-installer = " \
     installer.target.overwrite=${INSTALLER_TARGET_OVERWRITE} \
     "
 
+INSTALLER_UNATTENDED_ABORT_TIMEOUT ??= "5"
+ADDITIONAL_KERNEL_CMDLINE:append:unattended-installer = " \
+    ${@' installer.unattended.abort.enable \
+        installer.unattended.abort.timeout=%s' % d.getVar('INSTALLER_UNATTENDED_ABORT_TIMEOUT') \
+        if d.getVar('INSTALLER_UNATTENDED_ABORT_ENABLE') == '1' else ''} \
+"
+
 IMAGER_INSTALL:wic:append = " ${SYSTEMD_BOOTLOADER_INSTALL}"
 
 IMAGE_INSTALL += "target-bootstrapper-service"
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 9bd47e9f..ca586aa6 100755
--- 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
@@ -10,6 +10,21 @@ SCRIPT_DIR=$( dirname -- "$( readlink -f -- "$0"; )"; )
 
 . "${SCRIPT_DIR}/../lib/deploy-image-wic/handle-config.sh"
 
+if [ "$installer_unattended" = true ] && [ "$installer_unattended_abort_enable" = true ]; then
+    abort_file=/tmp/attended_mode_trigger
+    for ((i=$installer_unattended_abort_timeout; i>0; i--)); do
+        echo -ne "\rUnattended installation will start in $i seconds. Press any key to switch to attended mode..."
+
+	# Switch to attended mode if the abort file exists or any key pressed during countdown
+	# Create abort file to notify all other console instances to abort
+        if [ -f "$abort_file" ] || read -n 1 -t 1; then
+            installer_unattended=false
+            touch "$abort_file"
+            break
+        fi
+    done
+fi
+
 if ! $installer_unattended; then
     installer_image_uri=$(find "$installdata" -type f -iname "*.wic*" -a -not -iname "*.wic.bmap" -exec basename {} \;)
     if [ -z "$installer_image_uri" ] || [ ! -f "$installdata/$installer_image_uri" ]; then
diff --git a/meta-isar/recipes-installer/deploy-image/files/usr/lib/deploy-image-wic/handle-config.sh b/meta-isar/recipes-installer/deploy-image/files/usr/lib/deploy-image-wic/handle-config.sh
index 26b2966e..78c2bc12 100644
--- a/meta-isar/recipes-installer/deploy-image/files/usr/lib/deploy-image-wic/handle-config.sh
+++ b/meta-isar/recipes-installer/deploy-image/files/usr/lib/deploy-image-wic/handle-config.sh
@@ -5,6 +5,8 @@
 # SPDX-License-Identifier: MIT
 
 installer_unattended=false
+installer_unattended_abort_enable=false
+installer_unattended_abort_timeout=5
 installer_image_uri=
 installer_target_dev=
 installer_target_overwrite=
@@ -14,6 +16,8 @@ if [ -f "$installdata/auto.install" ]; then
     read -r installer_image_uri <&3
     read -r installer_target_dev <&3
     read -r installer_target_overwrite <&3
+    read -r installer_unattended_abort_enable <&3
+    read -r installer_unattended_abort_timeout <&3
     exec 3>&-
 
     installer_unattended=true
@@ -22,7 +26,7 @@ fi
 # But let kernel cmdline overrule
 for x in $(cat /proc/cmdline); do
     case $x in
-        installer.unattended*)
+        installer.unattended)
             installer_unattended=true
         ;;
         installer.image.uri=*)
@@ -45,6 +49,12 @@ for x in $(cat /proc/cmdline); do
             installer_target_overwrite="OVERWRITE"
             installer_unattended=true
         ;;
+        installer.unattended.abort.enable)
+            installer_unattended_abort_enable=true
+        ;;
+        installer.unattended.abort.timeout=*)
+            installer_unattended_abort_timeout=${x#installer.unattended.abort.timeout=}
+        ;;
     esac
 done
 
@@ -65,6 +75,8 @@ if ${installer_unattended}; then
     echo "  installer_image_uri=${installer_image_uri}"
     echo "  installer_target_dev=${installer_target_dev}"
     echo "  installer_target_overwrite=${installer_target_overwrite}"
+    echo "  installer_unattended_abort_enable=${installer_unattended_abort_enable}"
+    echo "  installer_unattended_abort_timeout=${installer_unattended_abort_timeout}"
 
     case ${installer_target_overwrite} in
         OVERWRITE|ABORT)
-- 
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/20251227231523.1872055-1-badrikesh.prusty%40siemens.com.

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

* [PATCH v2 2/3] kas: support bundling multiple images via menu system
  2025-12-27 23:15 [PATCH v2 1/3] installer: allow unattended mode to abort with configurable timeout 'Badrikesh Prusty' via isar-users
@ 2025-12-27 23:15 ` 'Badrikesh Prusty' via isar-users
  2025-12-27 23:15 ` [PATCH v2 3/3] kas: add menu option to abort unattended installation 'Badrikesh Prusty' via isar-users
  2026-01-07 12:41 ` [PATCH v2 1/3] installer: allow unattended mode to abort with configurable timeout Anton Mikanovich
  2 siblings, 0 replies; 4+ messages in thread
From: 'Badrikesh Prusty' via isar-users @ 2025-12-27 23:15 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, Badrikesh Prusty

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(-)

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
-- 
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/20251227231523.1872055-2-badrikesh.prusty%40siemens.com.

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

* [PATCH v2 3/3] kas: add menu option to abort unattended installation
  2025-12-27 23:15 [PATCH v2 1/3] installer: allow unattended mode to abort with configurable timeout 'Badrikesh Prusty' via isar-users
  2025-12-27 23:15 ` [PATCH v2 2/3] kas: support bundling multiple images via menu system 'Badrikesh Prusty' via isar-users
@ 2025-12-27 23:15 ` 'Badrikesh Prusty' via isar-users
  2026-01-07 12:41 ` [PATCH v2 1/3] installer: allow unattended mode to abort with configurable timeout Anton Mikanovich
  2 siblings, 0 replies; 4+ messages in thread
From: 'Badrikesh Prusty' via isar-users @ 2025-12-27 23:15 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, Badrikesh Prusty

Add a Kconfig menu option to allow users to abort unattended installation
before it starts.

Use OPT_INSTALLER_UNATTENDED_ABORT_ENABLE (bool) to enable the feature
and INSTALLER_UNATTENDED_ABORT_TIMEOUT (string) to set the countdown.

Weakly assign INSTALLER_UNATTENDED_ABORT_ENABLE to 0 in unattended.yaml
so the feature is disabled by default and can be enabled via menu system.

Signed-off-by: Badrikesh Prusty <badrikesh.prusty@siemens.com>
---
 kas/installer/Kconfig         | 19 +++++++++++++++++++
 kas/installer/unattended.yaml |  3 ++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/kas/installer/Kconfig b/kas/installer/Kconfig
index 23b6f03a..9b74fa92 100644
--- a/kas/installer/Kconfig
+++ b/kas/installer/Kconfig
@@ -110,6 +110,25 @@ config INSTALLER_TARGET_OVERWRITE
 	default "OVERWRITE" if OPT_INSTALLER_TARGET_OVERWRITE
 	default "ABORT" if OPT_INSTALLER_TARGET_ABORT
 
+config OPT_INSTALLER_UNATTENDED_ABORT_ENABLE
+	bool "Allow aborting unattended installation"
+	help
+	  Allow users to abort unattended installation before it starts by
+	  pressing a key during a configurable timeout, switching to normal
+	  installation mode.
+
+config INSTALLER_UNATTENDED_ABORT_ENABLE
+	string
+	default "1" if OPT_INSTALLER_UNATTENDED_ABORT_ENABLE
+
+config INSTALLER_UNATTENDED_ABORT_TIMEOUT
+	string "Unattended abort timeout (seconds)"
+	depends on OPT_INSTALLER_UNATTENDED_ABORT_ENABLE
+	default "5"
+	help
+	  Set the number of seconds users have to press a key to abort
+	  unattended installation and switch to normal installation mode.
+
 endif
 
 config INSTALLER_ADD_DEVICE_INFO_COLLECTOR
diff --git a/kas/installer/unattended.yaml b/kas/installer/unattended.yaml
index 21beac0a..ee585c47 100644
--- a/kas/installer/unattended.yaml
+++ b/kas/installer/unattended.yaml
@@ -9,10 +9,11 @@ header:
 local_conf_header:
   target_bootstrapper_deploy-image: |
     INSTALLER_UNATTENDED = "1"
+    INSTALLER_UNATTENDED_ABORT_ENABLE ?= "0"
     INSTALLER_TARGET_DEVICE ?= "/dev/sda:/dev/nvme0n1"
     INSTALLER_TARGET_OVERWRITE ?= "OVERWRITE"
 
   target_bootstrapper-tty: |
     TARGET_BOOTSTRAPPER_TTY_SERVICES ?= "\
         serial-getty@ttyS0 \
-    "
\ No newline at end of file
+    "
-- 
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/20251227231523.1872055-3-badrikesh.prusty%40siemens.com.

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

* Re: [PATCH v2 1/3] installer: allow unattended mode to abort with configurable timeout
  2025-12-27 23:15 [PATCH v2 1/3] installer: allow unattended mode to abort with configurable timeout 'Badrikesh Prusty' via isar-users
  2025-12-27 23:15 ` [PATCH v2 2/3] kas: support bundling multiple images via menu system 'Badrikesh Prusty' via isar-users
  2025-12-27 23:15 ` [PATCH v2 3/3] kas: add menu option to abort unattended installation 'Badrikesh Prusty' via isar-users
@ 2026-01-07 12:41 ` Anton Mikanovich
  2 siblings, 0 replies; 4+ messages in thread
From: Anton Mikanovich @ 2026-01-07 12:41 UTC (permalink / raw)
  To: Badrikesh Prusty, isar-users; +Cc: jan.kiszka

Applied patchset to next, thanks.

28/12/2025 01:15, 'Badrikesh Prusty' via isar-users wrote:
> Enable users to abort unattended installations before they start by setting
> INSTALLER_UNATTENDED_ABORT_ENABLE. Set an optional countdown timeout with
> INSTALLER_UNATTENDED_ABORT_TIMEOUT (default 5 seconds).
>
> Automatically append installer.unattended.abort.enable and
> installer.unattended.abort.timeout=<timeout-in-seconds> to the kernel
> command line only when the feature is enabled.
>
> Abort unattended mode via keypress and switch to normal installation mode,
> notifying all consoles via a shared file /tmp/attended_mode_trigger.
>
> Signed-off-by: Badrikesh Prusty <badrikesh.prusty@siemens.com>

-- 
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/399d79be-6052-46b0-9100-47a7d2a04a35%40ilbers.de.

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

end of thread, other threads:[~2026-01-07 12:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-27 23:15 [PATCH v2 1/3] installer: allow unattended mode to abort with configurable timeout 'Badrikesh Prusty' via isar-users
2025-12-27 23:15 ` [PATCH v2 2/3] kas: support bundling multiple images via menu system 'Badrikesh Prusty' via isar-users
2025-12-27 23:15 ` [PATCH v2 3/3] kas: add menu option to abort unattended installation 'Badrikesh Prusty' via isar-users
2026-01-07 12:41 ` [PATCH v2 1/3] installer: allow unattended mode to abort with configurable timeout Anton Mikanovich

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