diff mbox series

[meta-ti,2/3] ti-k3-secdev: sets TI_K3_SECDEV_INSTALL_DIR_RECIPE default value

Message ID 20230116121626.885219-2-jose.quaresma@foundries.io
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [meta-ti,1/3] ti-k3-secdev: move from meta-ti-extras to meta-ti-bsp | expand

Commit Message

Jose Quaresma Jan. 16, 2023, 12:16 p.m. UTC
The TI_K3_SECDEV_INSTALL_DIR_RECIPE is defined on the meta-ti-extras layer
so when the layer is not used the variable is undefined.
For such cases we can use default value that is the same defined
on the recipes-ti/includes/ti-paths.inc

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
---
 meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andrew Davis Jan. 16, 2023, 5:08 p.m. UTC | #1
On 1/16/23 6:16 AM, Jose Quaresma wrote:
> The TI_K3_SECDEV_INSTALL_DIR_RECIPE is defined on the meta-ti-extras layer
> so when the layer is not used the variable is undefined.
> For such cases we can use default value that is the same defined
> on the recipes-ti/includes/ti-paths.inc
> 
> Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
> ---
>   meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb b/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb
> index fd3bd120..6a28add7 100644
> --- a/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb
> +++ b/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb
> @@ -4,6 +4,8 @@ SECTION = "devel"
>   LICENSE = "BSD-3-Clause"
>   LIC_FILES_CHKSUM = "file://manifest/k3-secdev-0.2-manifest.html;md5=f632a78870cc64550078d7b3cbac0892"
>   
> +# set a default value for TI_K3_SECDEV_INSTALL_DIR_RECIPE
> +export TI_K3_SECDEV_INSTALL_DIR_RECIPE = "${datadir}/ti/ti-k3-secdev"
>   include recipes-ti/includes/ti-paths.inc
>   

Using ti-paths.inc was not really right to begin with, I only did that as I was in a time
crunch, should be just removed (all of the file actually, but we can fix that later). Like
other -native tool recipes, the output should end up in a standard place that can be accessed
by recipes that depend on it. If -native packages could set env vars that would be nice, but
without that, lets just assume location and drop the include on ti-paths.inc.

For ti-k3-secdev_git.bb I'm thinking something like:


--- a/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb
+++ b/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb
@@ -4,8 +4,6 @@ SECTION = "devel"
  LICENSE = "BSD-3-Clause"
  LIC_FILES_CHKSUM = "file://manifest/k3-secdev-0.2-manifest.html;md5=f632a78870cc64550078d7b3cbac0892"
  
-require recipes-ti/includes/ti-paths.inc
-
  # Native host tool only
  COMPATIBLE_MACHINE = "null"
  COMPATIBLE_MACHINE:class-native = "(.*)"
@@ -23,11 +21,11 @@ S = "${WORKDIR}/git"
  
  do_install() {
      CP_ARGS="-Prf --preserve=mode,links,timestamps --no-preserve=ownership"
-    install -d ${D}${TI_K3_SECDEV_INSTALL_DIR_RECIPE}
-    cp ${CP_ARGS} ${S}/* ${D}${TI_K3_SECDEV_INSTALL_DIR_RECIPE}
+    install -d ${D}${datadir}/ti/ti-k3-secdev
+    cp ${CP_ARGS} ${S}/* ${D}${datadir}/ti/ti-k3-secdev
  }
  
-FILES:${PN} += "${TI_K3_SECDEV_INSTALL_DIR_RECIPE}"
+FILES:${PN} += "${D}${datadir}/ti/ti-k3-secdev"
  
  INSANE_SKIP:${PN} = "arch ldflags file-rdeps"
Jose Quaresma Jan. 16, 2023, 5:41 p.m. UTC | #2
Hi Andrew,

Thanks for your comment.

Andrew Davis <afd@ti.com> escreveu no dia segunda, 16/01/2023 à(s) 17:08:

> On 1/16/23 6:16 AM, Jose Quaresma wrote:
> > The TI_K3_SECDEV_INSTALL_DIR_RECIPE is defined on the meta-ti-extras
> layer
> > so when the layer is not used the variable is undefined.
> > For such cases we can use default value that is the same defined
> > on the recipes-ti/includes/ti-paths.inc
> >
> > Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
> > ---
> >   meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb | 2 ++
> >   1 file changed, 2 insertions(+)
> >
> > diff --git a/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb
> b/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb
> > index fd3bd120..6a28add7 100644
> > --- a/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb
> > +++ b/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb
> > @@ -4,6 +4,8 @@ SECTION = "devel"
> >   LICENSE = "BSD-3-Clause"
> >   LIC_FILES_CHKSUM =
> "file://manifest/k3-secdev-0.2-manifest.html;md5=f632a78870cc64550078d7b3cbac0892"
> >
> > +# set a default value for TI_K3_SECDEV_INSTALL_DIR_RECIPE
> > +export TI_K3_SECDEV_INSTALL_DIR_RECIPE = "${datadir}/ti/ti-k3-secdev"
> >   include recipes-ti/includes/ti-paths.inc
> >
>
> Using ti-paths.inc was not really right to begin with, I only did that as
> I was in a time
> crunch, should be just removed (all of the file actually, but we can fix
> that later). Like
> other -native tool recipes, the output should end up in a standard place
> that can be accessed
> by recipes that depend on it. If -native packages could set env vars that
> would be nice, but
> without that, lets just assume location and drop the include on
> ti-paths.inc.
>

I think this can be done in a follow up patch, in this series I am trying
to make it simple
changing only the strictly required to remove the dependencies of
meta-ti-extras.


>
> For ti-k3-secdev_git.bb I'm thinking something like:
>
>
> --- a/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb
> +++ b/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb
> @@ -4,8 +4,6 @@ SECTION = "devel"
>   LICENSE = "BSD-3-Clause"
>   LIC_FILES_CHKSUM =
> "file://manifest/k3-secdev-0.2-manifest.html;md5=f632a78870cc64550078d7b3cbac0892"
>
> -require recipes-ti/includes/ti-paths.inc
> -
>   # Native host tool only
>   COMPATIBLE_MACHINE = "null"
>   COMPATIBLE_MACHINE:class-native = "(.*)"
> @@ -23,11 +21,11 @@ S = "${WORKDIR}/git"
>
>   do_install() {
>       CP_ARGS="-Prf --preserve=mode,links,timestamps
> --no-preserve=ownership"
> -    install -d ${D}${TI_K3_SECDEV_INSTALL_DIR_RECIPE}
> -    cp ${CP_ARGS} ${S}/* ${D}${TI_K3_SECDEV_INSTALL_DIR_RECIPE}
> +    install -d ${D}${datadir}/ti/ti-k3-secdev
> +    cp ${CP_ARGS} ${S}/* ${D}${datadir}/ti/ti-k3-secdev
>   }
>
> -FILES:${PN} += "${TI_K3_SECDEV_INSTALL_DIR_RECIPE}"
> +FILES:${PN} += "${D}${datadir}/ti/ti-k3-secdev"
>

I agree with this approach and if any additional change is needed it can be
done on the distro layer with a bbappend
or something else.

Jose


>
>   INSANE_SKIP:${PN} = "arch ldflags file-rdeps"
>
>
Andrew Davis Jan. 16, 2023, 6:48 p.m. UTC | #3
On 1/16/23 11:41 AM, Jose Quaresma wrote:
> Hi Andrew,
> 
> Thanks for your comment.
> 
> Andrew Davis <afd@ti.com <mailto:afd@ti.com>> escreveu no dia segunda, 16/01/2023 à(s) 17:08:
> 
>     On 1/16/23 6:16 AM, Jose Quaresma wrote:
>      > The TI_K3_SECDEV_INSTALL_DIR_RECIPE is defined on the meta-ti-extras layer
>      > so when the layer is not used the variable is undefined.
>      > For such cases we can use default value that is the same defined
>      > on the recipes-ti/includes/ti-paths.inc
>      >
>      > Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io <mailto:jose.quaresma@foundries.io>>
>      > ---
>      >   meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb <http://ti-k3-secdev_git.bb> | 2 ++
>      >   1 file changed, 2 insertions(+)
>      >
>      > diff --git a/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb <http://ti-k3-secdev_git.bb> b/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb <http://ti-k3-secdev_git.bb>
>      > index fd3bd120..6a28add7 100644
>      > --- a/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb <http://ti-k3-secdev_git.bb>
>      > +++ b/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb <http://ti-k3-secdev_git.bb>
>      > @@ -4,6 +4,8 @@ SECTION = "devel"
>      >   LICENSE = "BSD-3-Clause"
>      >   LIC_FILES_CHKSUM = "file://manifest/k3-secdev-0.2-manifest.html;md5=f632a78870cc64550078d7b3cbac0892"
>      >
>      > +# set a default value for TI_K3_SECDEV_INSTALL_DIR_RECIPE
>      > +export TI_K3_SECDEV_INSTALL_DIR_RECIPE = "${datadir}/ti/ti-k3-secdev"
>      >   include recipes-ti/includes/ti-paths.inc
>      >
> 
>     Using ti-paths.inc was not really right to begin with, I only did that as I was in a time
>     crunch, should be just removed (all of the file actually, but we can fix that later). Like
>     other -native tool recipes, the output should end up in a standard place that can be accessed
>     by recipes that depend on it. If -native packages could set env vars that would be nice, but
>     without that, lets just assume location and drop the include on ti-paths.inc.
> 
> 
> I think this can be done in a follow up patch, in this series I am trying to make it simple
> changing only the strictly required to remove the dependencies of meta-ti-extras.
> 

That's fine, just giving future ideas/plans, for this current series,

Acked-by: Andrew Davis <afd@ti.com>

> 
>     For ti-k3-secdev_git.bb <http://ti-k3-secdev_git.bb> I'm thinking something like:
> 
> 
>     --- a/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb <http://ti-k3-secdev_git.bb>
>     +++ b/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb <http://ti-k3-secdev_git.bb>
>     @@ -4,8 +4,6 @@ SECTION = "devel"
>        LICENSE = "BSD-3-Clause"
>        LIC_FILES_CHKSUM = "file://manifest/k3-secdev-0.2-manifest.html;md5=f632a78870cc64550078d7b3cbac0892"
> 
>     -require recipes-ti/includes/ti-paths.inc
>     -
>        # Native host tool only
>        COMPATIBLE_MACHINE = "null"
>        COMPATIBLE_MACHINE:class-native = "(.*)"
>     @@ -23,11 +21,11 @@ S = "${WORKDIR}/git"
> 
>        do_install() {
>            CP_ARGS="-Prf --preserve=mode,links,timestamps --no-preserve=ownership"
>     -    install -d ${D}${TI_K3_SECDEV_INSTALL_DIR_RECIPE}
>     -    cp ${CP_ARGS} ${S}/* ${D}${TI_K3_SECDEV_INSTALL_DIR_RECIPE}
>     +    install -d ${D}${datadir}/ti/ti-k3-secdev
>     +    cp ${CP_ARGS} ${S}/* ${D}${datadir}/ti/ti-k3-secdev
>        }
> 
>     -FILES:${PN} += "${TI_K3_SECDEV_INSTALL_DIR_RECIPE}"
>     +FILES:${PN} += "${D}${datadir}/ti/ti-k3-secdev"
> 
> 
> I agree with this approach and if any additional change is needed it can be done on the distro layer with a bbappend
> or something else.
> 
> Jose
> 
> 
>        INSANE_SKIP:${PN} = "arch ldflags file-rdeps"
> 
> 
> 
> -- 
> Best regards,
> 
> José Quaresma
diff mbox series

Patch

diff --git a/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb b/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb
index fd3bd120..6a28add7 100644
--- a/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb
+++ b/meta-ti-bsp/recipes-ti/secdev/ti-k3-secdev_git.bb
@@ -4,6 +4,8 @@  SECTION = "devel"
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://manifest/k3-secdev-0.2-manifest.html;md5=f632a78870cc64550078d7b3cbac0892"
 
+# set a default value for TI_K3_SECDEV_INSTALL_DIR_RECIPE
+export TI_K3_SECDEV_INSTALL_DIR_RECIPE = "${datadir}/ti/ti-k3-secdev"
 include recipes-ti/includes/ti-paths.inc
 
 # Native host tool only