summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLee Chee Yang <chee.yang.lee@intel.com>2020-04-01 14:39:56 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-04-29 16:11:56 +0100
commit51586b5612cfba9bc9928dcf1837a90a7f2d50f8 (patch)
treebff9cb16f6c7aec9b72338cd177474c0a452392e /scripts
parent4d888ebbda3635f90789e381b323b39daec93c7c (diff)
downloadpoky-51586b5612cfba9bc9928dcf1837a90a7f2d50f8.tar.gz
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] (From OE-Core rev: 8351cb19e8a83157143b1df61cd9bbb71282e9fc) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-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
523 523
524 Source plugins can also be implemented and added by external 524 Source plugins can also be implemented and added by external
525 layers - any plugins found in a scripts/lib/wic/plugins/source/ 525 layers - any plugins found in a scripts/lib/wic/plugins/source/
526 directory in an external layer will also be made available. 526 or lib/wic/plugins/source/ directory in an external layer will
527 also be made available.
527 528
528 When the wic implementation needs to invoke a partition-specific 529 When the wic implementation needs to invoke a partition-specific
529 implementation, it looks for the plugin that has the same name as 530 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
18 18
19PLUGIN_TYPES = ["imager", "source"] 19PLUGIN_TYPES = ["imager", "source"]
20 20
21SCRIPTS_PLUGIN_DIR = "scripts/lib/wic/plugins" 21SCRIPTS_PLUGIN_DIR = ["scripts/lib/wic/plugins", "lib/wic/plugins"]
22 22
23logger = logging.getLogger('wic') 23logger = logging.getLogger('wic')
24 24
@@ -38,10 +38,11 @@ class PluginMgr:
38 cls._plugin_dirs = [os.path.join(os.path.dirname(__file__), 'plugins')] 38 cls._plugin_dirs = [os.path.join(os.path.dirname(__file__), 'plugins')]
39 layers = get_bitbake_var("BBLAYERS") or '' 39 layers = get_bitbake_var("BBLAYERS") or ''
40 for layer_path in layers.split(): 40 for layer_path in layers.split():
41 path = os.path.join(layer_path, SCRIPTS_PLUGIN_DIR) 41 for script_plugin_dir in SCRIPTS_PLUGIN_DIR:
42 path = os.path.abspath(os.path.expanduser(path)) 42 path = os.path.join(layer_path, script_plugin_dir)
43 if path not in cls._plugin_dirs and os.path.isdir(path): 43 path = os.path.abspath(os.path.expanduser(path))
44 cls._plugin_dirs.insert(0, path) 44 if path not in cls._plugin_dirs and os.path.isdir(path):
45 cls._plugin_dirs.insert(0, path)
45 46
46 if ptype not in PLUGINS: 47 if ptype not in PLUGINS:
47 # load all ptype plugins 48 # load all ptype plugins