<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Building optee-examples and trusted Apps in Yocto bitbake in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Building-optee-examples-and-trusted-Apps-in-Yocto-bitbake/m-p/1383425#M184140</link>
    <description>&lt;P&gt;&lt;STRONG&gt;IMPORTANT UPDATE :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I managed to solve the problem. My solution is to only add &lt;EM&gt;&lt;STRONG&gt;optee-examples_3.13.0.imx.bb&lt;/STRONG&gt;&lt;/EM&gt; file into the path&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;meta-imx/meta-bsp/recipes-security/optee-imx/&amp;nbsp; .&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;After making modifications , here is the content of the recipe file below :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SUMMARY = "OP-TEE examples"
DESCRIPTION = "Open Portable Trusted Execution Environment - Sample Applications"
HOMEPAGE = "https://github.com/linaro-swg/optee_examples"

LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=cd95ab417e23b94f381dafc453d70c30"

DEPENDS = "optee-client optee-os python3-pycryptodome-native"

inherit python3native

SRC_URI = "git://github.com/linaro-swg/optee_examples.git"
SRCREV = "ff4b493e267d40bcf508acc300da296a3a2adac2"

S = "${WORKDIR}/git"
B = "${WORKDIR}/build"

OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta_arm64"

EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
                 OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
                 TEEC_EXPORT=${TEEC_EXPORT} \
                 HOST_CROSS_COMPILE=${HOST_PREFIX} \
                 TA_CROSS_COMPILE=${HOST_PREFIX} \
                 -C ${S} OUTPUT_DIR=${B} \
               "

CFLAGS += "--sysroot=${STAGING_DIR_HOST}"

do_compile() {
    oe_runmake
}

do_install () {
    mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
    mkdir -p ${D}${bindir}
    install -D -p -m0755 ${B}/ca/* ${D}${bindir}
    install -D -p -m0444 ${B}/ta/* ${D}${nonarch_base_libdir}/optee_armtz
}

FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"

# Imports machine specific configs from staging to build
PACKAGE_ARCH = "${MACHINE_ARCH}"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And of course as you suggested adding these lines into &lt;STRONG&gt;local.conf&lt;/STRONG&gt; but with little change.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;DISTRO_FEATURES_append = " systemd"&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;VIRTUAL-RUNTIME_init_manager = "systemd"&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;MACHINE_FEATURES += "optee"&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;DISTRO_FEATURES += "optee"&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;IMAGE_INSTALL_append = " optee-test optee-os optee-client optee-examples"&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Notice that I used in purpose &lt;EM&gt;&lt;STRONG&gt;"IMAGE_INSTALL_append"&lt;/STRONG&gt;&lt;/EM&gt; and not &lt;EM&gt;&lt;STRONG&gt;"IMAGE_INSTALL +="&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;. I passed long time to conclude that with the "IMAGE_INSTALL +="&amp;nbsp; I don't manage to see my binaries into rootfs of the image but with the append syntax that works correctly. I don't know for what reason is that. But with this way it worked perfectly. According to bitbake documentation that's equivalent but if you have any idea why is that don't hesitate to share it with us.&lt;/P&gt;&lt;P&gt;I hope that will solve the problem for you either if anyone had the same issue !&lt;/P&gt;</description>
    <pubDate>Wed, 08 Dec 2021 12:53:32 GMT</pubDate>
    <dc:creator>yuzarsif</dc:creator>
    <dc:date>2021-12-08T12:53:32Z</dc:date>
    <item>
      <title>Building optee-examples and trusted Apps in Yocto bitbake</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Building-optee-examples-and-trusted-Apps-in-Yocto-bitbake/m-p/1382003#M184022</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I'm working on NXP yocto project to build an image that support "optee-examples" using&amp;nbsp;&amp;nbsp;"imx8qmmek" board as target machine.&lt;/P&gt;&lt;P&gt;When I check the meta-imx/meta-bsp/recipes-security/optee-imx I've only found the optee-os optee-client and optee-test but not optee-examples.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following this link added 4 weeks ago that describes how to make that possible with a hardknott kernel version :&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Build-optee-examples-in-yocto-hardkott/ta-p/1367176" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Build-optee-examples-in-yocto-hardkott/ta-p/1367176&lt;/A&gt;&lt;/P&gt;&lt;P&gt;After bitbaking the optee-examples , the result was 100% succeed. But when I boot my machine and check the TA binaries in /lib/optee_armtz/ I don't see any interesting TA example for example the hello_world uuid .ta file which should be "&lt;SPAN&gt;8aaaf200-2450-11e4-abe2-0002a5d5c51b.ta"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yuzarsif_0-1638797687506.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/164210iF6E9E509A85BA1EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yuzarsif_0-1638797687506.png" alt="yuzarsif_0-1638797687506.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And as you can see even after launching the xtest to install the ta file :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yuzarsif_1-1638797777651.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/164211iC9124C4ED9FD99B5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yuzarsif_1-1638797777651.png" alt="yuzarsif_1-1638797777651.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I really need help on that please , the question is that the correct way to build optee-examples&amp;nbsp; into IMX yocto project ? If it is , why I can't see the optee-examples .ta files ? Otherwise what should I do to fix this problem because I really need to develop my custom trusted apps in the future ?&lt;/P&gt;&lt;P&gt;Thank You&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 14:53:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Building-optee-examples-and-trusted-Apps-in-Yocto-bitbake/m-p/1382003#M184022</guid>
      <dc:creator>yuzarsif</dc:creator>
      <dc:date>2021-12-06T14:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Building optee-examples and trusted Apps in Yocto bitbake</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Building-optee-examples-and-trusted-Apps-in-Yocto-bitbake/m-p/1382078#M184027</link>
      <description>&lt;P&gt;Update&lt;STRONG&gt; :&lt;/STRONG&gt; &lt;STRONG&gt;Is that related to the &lt;/STRONG&gt;&lt;EM&gt;o&lt;/EM&gt;&lt;EM&gt;ptee.inc&lt;/EM&gt;&lt;STRONG&gt;&amp;nbsp;file downloaded via the link ?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I see that the COMPATIBLE_MACHINE variable is fixed to qemuarm64, I tried to add supported machine by defining MACHINE variable as&amp;nbsp;MACHINE = "imx8qmmek" but always same problem.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 16:07:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Building-optee-examples-and-trusted-Apps-in-Yocto-bitbake/m-p/1382078#M184027</guid>
      <dc:creator>yuzarsif</dc:creator>
      <dc:date>2021-12-06T16:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Building optee-examples and trusted Apps in Yocto bitbake</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Building-optee-examples-and-trusted-Apps-in-Yocto-bitbake/m-p/1382256#M184041</link>
      <description>&lt;P&gt;Have updated that samples, you need use:&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;DISTRO_FEATURES_append = " systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
VIRTUAL-RUNTIME_init_manager = "systemd"
VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
MACHINE_FEATURES += "optee"
DISTRO_FEATURES += "optee"
IMAGE_INSTALL += "optee-test optee-os optee-client optee-examples"&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Dec 2021 01:56:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Building-optee-examples-and-trusted-Apps-in-Yocto-bitbake/m-p/1382256#M184041</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2021-12-07T01:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Building optee-examples and trusted Apps in Yocto bitbake</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Building-optee-examples-and-trusted-Apps-in-Yocto-bitbake/m-p/1382558#M184067</link>
      <description>&lt;P&gt;Thanks for your suggestion. But I already did that and always not working.&lt;/P&gt;&lt;P&gt;Can you please share any other ideas ?&lt;/P&gt;&lt;P&gt;I've noticed that there is under file &lt;EM&gt;&lt;STRONG&gt;optee-examples.inc&lt;/STRONG&gt;&lt;/EM&gt; :&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;&lt;STRONG&gt;HOST_CROSS_COMPILE=${HOST_PREFIX}&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;&lt;STRONG&gt;TA_CROSS_COMPILE=${HOST_PREFIX}&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;But in &lt;EM&gt;&lt;STRONG&gt;optee-test&lt;/STRONG&gt;&lt;/EM&gt; file it's :&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;&lt;STRONG&gt;CROSS_COMPILE_HOST=${HOST_PREFIX}&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;&lt;STRONG&gt;CROSS_COMPILE_TA=${HOST_PREFIX}&lt;/STRONG&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm wondering why the syntax is so different ?&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 07 Dec 2021 10:59:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Building-optee-examples-and-trusted-Apps-in-Yocto-bitbake/m-p/1382558#M184067</guid>
      <dc:creator>yuzarsif</dc:creator>
      <dc:date>2021-12-07T10:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Building optee-examples and trusted Apps in Yocto bitbake</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Building-optee-examples-and-trusted-Apps-in-Yocto-bitbake/m-p/1383425#M184140</link>
      <description>&lt;P&gt;&lt;STRONG&gt;IMPORTANT UPDATE :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I managed to solve the problem. My solution is to only add &lt;EM&gt;&lt;STRONG&gt;optee-examples_3.13.0.imx.bb&lt;/STRONG&gt;&lt;/EM&gt; file into the path&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;meta-imx/meta-bsp/recipes-security/optee-imx/&amp;nbsp; .&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;After making modifications , here is the content of the recipe file below :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SUMMARY = "OP-TEE examples"
DESCRIPTION = "Open Portable Trusted Execution Environment - Sample Applications"
HOMEPAGE = "https://github.com/linaro-swg/optee_examples"

LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=cd95ab417e23b94f381dafc453d70c30"

DEPENDS = "optee-client optee-os python3-pycryptodome-native"

inherit python3native

SRC_URI = "git://github.com/linaro-swg/optee_examples.git"
SRCREV = "ff4b493e267d40bcf508acc300da296a3a2adac2"

S = "${WORKDIR}/git"
B = "${WORKDIR}/build"

OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta_arm64"

EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
                 OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
                 TEEC_EXPORT=${TEEC_EXPORT} \
                 HOST_CROSS_COMPILE=${HOST_PREFIX} \
                 TA_CROSS_COMPILE=${HOST_PREFIX} \
                 -C ${S} OUTPUT_DIR=${B} \
               "

CFLAGS += "--sysroot=${STAGING_DIR_HOST}"

do_compile() {
    oe_runmake
}

do_install () {
    mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
    mkdir -p ${D}${bindir}
    install -D -p -m0755 ${B}/ca/* ${D}${bindir}
    install -D -p -m0444 ${B}/ta/* ${D}${nonarch_base_libdir}/optee_armtz
}

FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"

# Imports machine specific configs from staging to build
PACKAGE_ARCH = "${MACHINE_ARCH}"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And of course as you suggested adding these lines into &lt;STRONG&gt;local.conf&lt;/STRONG&gt; but with little change.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;DISTRO_FEATURES_append = " systemd"&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;VIRTUAL-RUNTIME_init_manager = "systemd"&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;MACHINE_FEATURES += "optee"&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;DISTRO_FEATURES += "optee"&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;IMAGE_INSTALL_append = " optee-test optee-os optee-client optee-examples"&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Notice that I used in purpose &lt;EM&gt;&lt;STRONG&gt;"IMAGE_INSTALL_append"&lt;/STRONG&gt;&lt;/EM&gt; and not &lt;EM&gt;&lt;STRONG&gt;"IMAGE_INSTALL +="&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;. I passed long time to conclude that with the "IMAGE_INSTALL +="&amp;nbsp; I don't manage to see my binaries into rootfs of the image but with the append syntax that works correctly. I don't know for what reason is that. But with this way it worked perfectly. According to bitbake documentation that's equivalent but if you have any idea why is that don't hesitate to share it with us.&lt;/P&gt;&lt;P&gt;I hope that will solve the problem for you either if anyone had the same issue !&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 12:53:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Building-optee-examples-and-trusted-Apps-in-Yocto-bitbake/m-p/1383425#M184140</guid>
      <dc:creator>yuzarsif</dc:creator>
      <dc:date>2021-12-08T12:53:32Z</dc:date>
    </item>
  </channel>
</rss>

