public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] installer: allow unattended mode to abort with keypress
@ 2025-12-25 21:31 'Badrikesh Prusty' via isar-users
  2025-12-26 11:00 ` 'Jan Kiszka' via isar-users
  0 siblings, 1 reply; 3+ messages in thread
From: 'Badrikesh Prusty' via isar-users @ 2025-12-25 21:31 UTC (permalink / raw)
  To: isar-users; +Cc: Badrikesh Prusty

Add a 5-second countdown before unattended installation starts. Allow
users to abort unattended mode via keypress. Notify all console instances
via a shared file (`/tmp/attended_mode_trigger`) so the abort applies
across all consoles.

Signed-off-by: Badrikesh Prusty <badrikesh.prusty@siemens.com>
---
 RECIPE-API-CHANGELOG.md                           |  6 ++++++
 .../files/usr/bin/deploy-image-wic.sh             | 15 +++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 3af91541..cd1f1fd4 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -941,3 +941,9 @@ 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 interrupted by keypress
+
+Add a 5-second countdown before unattended installation starts. Allow users to
+abort unattended mode via keypress. Notify all console instances via a shared
+file (`/tmp/attended_mode_trigger`) so the abort applies across all consoles.
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..5736a861 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; then
+    abort_file=/tmp/attended_mode_trigger
+    for ((i=5; 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
-- 
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/20251225213157.1219552-1-badrikesh.prusty%40siemens.com.

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

* Re: [PATCH] installer: allow unattended mode to abort with keypress
  2025-12-25 21:31 [PATCH] installer: allow unattended mode to abort with keypress 'Badrikesh Prusty' via isar-users
@ 2025-12-26 11:00 ` 'Jan Kiszka' via isar-users
  2025-12-27 23:18   ` 'Badrikesh Prusty' via isar-users
  0 siblings, 1 reply; 3+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2025-12-26 11:00 UTC (permalink / raw)
  To: Badrikesh Prusty, isar-users

On 25.12.25 22:31, 'Badrikesh Prusty' via isar-users wrote:
> Add a 5-second countdown before unattended installation starts. Allow
> users to abort unattended mode via keypress. Notify all console instances
> via a shared file (`/tmp/attended_mode_trigger`) so the abort applies
> across all consoles.
> 
> Signed-off-by: Badrikesh Prusty <badrikesh.prusty@siemens.com>
> ---
>  RECIPE-API-CHANGELOG.md                           |  6 ++++++
>  .../files/usr/bin/deploy-image-wic.sh             | 15 +++++++++++++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> index 3af91541..cd1f1fd4 100644
> --- a/RECIPE-API-CHANGELOG.md
> +++ b/RECIPE-API-CHANGELOG.md
> @@ -941,3 +941,9 @@ 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 interrupted by keypress
> +
> +Add a 5-second countdown before unattended installation starts. Allow users to
> +abort unattended mode via keypress. Notify all console instances via a shared
> +file (`/tmp/attended_mode_trigger`) so the abort applies across all consoles.
> 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..5736a861 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; then
> +    abort_file=/tmp/attended_mode_trigger
> +    for ((i=5; 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

This should be opt-in, and the timeout may deserve to be configurable.

Jan

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

-- 
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/9f739f14-5318-462e-ac71-fa6a9f4d133f%40web.de.

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

* Re: [PATCH] installer: allow unattended mode to abort with keypress
  2025-12-26 11:00 ` 'Jan Kiszka' via isar-users
@ 2025-12-27 23:18   ` 'Badrikesh Prusty' via isar-users
  0 siblings, 0 replies; 3+ messages in thread
From: 'Badrikesh Prusty' via isar-users @ 2025-12-27 23:18 UTC (permalink / raw)
  To: isar-users


[-- Attachment #1.1: Type: text/plain, Size: 3474 bytes --]

Hi Jan,

Thanks for reviewing. I’ve updated the patch according to your suggestions 
in v2. 
Link: [PATCH v2 1/3] installer: allow unattended mode to abort with 
configurable timeout <https://groups.google.com/g/isar-users/c/6pESivCRSVg>

Many thanks,
Badrikesh
On Friday, December 26, 2025 at 4:30:54 PM UTC+5:30 Jan Kiszka wrote:

> On 25.12.25 22:31, 'Badrikesh Prusty' via isar-users wrote:
> > Add a 5-second countdown before unattended installation starts. Allow
> > users to abort unattended mode via keypress. Notify all console instances
> > via a shared file (`/tmp/attended_mode_trigger`) so the abort applies
> > across all consoles.
> > 
> > Signed-off-by: Badrikesh Prusty <badrikes...@siemens.com>
> > ---
> > RECIPE-API-CHANGELOG.md | 6 ++++++
> > .../files/usr/bin/deploy-image-wic.sh | 15 +++++++++++++++
> > 2 files changed, 21 insertions(+)
> > 
> > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> > index 3af91541..cd1f1fd4 100644
> > --- a/RECIPE-API-CHANGELOG.md
> > +++ b/RECIPE-API-CHANGELOG.md
> > @@ -941,3 +941,9 @@ 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 interrupted by keypress
> > +
> > +Add a 5-second countdown before unattended installation starts. Allow 
> users to
> > +abort unattended mode via keypress. Notify all console instances via a 
> shared
> > +file (`/tmp/attended_mode_trigger`) so the abort applies across all 
> consoles.
> > 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..5736a861 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; then
> > + abort_file=/tmp/attended_mode_trigger
> > + for ((i=5; 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
>
> This should be opt-in, and the timeout may deserve to be configurable.
>
> Jan
>
> > +
> > 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
>
>

-- 
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/b0efdcc6-c1d4-4bf7-b4af-2d9af0d41679n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 4533 bytes --]

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

end of thread, other threads:[~2025-12-27 23:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-25 21:31 [PATCH] installer: allow unattended mode to abort with keypress 'Badrikesh Prusty' via isar-users
2025-12-26 11:00 ` 'Jan Kiszka' via isar-users
2025-12-27 23:18   ` 'Badrikesh Prusty' via isar-users

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