[v2,3/3] kas: add menu option to abort unattended installation

Message ID 20251227231523.1872055-3-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
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(-)

Patch

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
+    "