From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7261955842613706752 X-Received: by 2002:a05:6402:27d2:b0:522:b723:11bd with SMTP id c18-20020a05640227d200b00522b72311bdmr7265732ede.4.1690805854874; Mon, 31 Jul 2023 05:17:34 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aa7:c6c3:0:b0:522:58af:deb5 with SMTP id b3-20020aa7c6c3000000b0052258afdeb5ls840254eds.0.-pod-prod-06-eu; Mon, 31 Jul 2023 05:17:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlG2h1iyAnXX5NzabPker19OqUVLbBaFHUwBlxTCIAZMgMnCfuc0lLWxME1maBH0CGnT7uxr X-Received: by 2002:a50:fc06:0:b0:522:37da:7920 with SMTP id i6-20020a50fc06000000b0052237da7920mr8059408edr.12.1690805852582; Mon, 31 Jul 2023 05:17:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690805852; cv=none; d=google.com; s=arc-20160816; b=RPQiuE0ERElSkC9YsE9wNUB5S7G+bbe4cYjpg5siEKYcROnZvjZGBRLoDnLU4SEc6n JEckWCP3MSvXthL2pdc5TJZDMYbZaLe3PFhhU5MW1W6NJpIFjevYbGbMdat5fSozjuQd 6VSAZqseMjWeWT2Y+13bLlT+JiXRjxUHDyFvxTFTc19mSt36K9XZCqS4BnUk3xXex/Sm s60ZwsL7cNtLZ9aticq0nNOe+j7yOF42Ux9oZL9tk9Kjtsphu09nPLhBjTRG6D+due3Q sBZECYkJ3YyqRTezFuGJlm77vZ3ueHAqs3Lv7PXIbgbby8R70yfO01v2EczD1OB7SDhy 736g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=PdQxHyNbagjJP61cMvRo2wS+A2t8rjXOrXJfSa1elVU=; fh=swRs1+OhWjovx1IrvOlKBWsdq9manB5qdcuGoHoh5Ak=; b=NpjeYyT5C1PERlGKbnrFcTu7wsHLT4hLXWqr+MXsv89uAf45BlVXq4rvJUeQoGq6RW T19kccxJBUhOCZY1Tqpnt/GdamA2UB1N2S6ona5nzBgvDf/YEpG7jEwjdJDG0HYla7mV 6KxW8VToyEJyedzXj8jYUqDkZMqoy3S67z7Vg85BWQGxZ2Kym9CpwUOHGqXtMKaAFXDR Is7546MkYBxZmvz+tu3XDLtmixSUF62vyj50Z8tUfTyWpXWnc5pi23wPYvEB8P0dyEQI zbXdjFc/fH5gh6jHA7ANTEkeHjzQ9UYGQxtQTLo/rQafhgpvkSKpJYa0IPvndgXq5O44 lZng== 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 Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id d25-20020a056402401900b005222b2cd106si523542eda.3.2023.07.31.05.17.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 Jul 2023 05:17:32 -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; 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 Received: from baighyz.m.ilbers.de (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 36VCHTOa015705 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 31 Jul 2023 14:17:32 +0200 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v4 05/11] initramfs-tee-{ftpm,supplicant}-hook: Move sync loop to ftpm-hook Date: Mon, 31 Jul 2023 14:17:23 +0200 Message-Id: <20230731121729.16972-6-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230731121729.16972-1-ubely@ilbers.de> References: <20230731121729.16972-1-ubely@ilbers.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED 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-TUID: +jQJWeksQw3r From: Jan Kiszka There is no FTPM_DEV defined in tee-supplicant.script, and it also makes no sense to wait for an unrelated fTPM device in the tee-supplicant starter hook. That is better done in tee-ftpm.script. Signed-off-by: Jan Kiszka --- .../initramfs-tee-ftpm-hook/files/tee-ftpm.script | 9 +++++++++ .../files/tee-supplicant.script | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.script b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.script index ce321a09..6e12e6df 100644 --- a/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.script +++ b/meta/recipes-initramfs/initramfs-tee-ftpm-hook/files/tee-ftpm.script @@ -21,6 +21,15 @@ esac . /scripts/functions FTPM_DEV=/dev/tpmrm0 + +# The tee-supplicant would take some time to be discovered, 10 seconds should be +# enough +wait_sec=10 +until test $wait_sec -eq 0 || test -c "${FTPM_DEV}" ; do + wait_sec=$((wait_sec-1)) + sleep 1 +done + if ! test -c "${FTPM_DEV}"; then panic "Can't discover the fTPM device ${FTPM_DEV}!" fi diff --git a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.script b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.script index bb6dcc16..76efc1ad 100644 --- a/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.script +++ b/meta/recipes-initramfs/initramfs-tee-supplicant-hook/files/tee-supplicant.script @@ -22,12 +22,4 @@ esac /usr/sbin/tee-supplicant -d -# The tee-supplicant would take some time to be discovered, 10 seconds should be -# enough -wait_sec=10 -until test $wait_sec -eq 0 || test -c "${FTPM_DEV}" ; do - wait_sec=$((wait_sec-1)) - sleep 1 -done - /usr/bin/pgrep tee-supplicant > /dev/null || panic "Can't start the tee-supplicant daemon!" -- 2.20.1