Skip to contentSkip to conversation

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

kirkstone [email protected] 2 participants 2 messages Aug 3, 2023 – Aug 4, 2023

lore
Share & tools
lore
#0 lore raw

From: Alexander Kanavin <[email protected]>

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.

(cherry picked from commit 2f6c7523a622f59ddf84a1a196927492bc5fa7a2)

---

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(-)
bin/bitbake-layers +2 -2
index 449434d4..d4b1d1aa 100755
@@ -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?")
Signature · 1 line
2.41.0.windows.1
#1 lore raw

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

Quoted 52 lines · On Thu, 3 Aug 2023 at 13:43, <[email protected]> wrote:

From: Alexander Kanavin <[email protected]>

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.

(cherry picked from commit 2f6c7523a622f59ddf84a1a196927492bc5fa7a2)

---

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(-)
bin/bitbake-layers +2 -3
index 449434d4..d4b1d1aa 100755
@@ -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