From: "'Heinisch, Alexander' via isar-users" <isar-users@googlegroups.com>
To: "Shekar, Kasturi" <kasturi.shekar@siemens.com>,
"isar-users@googlegroups.com" <isar-users@googlegroups.com>
Subject: Re: [PATCH] isar-installer: run installer under agetty and reboot via EXIT trap
Date: Tue, 21 Oct 2025 11:17:16 +0000 [thread overview]
Message-ID: <5e3dfe3948d0978d3c6c0e56ecf13df517082db1.camel@siemens.com> (raw)
In-Reply-To: <20251021042201.1184698-1-kasturi.shekar@siemens.com>
I doubt this patch can be applied onto next.
On next deploy-image-service already got replaced by target-
bootstraper-service - Still, the invocation is similar.
Link to source:
https://github.com/ilbers/isar/tree/next/meta-isar/recipes-installer/target-bootstrapper-service
and the corresponding thread on the mailinglist:
https://groups.google.com/g/isar-users/c/fP88xwMFQuQ/m/d2Rz3TKIBgAJ
BR Alexander
On Tue, 2025-10-21 at 09:52 +0530, 'Kasturi Shekar' via isar-users
wrote:
> the deploy-image service was directly invoked the installer
> script, which could result in the script running without a properly
> configured TTY or missing TERM environment variable. This was
> observed
> when bypassing agetty during service startup
>
> now we launch the installer under agetty to ensure that it runs in a
> fully initialized terminal environment. Since the service is now
> managed
> by agetty, we ensure that the system reboots once the installation
> completes (successfully or not) by adding a trap handler.
>
> Signed-off-by: Kasturi Shekar <kasturi.shekar@siemens.com>
> ---
> .../deploy-image-service/files/install.override.conf | 2 +-
> .../deploy-image/files/usr/bin/deploy-image-wic.sh | 12
> ++++++++++++
> 2 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/meta-isar/recipes-installer/deploy-image-
> service/files/install.override.conf b/meta-isar/recipes-
> installer/deploy-image-service/files/install.override.conf
> index 357d8662..913efac5 100644
> --- a/meta-isar/recipes-installer/deploy-image-
> service/files/install.override.conf
> +++ b/meta-isar/recipes-installer/deploy-image-
> service/files/install.override.conf
> @@ -1,5 +1,5 @@
> [Service]
> ExecStart=
> -ExecStart=/bin/sh -c "deploy-image-wic.sh || (echo 'Rebooting in 60
> s'; sleep 60); reboot"
> +ExecStart=-/sbin/agetty -o --noclear -a root -l /usr/bin/deploy-
> image-wic.sh --keep-baud 115200,38400,9600 %I $TERM
> StandardInput=tty
> StandardOutput=tty
> 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 333762f1..7618a810 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
> @@ -3,6 +3,18 @@
> # Copyright (C) Siemens AG, 2024
> #
> # SPDX-License-Identifier: MIT
> +trap reboot_on_exit EXIT
> +
> +reboot_on_exit() {
> + status=$?
> + if [ $status -eq 0 ]; then
> + echo "Installation completed successfully. Rebooting..."
> + else
> + echo "Installation failed. Rebooting in 60 seconds..."
> + sleep 60
> + fi
> + exec reboot
> +}
>
> installdata=${INSTALL_DATA:-/install}
>
> --
> 2.39.5
>
--
Alexander Heinisch
Siemens AG
www.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/5e3dfe3948d0978d3c6c0e56ecf13df517082db1.camel%40siemens.com.
prev parent reply other threads:[~2025-10-21 11:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-21 4:22 'Kasturi Shekar' via isar-users
2025-10-21 11:17 ` 'Heinisch, Alexander' via isar-users [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5e3dfe3948d0978d3c6c0e56ecf13df517082db1.camel@siemens.com \
--to=isar-users@googlegroups.com \
--cc=alexander.heinisch@siemens.com \
--cc=kasturi.shekar@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox