From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Tue, 18 Mar 2025 08:51:49 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-pl1-f190.google.com (mail-pl1-f190.google.com [209.85.214.190]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 52I7plWJ020789 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 18 Mar 2025 08:51:48 +0100 Received: by mail-pl1-f190.google.com with SMTP id d9443c01a7336-22403329f9esf83020435ad.3 for ; Tue, 18 Mar 2025 00:51:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1742284302; cv=pass; d=google.com; s=arc-20240605; b=ZhWn9d2/ZOoAT/JyA27PBMv0xsnzjpYP4QDd+Ori8U+Z7R9DwuVqzs9P8ZK2IZVvka hM1AJcJEQsg5CtOEjiuO465IMUIMtn9g1WS4Zr1fo9dhPv6L33Za9IRS+J+fBmTRZzOU ypid74JsVkUP04TMl5nC3mnS+zDf5UMmvwOdh/pSpDNFIkim2ToGPtS6FJeIaFmu588N tG3NvR7JX9YjFSbNx4cHRNVeY87NJWTI14Qz0uKPQrMmydEa0HjUBHc5TDnKXSe5Nt31 0fene4Pfwtkpxh9w0CZsRnkn82AQeX+RdHqRrIxKp1ZJHP8A9rkFYc8DcMgwLHVaBq91 jJSw== 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:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:to:from :subject:message-id:sender:dkim-signature; bh=FlLQENXXUqB5pbD0cPJZnQ9rj7sFngYonZZHLAmJyJw=; fh=pNWVpXb3EIqAzeqm0+uK0PKqFYKlR/Ai2pIxK6XmdO4=; b=NQWupt+qtX/FgD9ZUPcB2MM9MhzuNjvpRIRXBTbf3YtHi73z0pmTmhv7IjicgS+Oh4 u9zhnvpH1nVLThyV/vX2UK8jBlSKZ4fAzcXwaUbhUFHSEoK3w11rH651HQLUCNFnY2u9 RKNqy6gFTy6Czteq3p2eNItyvUl7BX6RcM9DVvJBLq720CEa2K0m6lcJ5viVE/HZHB9S eHagwhug8oS8O2V5JPPjVFZ6V2oA/NolAwBlQQjL9WSGizhBLaUAlcR41Ag/YYhEoS0j ekZKfPFpXbrxc7VdZIf3wq9gEp9OaOJ6ZiglTYQezHRJ8+iuifq6E/V+exv6H0AHdQsQ agFg==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1742284302; x=1742889102; darn=ilbers.de; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:user-agent:content-transfer-encoding :references:in-reply-to:date:to:from:subject:message-id:sender:from :to:cc:subject:date:message-id:reply-to; bh=FlLQENXXUqB5pbD0cPJZnQ9rj7sFngYonZZHLAmJyJw=; b=bz9Hs2dHZFCLDUWshNmoXBiKVpHIVzFcADGFFZpG5PrG2UdOQ6SHIMjpi52B+GpD5q NgV9jZ8c9J4isoCpFswqYQ9TOXa0Vcj8NmNKDX4F/AsUxEqUgBE2rNCiQqrspAZ7SNEt xRfrXy/LNEauvR9L9ukYVJ0+N/xnLhWrV+xDyfInz8b1zRHZz+vikxPSztTWDXBJwRqd xRfOh+xA+pGF4DwlvSje/+5PiyDcutb2zwQyZyVgrssdDbukwcXoiviIX9Q8/lUO5Swd akdno/Ju07M4SspgC/mbFZOJ42ttdp2M467v5ZVXMH/gfBcfirEg+qjcxgfvZNtk+UBo lKbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742284302; x=1742889102; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :user-agent:content-transfer-encoding:references:in-reply-to:date:to :from:subject:message-id:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=FlLQENXXUqB5pbD0cPJZnQ9rj7sFngYonZZHLAmJyJw=; b=DylROn3tJFqvq4RkkD1B4WYPt59mC3K4YdnMMzqvXrnmT63r9l5YVacd8iTX9nUWlC u24i+B1Smd2kpzspT5AagoUq4lHFk3ypxDhfquRwthRg2hLRK05jTr2GU3TOEUhtxGRn JI5lqKWZHyuWH0vES69SpITnIhsZRlo9y24Q5lX1StHDyDrORe/Z/Y1jxR1lZKirA/Oi pcJNxuKr2C+WLSm/yHivKFs4QWzRMW/zQC5Dn9Zh3jsvPnbRDq0Tr9YO7HI7jf5j3wYo SXmFjiPrhqEgO2wYf9uuuLw69EMjF8HU2OS9Ka+XYrBEycc6BrWYu/SyxxUV8jfe3CvP t1vg== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCUxg6prRBPEtGfZTqEyUgLRjx0A9iX58JPeY3k6WJ+fU+kWVa+guoGY9S1tzzyF14gQ634v@ilbers.de X-Gm-Message-State: AOJu0Yx9JBEOi/U+pS3mpj/jPXOuVQ7O5OyH+YZSWbaDLIRj26DruPNC 80oRpczBjm6262xvFdmkKH7Sxz7rWTMYg+6uz8r27I/5rRkg5t+L X-Google-Smtp-Source: AGHT+IFay9cgceA/54HHLuoiZadfGCOqTnZRJBFeZV2JIZVN4H1GSTWtCNK6BU+xxNNXfF+3Ie/19g== X-Received: by 2002:a17:902:ccd1:b0:223:4d7e:e523 with SMTP id d9443c01a7336-225e0b26f80mr190284665ad.50.1742284301403; Tue, 18 Mar 2025 00:51:41 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com; h=ARLLPALu9bnE7cgqXVXJiwx8AM8mNblseX6UxMQngLXhh34Kbg== Received: by 2002:a17:902:d511:b0:21d:d55b:4b77 with SMTP id d9443c01a7336-225c317bd26ls11144545ad.2.-pod-prod-07-us; Tue, 18 Mar 2025 00:51:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVj2W6AvnqNQgj55WryIGZtYVbyOxUjF+8+u3dsay1JcLSlgpjlI1SpnbFDqRLfXK0go1wr7doR0Jt4@googlegroups.com X-Received: by 2002:a17:902:e88a:b0:224:2715:bf44 with SMTP id d9443c01a7336-225e0a6242cmr196425775ad.19.1742284299924; Tue, 18 Mar 2025 00:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742284299; cv=none; d=google.com; s=arc-20240605; b=k16G+u4aNslqpLFb6LZgCwKzvnT2L3KVglR6+waR2+IPBKHdv4/ByekkJ21vKw9g1U gMUkIn+q/iU4Dl29wKaLV/HCPQWzQHj9Nca6vyJWiUf8DO46vmL93LLgWklI3oI5FwxR 785foITiW8a4u6rSkr1d3v0Tds/2HBjhub/DM8xh2bCaWglgBz/WdX9FYs+49LAo6uqS I7oh2CNFFjb3bmVU2QGC3moV9peTUk7VohNS7hvZnCz+Ql6QBVbpMr/dmQmQ36cQ0Oaf nUF7kLvNXQ2eB/YEpCftvs9VzdygaflwjVX+Zk6eYbnDaqvZnQO9ysnMDzIQs68TiYCJ cPvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id; bh=tagniu2A1zzByQGTdQmcRhN8BeIOM4xO8Jjtih5m3NY=; fh=O+ZMFUiiuyZKsfz7Fw8hsdknZlxcSFSsLsCydBEGD0o=; b=kr5QLDNJiaigJl9xIDYQs8vnqvYtCEZaNLaJYukACmk5dvgn6GdpyXoZtLsvcYV7Jr wMVjb7PvKRKOt89smh2bxKU81e5qWGdi1euNwHVSq4YsKuEJ/sYP1exrBkyDXTMrhDyB ++MRvDjqQrvPKqJ7Wvrre2WPe+0pPwOV0vuz4vzho4KhsFvPBp9qp0cHx6hGl0DTZusJ ug8QCRewQXuaYEiE5ZMH9hJ9SXtOg38D4Vkcoygk0iOueu5aV5st4AjrmCxWiAWO8TM2 avDAzOxbwdztr6X3CcsSo0TAnalCSBVkqRsRhjS6DEhj6Oj9ZQnGocCtGZ20HS1Yc7QY +XqA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id d9443c01a7336-225c6c00e40si3926855ad.7.2025.03.18.00.51.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Mar 2025 00:51:39 -0700 (PDT) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from [127.0.0.1] (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 52I7pZrs020780 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Mar 2025 08:51:36 +0100 Message-ID: Subject: Re: [PATCH v2 3/3] installer: Run in unattended mode only on ttyS0 From: Uladzimir Bely To: Jan Kiszka , isar-users@googlegroups.com Date: Tue, 18 Mar 2025 10:51:34 +0300 In-Reply-To: <0935ecd8-60c5-40ac-bb9d-d52ff49609d9@siemens.com> References: <20250318061300.12805-1-ubely@ilbers.de> <20250318061300.12805-4-ubely@ilbers.de> <7b66abad-a095-4eb0-bc20-643f9743e5fb@siemens.com> <68af99349e8b348fd22e0167af7c284168096e68.camel@ilbers.de> <0935ecd8-60c5-40ac-bb9d-d52ff49609d9@siemens.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (by Flathub.org) MIME-Version: 1.0 X-Spam-Status: No, score=-4.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,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-Original-Sender: ubely@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de 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-TUID: 9QcuRq0B+OyO On Tue, 2025-03-18 at 08:08 +0100, Jan Kiszka wrote: > On 18.03.25 07:33, Uladzimir Bely wrote: > > On Tue, 2025-03-18 at 07:29 +0100, Jan Kiszka wrote: > > > On 18.03.25 07:25, 'Jan Kiszka' via isar-users wrote: > > > > On 18.03.25 07:10, Uladzimir Bely wrote: > > > > > This fixes race between two unattended installer instances > > > > > running > > > > > on serial "ttyS0" and graphic "tty1" terminals. > > > > >=20 > > > > > 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. > > > > >=20 > > > > > Signed-off-by: Uladzimir Bely > > > > > --- > > > > > =C2=A0.../deploy-image/files/usr/bin/deploy-image-wic.sh=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > > > > > | 6 > > > > > ++++++ > > > > > =C2=A01 file changed, 6 insertions(+) > > > > >=20 > > > > > 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 7f552eee..bd580694 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,12 @@ SCRIPT_DIR=3D$( dirname -- "$( readlink -f - > > > > > - > > > > > "$0"; )"; ) > > > > > =C2=A0 > > > > > =C2=A0. ${SCRIPT_DIR}/../lib/deploy-image-wic/handle-config.sh > > > > > =C2=A0 > > > > > +if $installer_unattended; then > > > > > +=C2=A0=C2=A0=C2=A0 if [ "$(tty)" !=3D "/dev/ttyS0" ]; then > > > >=20 > > > > This is wrong. "ttyS0" is target-specific. We need a different, > > > > generic > > > > mechanism to detect multiple executions. > > > >=20 > > > > Jan > > > >=20 > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 echo "Disable unatten= ded mode on $(tty), it's active > > > > > on > > > > > /dev/ttyS0" > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 installer_unattended= =3D0 > > >=20 > > > And this would be also wrong. > > >=20 > > > But all this does not make sense yet. We have a single service > > > that > > > is > > > supposed to run a single script. I don't see why systemd should > > > instantiate the service multiple times. Is our service file > > > incorrect? > > >=20 > >=20 > > The service itself is correct, the problem is that it's run twice. > >=20 > > https://github.com/ilbers/isar/blob/master/meta-isar/recipes-installer/= deploy-image-service/deploy-image-service.bb#L19-L20 > >=20 > > For non-unattended mode it doesn't matter, but in unattended mode > > one > > of instances fails and schedules rebooting. > >=20 >=20 > Ah, now I remember. >=20 > But, again, we need a proper fix here. Re-entrance needs to be > detected, > the core copy job needs to be run only once. And all other entrances > of > the script skip over the copying core or otherwise wait at the same > dialog that semi-unattended modes may show. >=20 > Jan >=20 OK, I see. So, there are two ways to deal with the issue: 1. Make one of terminals (for example, first virtual console ttyS1) main one, e.g.: INSTALLER_UNATTENDED_CONSOLE ?=3D "ttyS1" And refer to this variable instead of hardcoded value. 2. Unattended installation will be done by the service which was the first one in the race (first who run bmaptool and locked e.g. /dev/sda). Other services just should not trigger reboot in this case, that means "reboot" should be moved from service unit to script again. As for me, I would prefer option 1 since it's more predictable. --=20 Best regards, Uladzimir. --=20 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 e= mail to isar-users+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/isar-users/= c96899552e7a4e8e677f54394f2490ac17fba1f3.camel%40ilbers.de.