summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Chee Yang <chee.yang.lee@intel.com>2020-04-01 14:39:56 +0800
committerArmin Kuster <akuster808@gmail.com>2020-04-19 17:15:38 -0700
commit8351cb19e8a83157143b1df61cd9bbb71282e9fc (patch)
tree4ac82dafac456f82cbb8cd4321cffd1cd25efdfc
parent2cbb3a663a3d3b2dcf8c12c26843d6087789ded0 (diff)
downloadopenembedded-core-contrib-8351cb19e8a83157143b1df61cd9bbb71282e9fc.tar.gz
openembedded-core-contrib-8351cb19e8a83157143b1df61cd9bbb71282e9fc.tar.bz2
openembedded-core-contrib-8351cb19e8a83157143b1df61cd9bbb71282e9fc.zip
wic: align layer plugin path
wic look for external layer source plugin under scripts/lib/ while other tools look for lib/. allow wic to check for source plugin at both scripts/lib/ and lib/ to align with other tools while avoid breaking any existing source plugin in external layer. [YOCTO #13056] Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 986baff26bd96a6265f5fe2d631818fff9f66374) Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--scripts/lib/wic/help.py3
-rw-r--r--scripts/lib/wic/pluginbase.py11
2 files changed, 8 insertions, 6 deletions
diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
index 3a40fc0ea2..03d84bd1d7 100644
--- a/scripts/lib/wic/help.py
+++ b/scripts/lib/wic/help.py
@@ -523,7 +523,8 @@ DESCRIPTION
Source plugins can also be implemented and added by external
layers - any plugins found in a scripts/lib/wic/plugins/source/
- directory in an external layer will also be made available.
+ or lib/wic/plugins/source/ directory in an external layer will
+ also be made available.
When the wic implementation needs to invoke a partition-specific
implementation, it looks for the plugin that has the same name as
diff --git a/scripts/lib/wic/pluginbase.py b/scripts/lib/wic/pluginbase.py
index f74d6430fd..d9b4e57747 100644
--- a/scripts/lib/wic/pluginbase.py
+++ b/scripts/lib/wic/pluginbase.py
@@ -18,7 +18,7 @@ from wic.misc import get_bitbake_var
PLUGIN_TYPES = ["imager", "source"]
-SCRIPTS_PLUGIN_DIR = "scripts/lib/wic/plugins"
+SCRIPTS_PLUGIN_DIR = ["scripts/lib/wic/plugins", "lib/wic/plugins"]
logger = logging.getLogger('wic')
@@ -38,10 +38,11 @@ class PluginMgr:
cls._plugin_dirs = [os.path.join(os.path.dirname(__file__), 'plugins')]
layers = get_bitbake_var("BBLAYERS") or ''
for layer_path in layers.split():
- path = os.path.join(layer_path, SCRIPTS_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)
+ for script_plugin_dir in SCRIPTS_PLUGIN_DIR:
+ 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)
if ptype not in PLUGINS:
# load all ptype plugins