From: Uladzimir Bely <ubely@ilbers.de>
To: Jan Kiszka <jan.kiszka@siemens.com>, isar-users@googlegroups.com
Subject: Re: [PATCH v3 4/4] installer: Run unattended mode on the only terminal
Date: Wed, 19 Mar 2025 12:15:40 +0300 [thread overview]
Message-ID: <65b10c049f59096a66d835faa17ae13948e8056d.camel@ilbers.de> (raw)
In-Reply-To: <dfa10699-01e4-4ca4-9990-9d9882ee4b30@siemens.com>
On Tue, 2025-03-18 at 22:39 +0100, Jan Kiszka wrote:
> On 18.03.25 15:02, Uladzimir Bely wrote:
> > This fixes race between two unattended installer instances running
> > on different (e.g. serial "ttyS0" and graphic "tty1") terminals.
> >
> > While one of them starts writing the disk, another one fails
> > and schedules reboot in 60 seconds. Depending on build machine
> > performance we can get incomplete installation and broken target
> > filesystem.
> >
> > Selected terminal with unattended installer can be set by
> > INSTALLER_UNATTENDED_TTY variable. It should correspond to one
> > of INSTALLER_GETTY_TARGETS from deploy-image.service recipe.
> >
> > Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> > ---
> > .../recipes-installer/deploy-image/deploy-image_0.1.bb | 8
> > +++++++-
> > .../bin/{deploy-image-wic.sh => deploy-image-wic.sh.tmpl} | 6
> > ++++++
> > 2 files changed, 13 insertions(+), 1 deletion(-)
> > rename meta-isar/recipes-installer/deploy-
> > image/files/usr/bin/{deploy-image-wic.sh => deploy-image-
> > wic.sh.tmpl} (95%)
> >
> > diff --git a/meta-isar/recipes-installer/deploy-image/deploy-
> > image_0.1.bb b/meta-isar/recipes-installer/deploy-image/deploy-
> > image_0.1.bb
> > index 242ca88e..1af3a6dd 100644
> > --- a/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
> > +++ b/meta-isar/recipes-installer/deploy-image/deploy-image_0.1.bb
> > @@ -7,10 +7,16 @@ DESCRIPTION = "Install image to device"
> >
> > inherit dpkg-raw
> >
> > -SRC_URI = "file://usr/bin/deploy-image-wic.sh \
> > +SRC_URI = "file://usr/bin/deploy-image-wic.sh.tmpl \
> > file://usr/lib/deploy-image-wic/handle-config.sh \
> > "
> > DEBIAN_DEPENDS = "bmap-tools, pv, dialog, util-linux, parted,
> > fdisk, gdisk, pigz, xz-utils, pbzip2, zstd"
> > +
> > +INSTALLER_UNATTENDED_TTY ?= "${MACHINE_SERIAL}"
> > +
> > +TEMPLATE_FILES += "usr/bin/deploy-image-wic.sh.tmpl"
> > +TEMPLATE_VARS += "INSTALLER_UNATTENDED_TTY"
> > +
> > do_install[cleandirs] = "${D}/usr/bin/ \
> > ${D}/usr/lib/deploy-image-wic \
> > "
> > 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.tmpl
> > similarity index 95%
> > rename from meta-isar/recipes-installer/deploy-
> > image/files/usr/bin/deploy-image-wic.sh
> > rename to meta-isar/recipes-installer/deploy-
> > image/files/usr/bin/deploy-image-wic.sh.tmpl
> > index 7f552eee..33a409f3 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.tmpl
> > @@ -10,6 +10,12 @@ SCRIPT_DIR=$( dirname -- "$( readlink -f --
> > "$0"; )"; )
> >
> > . ${SCRIPT_DIR}/../lib/deploy-image-wic/handle-config.sh
> >
> > +if $installer_unattended; then
> > + if [ "$(tty)" != "/dev/${INSTALLER_UNATTENDED_TTY}" ]; then
> > + dialog --msgbox "Unattended installer is active on
> > ${INSTALLER_UNATTENDED_TTY}. Please wait for it to finish." 7 60
> > + installer_unattended=false
>
> This remains wrong, already wrote before. Even more now with the new
> model where we define that we will only handle even errors on
> INSTALLER_UNATTENDED_TTY.
>
> But all this is not what I suggested: First entry into the script
> that
> passes the "target dev empty" test will do the copying,
But if there is no direct definition of UNATTENDED_TTY and we allow
such kind of race, it's not predictable, where to look at the
installation process.
> the other
> instances terminate without error.
I didn't get why, but for some reason board reboots even if the
instance immediately terminates without errors (i.e. returns 0). That's
strange (because we have ' || <reboot logic>' in the service, but it
is. So, the only way I found is to leave other instances waiting for
user input.
> If the empty test fails and
> installer_target_overwrite is not set, the dialog will still be shown
> on
> all te mrminals. The one that is then used will become the first (and
> only) to copy.
>
The main thing I tried to achieve with the patchset is to fix problems
that make CI fail and block merging other patches from maillist.
Probably, from the user perspective the ideal behaviour would be run
unattended installation on one TTY and just show the progress on all
TTYs.
> Jan
>
> > + fi
> > +fi
> >
> > if ! $installer_unattended; then
> > installer_image_uri=$(find "$installdata" -type f -iname
> > "*.wic*" -a -not -iname "*.wic.bmap" -exec basename {} \;)
>
--
Best regards,
Uladzimir.
--
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/65b10c049f59096a66d835faa17ae13948e8056d.camel%40ilbers.de.
next prev parent reply other threads:[~2025-03-19 9:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-18 14:02 [PATCH v3 0/4] Fixes for unattended installation Uladzimir Bely
2025-03-18 14:02 ` [PATCH v3 1/4] meta-isar: Use to_boolean for INSTALLER_UNATTENDED variable Uladzimir Bely
2025-03-18 14:02 ` [PATCH v3 2/4] testsuite: Disable "snapshot" feature for installer image Uladzimir Bely
2025-03-18 14:02 ` [PATCH v3 3/4] Installer: allow to set custom TTYs for installer Uladzimir Bely
2025-03-18 21:25 ` 'Jan Kiszka' via isar-users
2025-03-18 14:02 ` [PATCH v3 4/4] installer: Run unattended mode on the only terminal Uladzimir Bely
2025-03-18 21:39 ` 'Jan Kiszka' via isar-users
2025-03-19 9:15 ` Uladzimir Bely [this message]
2025-03-19 10:13 ` Uladzimir Bely
2025-03-24 9:20 ` [PATCH v3 0/4] Fixes for unattended installation Uladzimir Bely
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=65b10c049f59096a66d835faa17ae13948e8056d.camel@ilbers.de \
--to=ubely@ilbers.de \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@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