]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
wic: pluginbase ensure layer order when load plugins
authorAnibal Limon <anibal@limonsoftware.com>
Wed, 11 Jun 2025 15:33:18 +0000 (15:33 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Jun 2025 16:56:27 +0000 (17:56 +0100)
To support extensions on wic plugins, the load order needs
to be grauntee matching BBLAYERS variable.

Fix cases when try to import a plugin from another layer,
example of the case to fix,

```
Traceback (most recent call last):
  File "/workspaces/ls/linux/layers/openembedded-core/scripts/wic",line
547, in <module>
    sys.exit(main(sys.argv[1:]))
             ^^^^^^^^^^^^^^^^^^
...
  File "/workspaces/ls/linux/layers/openembedded-core/scripts/lib/wic/
engine.py", line 137, in list_source_plugins
    plugins = PluginMgr.get_plugins('source')
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/ls/linux/layers/openembedded-core/scripts/lib/wic/
pluginbase.py", line 73, in get_plugins
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/workspaces/ls/linux/limonsoftware/bsp/scripts/lib/wic/plugins/
source/bootimg_rpi_autoboot_partition.py", line 1, in <module>
    from wic.plugins.source.bootimg_partition import BootimgPartitionPlugin
ModuleNotFoundError: No module named 'wic.plugins.source.bootimg_partition'
```

Signed-off-by: Anibal Limon <anibal@limonsoftware.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/pluginbase.py

index b64568339b1bd03ce5a8143106b61f35c2b8bca2..640da292d3bef3e2cfec46fb065f23eb5c79c388 100644 (file)
@@ -44,7 +44,7 @@ class PluginMgr:
                     path = os.path.join(layer_path, script_plugin_dir)
                     path = os.path.abspath(os.path.expanduser(path))
                     if path not in cls._plugin_dirs and os.path.isdir(path):
-                        cls._plugin_dirs.insert(0, path)
+                        cls._plugin_dirs.append(path)
 
         if ptype not in PLUGINS:
             # load all ptype plugins