From patchwork Sat Dec 27 23:15:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Badrikesh Prusty X-Patchwork-Id: 4784 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sun, 28 Dec 2025 00:15:50 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-lj1-f189.google.com (mail-lj1-f189.google.com [209.85.208.189]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 5BRNFncS004984 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 28 Dec 2025 00:15:49 +0100 Received: by mail-lj1-f189.google.com with SMTP id 38308e7fff4ca-37fc5cabe6asf46284001fa.1 for ; Sat, 27 Dec 2025 15:15:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1766877344; cv=pass; d=google.com; s=arc-20240605; b=lMixme+vjgNe0bWqMH8Hpuxj8dJexICbEoAhC7IuAOaua5pjcGXNH3fLCo4Tg6PdcD G5hfQ/JvQprdzd/wFwejTFfJkRYMVq9h/IBDzFU+0zJsYy43yiHJ3sQBj83g/zHxs5iz xjV9UidDjmlhOdYTIs37x5+VM5NZCE7aGEKMxz+KxiS+FdfMU3SLu8qpMfVX+SRD1fQU nGVma5yXF4e7rWGwSRSysaNEY1jFHCONzV/QVDHxSNWuaaW9axOeZ3+3ijvi61SyNQ2l q/OJevG4gkn9fbrd5zD6fzygleTEVsQmEnjPEUQprhALOKTHMdFHYGmWGVzsXJyIXhTY D1Sg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=M+xj+lZIBwwMbCp5HUYScITOThaAtx1PS2xLveQq1Wc=; fh=3UWTbr2dB505cADvJ5IvGO6iaCD88uB6Jig4j+o0zrc=; b=bYokntRGtVqVWR9N0kpIKm537L7UiEjbeiux/u5VZixZOEksLlhvh2MFBzg+6fplik mty42J4NGmGuMv8Od2fUYF+exxgZ+HiY8I2melA/DEHsQknJmSJnCIUpRic+f/qh6kHi VYyE+qMXxZy+DU05c8mteN9b29ZAcC2TehBoOJMSslhsLcUuB/ZOB4NMg22e3MJg+MHS UMfp3B22cl8NpkIyhfpj+/y4LpnMDDp5Nqu+BErxmtjxuw/bQeWjxZ5lnG9AXujfua2z x3GcP6f3qGnfKMfeA23YSf8AFJliPtP0F9VooKsv/ZdUsf9P4gr3NsgB4LxX8S2bfreX T2Hw==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=bgsLpTiT; spf=pass (google.com: domain of fm-1328765-2025122723154071efde30ae000207a1-qd_k_r@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-1328765-2025122723154071efde30ae000207a1-QD_k_r@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1766877344; x=1767482144; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=M+xj+lZIBwwMbCp5HUYScITOThaAtx1PS2xLveQq1Wc=; b=RbPFsNLIARHJrGQusZWZhL0wpO8Lwm5pFcOgM8IQkcVEk5y+45sTY8ZHTTwpC+FyOr LesewL8u6RmNkqqBRoflqDW197rx72SGF4siWI6NV50ZLqiQGWCmK4dRp4myKY1jzxnv JKJ1ciHo/iHvkIVVhlecC3ZwbXsFqSyDapC/KzdlX8+ByiA++ylS3zqCoH46w6C1oTcT 70hH+YdlkMT2vE8bHNYiyj5IBpHM086lU9yzgOMGqOhkndU+/0mi3VV5JMXuwO1/g0FV E2aH4CWDxhX1qYrbeS9s81oi/C8VrkIcDJQ6R5RTvsPirSwjTX0ugR/vXY4cM/aAH5/d 607Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766877344; x=1767482144; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:message-id:date:subject:cc:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=M+xj+lZIBwwMbCp5HUYScITOThaAtx1PS2xLveQq1Wc=; b=l7PxypL95zMOh9HEzYhIAqgJjYAvTnxTfvf+CNSXYK8iJ9v/GiRHO7qfQidHDc77qc uKtxr4ZLFbnu0ul5YGMTXntZvtvHOWUPSmmO5BhXieeErKnX/MG84IREMUVZl/VkvHHr 8p3XNhqh0udulfTaQvYw45c+r41oCr6IgbFRd/3u4tSLvPSOs/+LUqntT+epvQyPzPRl NQqlWu9bHiU+CS7w2unlMYw97QawL+dSmAYCOyjNYBuEbEgvbaUtCuxf+XFxlTDOGm7V Yi/o7eMAkDUeoxPF2Fp48HJq9h6soxIaVPh+K8I9oi5GW/TkwLbkbSm3IsjvcFiUUMJl Ap1A== X-Forwarded-Encrypted: i=2; AJvYcCViM8MbEtLwvRGr+/Mw+qDz/n45NcV6yUhjpETZnpRcOCbyOemMaQYpVP9blAPHgqaaVr0oE/A=@isar-build.org X-Gm-Message-State: AOJu0Ywb298NJsvhXRefeEVJZXkPZ//rTO0eXDVu8ilOIkpsUYRfPUZb qfhVMZ75YBODE4SaeROdN/iLbai7jhvFSFT/whJw8hvruWuQTx2TMvfk X-Google-Smtp-Source: AGHT+IH2GfQfgmX/oKo8BnmF4OTuxZWclwFmU0jwe73vtrORfYRyLLbMYK6t4J3cX6Tpjxc9qCCszA== X-Received: by 2002:a2e:bd82:0:b0:37f:a813:b073 with SMTP id 38308e7fff4ca-3812158e17cmr76983431fa.12.1766877343715; Sat, 27 Dec 2025 15:15:43 -0800 (PST) X-BeenThere: isar-users@googlegroups.com; h="AWVwgWauz0q/nrwj3Cg2QUF8KZF5+gjmYTNiKxIwUKp5JA6TwQ==" Received: by 2002:a2e:9087:0:b0:37a:7d5e:db6e with SMTP id 38308e7fff4ca-3827a5d8ce9ls545161fa.2.-pod-prod-05-eu; Sat, 27 Dec 2025 15:15:41 -0800 (PST) X-Received: by 2002:a05:651c:154a:b0:37f:d484:599c with SMTP id 38308e7fff4ca-3812161d75bmr84077621fa.28.1766877341011; Sat, 27 Dec 2025 15:15:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1766877341; cv=none; d=google.com; s=arc-20240605; b=Gv0rqYHlXVskC4XtIkxIvs8Txab1LpiRmUkSbLg1z5hqUF9H4I2OpSVbfmCnrNT9kZ 5sfu+8OBkxeggZ9udj16HWBQUoeaIzYoLQItKA9bDAfemkuYi498LCd/Vf8kQUO8iR63 8Vfu0tQaOb+KtVsqfv0SNtNAvAqJQmfNVQPkatBlzMihSw1Uohtz09H+68DTUvc9p4Bq NjMDW/zjhykUMlJ7Sqb9x+xrwkBwlfeM5+MTiI2FaDuL8mHxNDWITVHYp1ujyYJw4SMp kVdl/emQ/BAXiuFAS77PBDS32uuD9gRDvkYgyznhpQj6ndyTQZrQ6ywyGB37E/rRMYRx bbrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:message-id:date :subject:cc:to:from:dkim-signature; bh=Xcf2tVRf8uhABs/s2b6feM+kUEUVh0JQFwH+VJFUum8=; fh=CDeBDv9IQfg1Uqj+VuSvVE7/o4UN7UYiPFWb+Zzs/N4=; b=KHiv9Yoe3OSO33fE6ZRgjrGRv0Is2Ldo9zgmkfv+zLY/qTLSLhHbr9EBT0Nf3+Rfaw 0s5oGk4YuFudmUKMleGhjHgBvKGHswGd6yWOIwbnt6M+Prb4//D350jJmfTQVIxy1p/c MMay6jj61CTBYbJbt21C7UklgAsLJTsGHcbK95YtEiw1/c6NfEUNriAM7zuexG6BJalh mWtgWOdDycgslSjHtggmlySXAtUsrSXQRMD/Wsg1aX4hjHPPA6rxLkxXqX7wgFINkWoI C1JtmdRV6SqjvtytbM9KH+izckcxbux9ONjtF7lc+YAX2nJXxzFk5JSoE45zslTb/HSi xSPw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=bgsLpTiT; spf=pass (google.com: domain of fm-1328765-2025122723154071efde30ae000207a1-qd_k_r@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-1328765-2025122723154071efde30ae000207a1-QD_k_r@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net. [185.136.65.226]) by gmr-mx.google.com with ESMTPS id 38308e7fff4ca-381225eaa06si2718821fa.4.2025.12.27.15.15.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Dec 2025 15:15:40 -0800 (PST) Received-SPF: pass (google.com: domain of fm-1328765-2025122723154071efde30ae000207a1-qd_k_r@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) client-ip=185.136.65.226; Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 2025122723154071efde30ae000207a1 for ; Sun, 28 Dec 2025 00:15:40 +0100 X-Patchwork-Original-From: "'Badrikesh Prusty' via isar-users" From: Badrikesh Prusty To: isar-users@googlegroups.com Cc: jan.kiszka@siemens.com, Badrikesh Prusty Subject: [PATCH v2 1/3] installer: allow unattended mode to abort with configurable timeout Date: Sat, 27 Dec 2025 18:15:21 -0500 Message-ID: <20251227231523.1872055-1-badrikesh.prusty@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1328765:519-21489:flowmailer X-Original-Sender: badrikesh.prusty@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=bgsLpTiT; spf=pass (google.com: domain of fm-1328765-2025122723154071efde30ae000207a1-qd_k_r@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-1328765-2025122723154071efde30ae000207a1-QD_k_r@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Badrikesh Prusty Reply-To: Badrikesh Prusty Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,RCVD_IN_RP_CERTIFIED, RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= 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= 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 --- 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=` 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)