From patchwork Tue Mar 18 14:02:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzimir Bely X-Patchwork-Id: 4112 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 15:06:43 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-yb1-f188.google.com (mail-yb1-f188.google.com [209.85.219.188]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 52IE6fHo022681 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 18 Mar 2025 15:06:42 +0100 Received: by mail-yb1-f188.google.com with SMTP id 3f1490d57ef6-e6372bafb8asf6807749276.1 for ; Tue, 18 Mar 2025 07:06:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1742306795; cv=pass; d=google.com; s=arc-20240605; b=CKM57UUtMZMmDUQQpN+OCYzAbr3IZZ9Ub6Z38moyefZKiWySo7TVUD2/gqkEX6U4c7 SgkhYIeAUF6iZlMZg3vV/jlkmWrrPK0SFPU9C7acdl1pad5+n1ThOMJaYf4exuXipHdK Ln3VUOPYPfYnW/MidHq+W31eGk+3j0lEfwnNcp+xnZLVTwm5pEOK0ERHIqyBxd4jDj3f 9cqLbGxPkw7ooS9x5xM5FlbltIKctLOk+sgdDpsEsmhCWkabdswTskqf38mv7/obbhez VUxXEXXjulbmvVZJF4fpCHc3Eix3aU74NRxlJuI5UcyARu1MiyJ3JVbamaSJL+q6YpCQ I7vw== 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:references:in-reply-to :message-id:date:subject:to:from:sender:dkim-signature; bh=9DyrReUsUCZdnVj/3Il1GIIvku4ebTRZ4ky3K1YjWmU=; fh=0h0q0cE1qGlfETPVXjan9C7YTVQkiP/fnklaoIJnZY0=; b=IK9bUxipkKo7vcDMRgr2ZJEInMr9377ZfeofEirHSleKpS3QK/uo6NZ447x/uA6ZC4 x+q/RDhvmI4fQkK8XdastO3Z1U3BBrpZ53V2c3JrWWTER8RmCe+8u06yMxd/wD0oajuE p/O9AVj08R5vxKOKtm36PNBjD4qrwowubcuRGfNRJ4pWQsErCIt0VAvLJ7Zw9jP92OmP 3WNxG6O2qcob3krai+u3+oLL5p+lJEr5oixPvjST+qzN0SBVVs//F+wkHhTPHSZdRDrD d+k3rtzVasgd+pDlBsJWDGS+OLk8vrP+AvikL+SZZRx8YadY1xW4wGFPXgVA6Rf70p8d ujYQ==; darn=isar-build.org 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=1742306795; x=1742911595; darn=isar-build.org; 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:references:in-reply-to:message-id :date:subject:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=9DyrReUsUCZdnVj/3Il1GIIvku4ebTRZ4ky3K1YjWmU=; b=cmUq7LRxBFc3u66PKdALxrDDPfHyF7rpCmrc8JJ9JjonmbteZR7BEvw5oDmYjdnLUQ G72v2HJ6TTnFs9FO1VrJhCNokhoSN4m41C+HywLdW5vcIshZqCHSJs7S8VUJ2m262ads l7mee+Qixidr/gk1zEf44p11nZveln6r24mAMi6sT0SMNr0DmEjUTVCpfKBz8jGLDGux SfO33oeuM8jDhmn+RP85iAIel1cEvE/fgjrcyT3ier6AiLE/aFVYsTPhE4r9o5Fimaqo yZkAqZ2JquGlZh2si9k6AZsWNIo76KpXUuw4jqeS/PjVLvak4fJBsNz2Fh9Fm+NOhqy+ vHcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742306795; x=1742911595; 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 :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=9DyrReUsUCZdnVj/3Il1GIIvku4ebTRZ4ky3K1YjWmU=; b=wJH9omzJ6TrBIBToYyCQK4P53V0Zdb6WMei5OXBIa5l1wzDtKkePLOH+Aycfqk/Omp fPSaOeBh2ws5PAmHAsgCgpSdHjBIaBR1mq54uR1dWlWbW5jcsLmCAf5MumTsZJJInvXe 1scD+uPV2xFblKp6ameV98DCNckh8lo4l2OGu78/A5BxjRIExl+rOHqwR8YEow/c3tbu YHx6UXQYy2IExGb7oHIJwP8wEh6vAtwJKN0dS/LGqZwVnYwMAG8aZGLVLnvGgrwZrOmf AXW0SeSWd2gmNrRniSzSw0njm4VxlzbPWsy38r3zjQcC63rdPihHxpPaIf8MWUk2Kxna ewNA== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCX9PQffXTndOqyDkpYDNxxyeBpeh+ZwwBz2KMA9LPfmQ7tb4tkHP6b7QLCqmCC0w/tbKIT5BU4=@isar-build.org X-Gm-Message-State: AOJu0YxpTCGfbTqNW2Ntm2o7jeqKeWaRH0Dzc+0hKdCXd8Ibciv9RCpe d0+u+IGwtKwFWiFpTkRV3L+kXSKRmNxDo0ISTCWCnPPSaFnQBd8J X-Google-Smtp-Source: AGHT+IF6lVBkfdJxuElM/FS4ROKsjZaSBafucrIU5IKtiQWlnMYGbBYuIDUPaRXPMYnjaYrTH/1/dA== X-Received: by 2002:a05:6902:1009:b0:e63:6e52:2140 with SMTP id 3f1490d57ef6-e63f64f8086mr18576354276.16.1742306794861; Tue, 18 Mar 2025 07:06:34 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com; h=ARLLPAKCwpyTj9fGTSC5GZxEpHDYLLeNJuRssgqupv3XOU9isg== Received: by 2002:a25:2905:0:b0:e61:b422:146b with SMTP id 3f1490d57ef6-e643eecd957ls990595276.2.-pod-prod-01-us; Tue, 18 Mar 2025 07:06:33 -0700 (PDT) X-Received: by 2002:a05:6902:100e:b0:e57:442a:befd with SMTP id 3f1490d57ef6-e63f659d6famr20758768276.32.1742306793584; Tue, 18 Mar 2025 07:06:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742306793; cv=none; d=google.com; s=arc-20240605; b=KpZD2kgVEIXj6XnxOBE1jKMe7emjH+UHEL3Hgw4T5YJb+RuKxELeO1+Lx6I2B//CGc gGyxwvtR/soU7VWxVPH/ZsJI0QkrXdieaFwM1gYI553u9yY0ph/XbpPk4MLpjDezgx54 bD3X5M5As4iMjZlMEgKC5jBErFMhkeUXlihZy4/top40SfnpqeFmZn6uMLCjzl0OOdrJ rbB5SqzaaEqMcVfPe7scsLT+vmKTO5GjJJ0vP73VL7Uj10KnMBH4kwJorBlJHvt3NgUl CFOeYZ5QRpuZJ3PwFNZ//bHslyKY3CHRVfAJVZ5FvjSobX6DvHqGx+9Pnhcs9MD6B819 7new== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=8PbFWrmvEx3n0kEsyzM6XU05NQHQmIviDlCEZFW/+pA=; fh=7tclEdh7YbwSQowgJ6LNq720O7H5HTEaqj22NJWRE2E=; b=jca6YKmVs8RxiiZXSKmNXTkzFpO+p9Fy6xb4D+9hWbmespY8XbkNndbo4ic+fCOD29 Z/MO0uHDMwQ68Xmo0tMzE2vtw4abO9Z9LYicIG72JtFWvmKL2Jodpua89koV3jD7sYjN idnTVRpnwmGG/4Bku05gio9e3Mz3me3q5Q4rcB4yMut1SZ5k1ddtMUW37yjWVWTEcPJF a52Uu+RGpMagbp142dH+eAt8/FqokG7FqAldwgNqvb0mPLW9oX67lW3Z3uYaQnGPO4C9 fPtq/pcH0TYwDh6PZgCPwnc+M2WrNAX8o5+bQ/4ni11AjiMySWZk6xiKqQjKBmWS8wl5 RB4A==; 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 3f1490d57ef6-e63e5471b6fsi614145276.3.2025.03.18.07.06.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Mar 2025 07:06:33 -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 hp15.localdomain (mm-54-5-214-37.mogilev.dynamic.pppoe.byfly.by [37.214.5.54]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 52IE6S2n022611 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 18 Mar 2025 15:06:31 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v3 4/4] installer: Run unattended mode on the only terminal Date: Tue, 18 Mar 2025 17:02:17 +0300 Message-ID: <20250318140622.13676-5-ubely@ilbers.de> X-Mailer: git-send-email 2.45.3 In-Reply-To: <20250318140622.13676-1-ubely@ilbers.de> References: <20250318140622.13676-1-ubely@ilbers.de> 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_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-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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= 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 --- .../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 + fi +fi if ! $installer_unattended; then installer_image_uri=$(find "$installdata" -type f -iname "*.wic*" -a -not -iname "*.wic.bmap" -exec basename {} \;)