Jake,

The reason for this change is that some platforms still build optee, but do 
not need to include it into the main FIT image. E.g. AM65x has optee included 
into U-boot. So, relying just on OPTEE* variables to trigger inclusion into 
FIT wasn't granular enough.

The other way around, just unsetting OPTEE* vars does not automatically 
disable building optee - you would still need to remove any package 
dependencies. Though if OPTEE* is unset, but FITIMAGE_PACK_TEE is enabled, 
it would trigger optee build and break. Not sure if it's a valid case, but 
we can add some checks to avoid this. Either way, the right approach here 
would be to not unset OPTEE* vars, but instead reset FITIMAGE_PACK_TEE.

-- 
Denys


On Fri, May 10, 2019 at 09:53:37AM -0400, Jacob Stiffler wrote:
> Denys,
> 
> We have been excluding optee by unsetting OPTEEMACHINE and OPTEEFLAVOR. Now
> with this change, will we instead need to set FITIMAGE_PACK_TEE = "0" for
> these machines?
> 
> 
> Thank you,
> 
> Jake
> 
> On 5/9/2019 2:27 AM, Denys Dmytriyenko wrote:
> >Instead of relying on OPTEEMACHINE and OPTEEFLAVOR, use FITIMAGE_PACK_TEE
> >to specify if packing OPTEE into FIT is required.
> >
> >Signed-off-by: Denys Dmytriyenko <[email protected]>
> >---
> >v2 - revert setting only am4/am5/dra7 HS devices
> >
> >  meta-arago-distro/classes/kernel-fitimage.bbclass | 7 ++++---
> >  meta-arago-distro/conf/distro/arago.conf          | 4 ++++
> >  2 files changed, 8 insertions(+), 3 deletions(-)
> >
> >diff --git a/meta-arago-distro/classes/kernel-fitimage.bbclass 
> >b/meta-arago-distro/classes/kernel-fitimage.bbclass
> >index 9aa7640..34b61d0 100644
> >--- a/meta-arago-distro/classes/kernel-fitimage.bbclass
> >+++ b/meta-arago-distro/classes/kernel-fitimage.bbclass
> >@@ -1,6 +1,7 @@
> >  inherit kernel-uboot uboot-sign
> >  FITIMAGE_HASH_ALGO ?= "sha1"
> >+FITIMAGE_PACK_TEE ?= "0"
> >  FITIMAGE_DTB_BY_NAME ?= "0"
> >  FITIMAGE_TEE_BY_NAME ?= "0"
> >  FITIMAGE_CONF_BY_NAME ?= "0"
> >@@ -46,7 +47,7 @@ python __anonymous () {
> >              uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot'
> >              d.appendVarFlag('do_assemble_fitimage', 'depends', ' 
> > %s:do_deploy' % uboot_pn)
> >-        if d.getVar('OPTEEMACHINE'):
> >+        if d.getVar('FITIMAGE_PACK_TEE') == "1":
> >              d.appendVarFlag('do_assemble_fitimage', 'depends', ' 
> > optee-os:do_deploy')
> >  }
> >@@ -323,7 +324,7 @@ fitimage_emit_section_config() {
> >             setup_line="setup = \"setup@${5}\";"
> >     fi
> >-    if [ -n "${6}" -a -n "${OPTEEFLAVOR}" ]; then
> >+    if [ -n "${6}" -a "x${FITIMAGE_PACK_TEE}" = "x1" ]; then
> >             if [ "x${FITIMAGE_TEE_BY_NAME}" = "x1" ]; then
> >                     loadables_line="loadables = \"${6}.optee\";"
> >                     loadables_pager_line="loadables = \"${6}-pager.optee\";"
> >@@ -530,7 +531,7 @@ fitimage_assemble() {
> >     #
> >     # Step 2a: Prepare OP/TEE image section
> >     #
> >-    if test -n "${OPTEEFLAVOR}"; then
> >+    if [ "x${FITIMAGE_PACK_TEE}" = "x1" ] ; then
> >             mkdir -p ${B}/usr
> >             rm -f ${B}/usr/${OPTEEFLAVOR}.optee
> >             if [ -e "${DEPLOY_DIR_IMAGE}/${OPTEEFLAVOR}.optee" ]; then
> >diff --git a/meta-arago-distro/conf/distro/arago.conf 
> >b/meta-arago-distro/conf/distro/arago.conf
> >index 7129202..5913d5b 100644
> >--- a/meta-arago-distro/conf/distro/arago.conf
> >+++ b/meta-arago-distro/conf/distro/arago.conf
> >@@ -38,6 +38,10 @@ IMAGE_FSTYPES += "tar.xz.md5"
> >  # FIT image for secure devices
> >  KERNEL_CLASSES += "kernel-fitimage"
> >  FITIMAGE_HASH_ALGO = ""
> >+FITIMAGE_PACK_TEE = "0"
> >+FITIMAGE_PACK_TEE_am437x-hs-evm = "1"
> >+FITIMAGE_PACK_TEE_am57xx-hs-evm = "1"
> >+FITIMAGE_PACK_TEE_dra7xx-hs-evm = "1"
> >  FITIMAGE_DTB_BY_NAME = "1"
> >  FITIMAGE_TEE_BY_NAME = "1"
> >  FITIMAGE_CONF_BY_NAME = "1"
_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago

Reply via email to