diff mbox series

[wic,2/2] wic/engine: Simplify search paths

Message ID 20260405144222.3733875-2-richard.purdie@linuxfoundation.org
State New
Headers show
Series [wic,1/2] wic/engine: Add files/wic to the search path | expand

Commit Message

Richard Purdie April 5, 2026, 2:42 p.m. UTC
Drop "wic" and "scripts/lib/wic/canned-wks" as search paths and just use "files/wic"
as the default location for files. Also use BBPATH, not BBLAYERS, which aligns with
the search paths in OE-Core's classes by default.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 src/wic/engine.py | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)
diff mbox series

Patch

diff --git a/src/wic/engine.py b/src/wic/engine.py
index 3612017..dcc3527 100644
--- a/src/wic/engine.py
+++ b/src/wic/engine.py
@@ -43,24 +43,14 @@  def verify_build_env():
     return True
 
 
-CANNED_IMAGE_DIR = "lib/wic/canned-wks" # relative to scripts
-SCRIPTS_CANNED_IMAGE_DIR = "scripts/" + CANNED_IMAGE_DIR
-WIC_DIR = "wic"
-WIC_FILES_DIR = "files/wic"
-
 def build_canned_image_list(path):
-    layers_path = get_bitbake_var("BBLAYERS")
+    bbpath = (get_bitbake_var("BBPATH") or "").split(":")
     canned_wks_layer_dirs = []
 
-    if layers_path is not None:
-        for layer_path in layers_path.split():
-            for wks_path in (WIC_FILES_DIR, WIC_DIR, SCRIPTS_CANNED_IMAGE_DIR):
-                cpath = os.path.join(layer_path, wks_path)
-                if os.path.isdir(cpath):
-                    canned_wks_layer_dirs.append(cpath)
-
-    cpath = os.path.join(path, CANNED_IMAGE_DIR)
-    canned_wks_layer_dirs.append(cpath)
+    for layer_path in bbpath:
+        cpath = os.path.join(layer_path, 'files', 'wic')
+        if os.path.isdir(cpath):
+            canned_wks_layer_dirs.append(cpath)
 
     return canned_wks_layer_dirs