Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] baremetal-image.bbclass: Emulate image.bbclass to handle new classes scope
@ 2022-08-23 21:31 Alejandro Enedino Hernandez Samaniego
  2022-08-23 22:13 ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Alejandro Enedino Hernandez Samaniego @ 2022-08-23 21:31 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alejandro Enedino Hernandez Samaniego

The new classes scope implemented on commit 7bd328f9d
made testimage.bbclass (and perhaps others) stop working
for baremetal-images, the expected way to run testimage
is no longer to use INHERIT but to use IMAGE_CLASSES
instead, however this functionality was not implemented in the
baremetal-image class until now.

Emulate image.bbclass allowing the baremetal-image class to
use IMAGE_CLASSES to fix this issue.

Set defaults for IMAGE_FEATURES to allow bitbake checks to
pass properly.

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
---
 meta/classes-recipe/baremetal-image.bbclass | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/meta/classes-recipe/baremetal-image.bbclass b/meta/classes-recipe/baremetal-image.bbclass
index 3a979f2ed1..d3377a92fa 100644
--- a/meta/classes-recipe/baremetal-image.bbclass
+++ b/meta/classes-recipe/baremetal-image.bbclass
@@ -15,6 +15,15 @@
 #
 # See meta-skeleton for a working example.
 
+## Emulate image.bbclass
+# Handle inherits of any of the image classes we need
+IMAGE_CLASSES ??= ""
+IMGCLASSES = " ${IMAGE_CLASSES}"
+inherit ${IMGCLASSES}
+# Set defaults to satisfy IMAGE_FEATURES check
+IMAGE_FEATURES ?= ""
+IMAGE_FEATURES[type] = "list"
+IMAGE_FEATURES[validitems] += ""
 
 # Toolchain should be baremetal or newlib based.
 # TCLIBC="baremetal" or TCLIBC="newlib"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH] baremetal-image.bbclass: Emulate image.bbclass to handle new classes scope
  2022-08-23 21:31 [PATCH] baremetal-image.bbclass: Emulate image.bbclass to handle new classes scope Alejandro Enedino Hernandez Samaniego
@ 2022-08-23 22:13 ` Richard Purdie
  2022-08-23 23:17   ` Alejandro Enedino Hernandez Samaniego
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2022-08-23 22:13 UTC (permalink / raw)
  To: Alejandro Hernandez Samaniego, openembedded-core

On Tue, 2022-08-23 at 15:31 -0600, Alejandro Hernandez Samaniego wrote:
> The new classes scope implemented on commit 7bd328f9d
> made testimage.bbclass (and perhaps others) stop working
> for baremetal-images, the expected way to run testimage
> is no longer to use INHERIT but to use IMAGE_CLASSES
> instead, however this functionality was not implemented in the
> baremetal-image class until now.
> 
> Emulate image.bbclass allowing the baremetal-image class to
> use IMAGE_CLASSES to fix this issue.
> 
> Set defaults for IMAGE_FEATURES to allow bitbake checks to
> pass properly.
> 
> Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
> ---
>  meta/classes-recipe/baremetal-image.bbclass | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/meta/classes-recipe/baremetal-image.bbclass b/meta/classes-recipe/baremetal-image.bbclass
> index 3a979f2ed1..d3377a92fa 100644
> --- a/meta/classes-recipe/baremetal-image.bbclass
> +++ b/meta/classes-recipe/baremetal-image.bbclass
> @@ -15,6 +15,15 @@
>  #
>  # See meta-skeleton for a working example.
>  
> +## Emulate image.bbclass
> +# Handle inherits of any of the image classes we need
> +IMAGE_CLASSES ??= ""
> +IMGCLASSES = " ${IMAGE_CLASSES}"
> +inherit ${IMGCLASSES}
> +# Set defaults to satisfy IMAGE_FEATURES check
> +IMAGE_FEATURES ?= ""
> +IMAGE_FEATURES[type] = "list"
> +IMAGE_FEATURES[validitems] += ""
>  
>  # Toolchain should be baremetal or newlib based.
>  # TCLIBC="baremetal" or TCLIBC="newlib"


I think we're missing a testcase!

Cheers,

Richard



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH] baremetal-image.bbclass: Emulate image.bbclass to handle new classes scope
  2022-08-23 22:13 ` [OE-core] " Richard Purdie
@ 2022-08-23 23:17   ` Alejandro Enedino Hernandez Samaniego
  0 siblings, 0 replies; 3+ messages in thread
From: Alejandro Enedino Hernandez Samaniego @ 2022-08-23 23:17 UTC (permalink / raw)
  To: Richard Purdie; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 2049 bytes --]

We are!, however is not that simple since the baremetal helloworld app
needs to have the interactive functionality to perform the back and forth
communication that testimage is based on.

Hopefully I can add such functionality to a newlib-helloworld in this
release along with its own test case.

Alejandro

On Tue, Aug 23, 2022, 4:13 PM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Tue, 2022-08-23 at 15:31 -0600, Alejandro Hernandez Samaniego wrote:
> > The new classes scope implemented on commit 7bd328f9d
> > made testimage.bbclass (and perhaps others) stop working
> > for baremetal-images, the expected way to run testimage
> > is no longer to use INHERIT but to use IMAGE_CLASSES
> > instead, however this functionality was not implemented in the
> > baremetal-image class until now.
> >
> > Emulate image.bbclass allowing the baremetal-image class to
> > use IMAGE_CLASSES to fix this issue.
> >
> > Set defaults for IMAGE_FEATURES to allow bitbake checks to
> > pass properly.
> >
> > Signed-off-by: Alejandro Enedino Hernandez Samaniego <
> alejandro@enedino.org>
> > ---
> >  meta/classes-recipe/baremetal-image.bbclass | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/meta/classes-recipe/baremetal-image.bbclass
> b/meta/classes-recipe/baremetal-image.bbclass
> > index 3a979f2ed1..d3377a92fa 100644
> > --- a/meta/classes-recipe/baremetal-image.bbclass
> > +++ b/meta/classes-recipe/baremetal-image.bbclass
> > @@ -15,6 +15,15 @@
> >  #
> >  # See meta-skeleton for a working example.
> >
> > +## Emulate image.bbclass
> > +# Handle inherits of any of the image classes we need
> > +IMAGE_CLASSES ??= ""
> > +IMGCLASSES = " ${IMAGE_CLASSES}"
> > +inherit ${IMGCLASSES}
> > +# Set defaults to satisfy IMAGE_FEATURES check
> > +IMAGE_FEATURES ?= ""
> > +IMAGE_FEATURES[type] = "list"
> > +IMAGE_FEATURES[validitems] += ""
> >
> >  # Toolchain should be baremetal or newlib based.
> >  # TCLIBC="baremetal" or TCLIBC="newlib"
>
>
> I think we're missing a testcase!
>
> Cheers,
>
> Richard
>
>

[-- Attachment #2: Type: text/html, Size: 2843 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-23 23:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-23 21:31 [PATCH] baremetal-image.bbclass: Emulate image.bbclass to handle new classes scope Alejandro Enedino Hernandez Samaniego
2022-08-23 22:13 ` [OE-core] " Richard Purdie
2022-08-23 23:17   ` Alejandro Enedino Hernandez Samaniego

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox