From patchwork Tue Jan 11 16:58:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ryan Fairfax X-Patchwork-Id: 2266 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94641C433F5 for ; Tue, 11 Jan 2022 16:58:50 +0000 (UTC) Subject: [PATCH v2] arm/optee-os: Fix build race condition when building fTPM To: meta-arm@lists.yoctoproject.org From: "Ryan Fairfax" X-Originating-Location: Redmond, Washington, US (71.227.177.100) X-Originating-Platform: Windows Chrome 97 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Tue, 11 Jan 2022 08:58:48 -0800 Message-ID: List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 11 Jan 2022 16:58:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/2813 [PATCH v2] arm/optee-os: Fix build race condition when building fTPM Change optee-ftpm to install embeddable (stripped) version to target sysroot.  When building optee-os pick up from sysroot instead of DEPLOY_DIR_IMAGE.  This fixes a build race condition where DEPENDS was only adding a dependency for optee-ftpm:do_populate_sysroot instead of do_deploy and makes the usage of dependencies a bit more standard by using sysroots instead of deploy output. Signed-off-by: Ryan Fairfax --- meta-arm/recipes-security/optee-ftpm/optee-ftpm_git.bb   | 6 +++++- meta-arm/recipes-security/optee-ftpm/optee-os_%.bbappend | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/meta-arm/recipes-security/optee-ftpm/optee-ftpm_git.bb b/meta-arm/recipes-security/optee-ftpm/optee-ftpm_git.bb index e30e13a..f2a74da 100644 --- a/meta-arm/recipes-security/optee-ftpm/optee-ftpm_git.bb +++ b/meta-arm/recipes-security/optee-ftpm/optee-ftpm_git.bb @@ -60,6 +60,7 @@ do_compile() { do_install () { mkdir -p ${D}/lib/optee_armtz install -D -p -m 0644 ${S}/TAs/optee_ta/out/fTPM/${FTPM_UUID}.ta ${D}/lib/optee_armtz/ +    install -D -p -m 0644 ${S}/TAs/optee_ta/out/fTPM/${FTPM_UUID}.stripped.elf ${D}/lib/optee_armtz/ } do_deploy () { @@ -69,7 +70,10 @@ do_deploy () { addtask deploy before do_build after do_install -FILES:${PN} += "${nonarch_base_libdir}/optee_armtz/${FTPM_UUID}.ta" +FILES:${PN} += " \ +               ${nonarch_base_libdir}/optee_armtz/${FTPM_UUID}.ta \ +               ${nonarch_base_libdir}/optee_armtz/${FTPM_UUID}.stripped.elf \ +               " # Imports machine specific configs from staging to build PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/meta-arm/recipes-security/optee-ftpm/optee-os_%.bbappend b/meta-arm/recipes-security/optee-ftpm/optee-os_%.bbappend index 0cfa949..acea750 100644 --- a/meta-arm/recipes-security/optee-ftpm/optee-os_%.bbappend +++ b/meta-arm/recipes-security/optee-ftpm/optee-os_%.bbappend @@ -9,6 +9,6 @@ DEPENDS:append = "\ EXTRA_OEMAKE:append = "${@bb.utils.contains('MACHINE_FEATURES', \ 'optee-ftpm', \ -                      'CFG_EARLY_TA=y EARLY_TA_PATHS="${DEPLOY_DIR_IMAGE}/optee/${FTPM_UUID}.stripped.elf"', \ +                      'CFG_EARLY_TA=y EARLY_TA_PATHS="${STAGING_DIR_TARGET}/lib/optee_armtz/${FTPM_UUID}.stripped.elf"', \ '', \ d)} "