diff mbox series

[meta-ti,master/kirkstone,v2,01/15] meta-ti-bsp: Add helper class for TI Security Development Tools

Message ID 20230215193355.9676-2-afd@ti.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series ti-rtos-firmware and secdev | expand

Commit Message

Andrew Davis Feb. 15, 2023, 7:33 p.m. UTC
The setup here is common to all packages that require signing with
the TI Security Development Tools. Add a helper class to factor out
this commonality.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 meta-ti-bsp/classes/ti-secdev.bbclass | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 meta-ti-bsp/classes/ti-secdev.bbclass

Comments

Denys Dmytriyenko Feb. 22, 2023, 7:36 p.m. UTC | #1
On Wed, Feb 15, 2023 at 01:33:41PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
> The setup here is common to all packages that require signing with
> the TI Security Development Tools. Add a helper class to factor out
> this commonality.
> 
> Signed-off-by: Andrew Davis <afd@ti.com>

Tested-by: Denys Dmytriyenko <denys@konsulko.com>


> ---
>  meta-ti-bsp/classes/ti-secdev.bbclass | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
>  create mode 100644 meta-ti-bsp/classes/ti-secdev.bbclass
> 
> diff --git a/meta-ti-bsp/classes/ti-secdev.bbclass b/meta-ti-bsp/classes/ti-secdev.bbclass
> new file mode 100644
> index 00000000..b3d70e5c
> --- /dev/null
> +++ b/meta-ti-bsp/classes/ti-secdev.bbclass
> @@ -0,0 +1,21 @@
> +# Helper class to prepare correct environment for signing with TI Security Development Tools
> +
> +# K3 SECDEV scripts use OpenSSL
> +DEPENDS:append:k3 = " openssl-native"
> +DEPENDS:append:k3r5 = " openssl-native"
> +
> +# Use package version of TI SECDEV for K3 if one is not provided through the environment
> +DEPENDS:append:k3 = "${@ '' if d.getVar('TI_SECURE_DEV_PKG_K3') else ' ti-k3-secdev-native' }"
> +DEPENDS:append:k3r5 = "${@ '' if d.getVar('TI_SECURE_DEV_PKG_K3') else ' ti-k3-secdev-native' }"
> +TI_K3_SECDEV_INSTALL_DIR = "${STAGING_DIR_NATIVE}${datadir}/ti/ti-k3-secdev"
> +TI_SECURE_DEV_PKG:k3 = "${@ d.getVar('TI_SECURE_DEV_PKG_K3') or d.getVar('TI_K3_SECDEV_INSTALL_DIR') }"
> +TI_SECURE_DEV_PKG:k3r5 = "${@ d.getVar('TI_SECURE_DEV_PKG_K3') or d.getVar('TI_K3_SECDEV_INSTALL_DIR') }"
> +
> +# For non-K3 we require the SECDEV tools be provided through the environment with the following vars
> +TI_SECURE_DEV_PKG:ti33x = "${TI_SECURE_DEV_PKG_CAT}/am3x"
> +TI_SECURE_DEV_PKG:ti43x = "${TI_SECURE_DEV_PKG_CAT}/am4x"
> +TI_SECURE_DEV_PKG:am57xx = "${TI_SECURE_DEV_PKG_AUTO}/am5x"
> +TI_SECURE_DEV_PKG:dra7xx = "${TI_SECURE_DEV_PKG_AUTO}/dra7"
> +
> +# The SECDEV scripts may need their own location provided through the environment
> +export TI_SECURE_DEV_PKG
> -- 
> 2.39.1
diff mbox series

Patch

diff --git a/meta-ti-bsp/classes/ti-secdev.bbclass b/meta-ti-bsp/classes/ti-secdev.bbclass
new file mode 100644
index 00000000..b3d70e5c
--- /dev/null
+++ b/meta-ti-bsp/classes/ti-secdev.bbclass
@@ -0,0 +1,21 @@ 
+# Helper class to prepare correct environment for signing with TI Security Development Tools
+
+# K3 SECDEV scripts use OpenSSL
+DEPENDS:append:k3 = " openssl-native"
+DEPENDS:append:k3r5 = " openssl-native"
+
+# Use package version of TI SECDEV for K3 if one is not provided through the environment
+DEPENDS:append:k3 = "${@ '' if d.getVar('TI_SECURE_DEV_PKG_K3') else ' ti-k3-secdev-native' }"
+DEPENDS:append:k3r5 = "${@ '' if d.getVar('TI_SECURE_DEV_PKG_K3') else ' ti-k3-secdev-native' }"
+TI_K3_SECDEV_INSTALL_DIR = "${STAGING_DIR_NATIVE}${datadir}/ti/ti-k3-secdev"
+TI_SECURE_DEV_PKG:k3 = "${@ d.getVar('TI_SECURE_DEV_PKG_K3') or d.getVar('TI_K3_SECDEV_INSTALL_DIR') }"
+TI_SECURE_DEV_PKG:k3r5 = "${@ d.getVar('TI_SECURE_DEV_PKG_K3') or d.getVar('TI_K3_SECDEV_INSTALL_DIR') }"
+
+# For non-K3 we require the SECDEV tools be provided through the environment with the following vars
+TI_SECURE_DEV_PKG:ti33x = "${TI_SECURE_DEV_PKG_CAT}/am3x"
+TI_SECURE_DEV_PKG:ti43x = "${TI_SECURE_DEV_PKG_CAT}/am4x"
+TI_SECURE_DEV_PKG:am57xx = "${TI_SECURE_DEV_PKG_AUTO}/am5x"
+TI_SECURE_DEV_PKG:dra7xx = "${TI_SECURE_DEV_PKG_AUTO}/dra7"
+
+# The SECDEV scripts may need their own location provided through the environment
+export TI_SECURE_DEV_PKG