diff mbox series

[kirkstone,2.0] bitbake-layers: initialize tinfoil before registering command line arguments

Message ID 20230803114210.604-1-jermain.horsman@nedap.com
State Accepted, archived
Commit 41b6684489d0261753344956042be2cc4adb0159
Headers show
Series [kirkstone,2.0] bitbake-layers: initialize tinfoil before registering command line arguments | expand

Commit Message

jhatnedap@gmail.com Aug. 3, 2023, 11:39 a.m. UTC
From: Alexander Kanavin <alex.kanavin@gmail.com>

Plugins may want to use it (e.g. the layers-setup plugin that would
want to discover writer sub-plugins with it), and so it makes sense
to make tinfoil available a bit eariler.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2f6c7523a622f59ddf84a1a196927492bc5fa7a2)
Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com>
---


The layers-setup plugin that has been added to the Yocto Project
recently is unfortunately not available on the latest LTS (kirkstone).

After a discussion with Alex about this, I set up a mixin layer to
enable this functionality, however this commit is required to get it
working.
Normally LTS releases would not get new functionality, but I think
this commit is fairly minimal and would allow for a valuable addition.

If people want to try and test this I have published the mixin layer:
https://github.com/nedap/meta-nedap-mixins



 bin/bitbake-layers | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alexander Kanavin Aug. 4, 2023, 4:04 p.m. UTC | #1
This has landed in kirkstone, thanks.

Looking at the mixin repo, the problematic piece for backporting to
kirkstone directly would be meta/lib/oe/buildcfg.py. Backporting that
with all the other changes across the tree is rather invasive, and
makes it ineligible. The rest is self-contained and independent.

Alex

On Thu, 3 Aug 2023 at 13:43, <jhatnedap@gmail.com> wrote:
>
> From: Alexander Kanavin <alex.kanavin@gmail.com>
>
> Plugins may want to use it (e.g. the layers-setup plugin that would
> want to discover writer sub-plugins with it), and so it makes sense
> to make tinfoil available a bit eariler.
>
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> (cherry picked from commit 2f6c7523a622f59ddf84a1a196927492bc5fa7a2)
> Signed-off-by: Jermain Horsman <jermain.horsman@nedap.com>
> ---
>
>
> The layers-setup plugin that has been added to the Yocto Project
> recently is unfortunately not available on the latest LTS (kirkstone).
>
> After a discussion with Alex about this, I set up a mixin layer to
> enable this functionality, however this commit is required to get it
> working.
> Normally LTS releases would not get new functionality, but I think
> this commit is fairly minimal and would allow for a valuable addition.
>
> If people want to try and test this I have published the mixin layer:
> https://github.com/nedap/meta-nedap-mixins
>
>
>
>  bin/bitbake-layers | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/bin/bitbake-layers b/bin/bitbake-layers
> index 449434d4..d4b1d1aa 100755
> --- a/bin/bitbake-layers
> +++ b/bin/bitbake-layers
> @@ -68,11 +68,11 @@ def main():
>
>          registered = False
>          for plugin in plugins:
> +            if hasattr(plugin, 'tinfoil_init'):
> +                plugin.tinfoil_init(tinfoil)
>              if hasattr(plugin, 'register_commands'):
>                  registered = True
>                  plugin.register_commands(subparsers)
> -            if hasattr(plugin, 'tinfoil_init'):
> -                plugin.tinfoil_init(tinfoil)
>
>          if not registered:
>              logger.error("No commands registered - missing plugins?")
> --
> 2.41.0.windows.1
>
diff mbox series

Patch

diff --git a/bin/bitbake-layers b/bin/bitbake-layers
index 449434d4..d4b1d1aa 100755
--- a/bin/bitbake-layers
+++ b/bin/bitbake-layers
@@ -68,11 +68,11 @@  def main():
 
         registered = False
         for plugin in plugins:
+            if hasattr(plugin, 'tinfoil_init'):
+                plugin.tinfoil_init(tinfoil)
             if hasattr(plugin, 'register_commands'):
                 registered = True
                 plugin.register_commands(subparsers)
-            if hasattr(plugin, 'tinfoil_init'):
-                plugin.tinfoil_init(tinfoil)
 
         if not registered:
             logger.error("No commands registered - missing plugins?")