Skip to contentSkip to conversation

wic: look for wks files in <layer>/recipes-images

PATCH Superseded Ed Bartosh 3 participants 5 messages Dec 16, 2016 – Dec 20, 2016

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 wic: look for wks files in <layer>/recipes-images

Currently wic looks for wks files in
<layer dir>/scripts/lib/wic/canned-wks/ directories. This path is too nested and doesn't look consistent with the naming scheme of layer directories.

Added 'recipes-images' directory to the list of paths to look for wks files.

---
 scripts/lib/wic/engine.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/lib/wic/engine.py +5 -2
index 5b10463..8353edb 100644
@@ -52,6 +52,7 @@ def verify_build_env():
 
 CANNED_IMAGE_DIR = "lib/wic/canned-wks" # relative to scripts
 SCRIPTS_CANNED_IMAGE_DIR = "scripts/" + CANNED_IMAGE_DIR
+RECIPES_IMAGES_DIR = "recipes-images"
 
 def build_canned_image_list(path):
     layers_path = misc.get_bitbake_var("BBLAYERS")
@@ -59,8 +60,10 @@ def build_canned_image_list(path):
 
     if layers_path is not None:
         for layer_path in layers_path.split():
-            cpath = os.path.join(layer_path, SCRIPTS_CANNED_IMAGE_DIR)
-            canned_wks_layer_dirs.append(cpath)
+            for wks_path in (RECIPES_IMAGES_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)
Signature · 1 line
2.1.4
#1 lore raw

Hi Ed,

Quoted 7 lines · On Fri, 16 Dec 2016 22:30:45 Ed Bartosh wrote:

Currently wic looks for wks files in
<layer dir>/scripts/lib/wic/canned-wks/ directories. This path is too nested and doesn't look consistent with the naming scheme of layer directories.

Added 'recipes-images' directory to the list of paths to look for wks files.

I agree we ought to change this, but "recipes-images" isn't especially consistent with how paths are used in OE layers. Recipes are found using BBFILES, and at least in OE-Core its meta/recipes-*/*/*.bb - i.e. one layer down from recipes-images.

If I were to suggest an alternative it would be to just use a different name that doesn't imply connection with how images are found (e.g. "canned-wks" or "wic" or something like that).

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
author
#2 lore raw

PATCH v2 1/1 wic: look for wks files in <layer>/wic

Currently wic looks for wks files in
<layer dir>/scripts/lib/wic/canned-wks/ directories. This path is too nested and doesn't look consistent with the naming scheme of layer directories.

Added <layer>/wic directory to the list of paths
to look for wks files.

---
 scripts/lib/wic/engine.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/lib/wic/engine.py +5 -2
index 5b10463..2adef2f 100644
@@ -52,6 +52,7 @@ def verify_build_env():
 
 CANNED_IMAGE_DIR = "lib/wic/canned-wks" # relative to scripts
 SCRIPTS_CANNED_IMAGE_DIR = "scripts/" + CANNED_IMAGE_DIR
+WIC_DIR = "wic"
 
 def build_canned_image_list(path):
     layers_path = misc.get_bitbake_var("BBLAYERS")
@@ -59,8 +60,10 @@ def build_canned_image_list(path):
 
     if layers_path is not None:
         for layer_path in layers_path.split():
-            cpath = os.path.join(layer_path, SCRIPTS_CANNED_IMAGE_DIR)
-            canned_wks_layer_dirs.append(cpath)
+            for wks_path in (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)
Signature · 1 line
2.1.4
#3 lore raw

Re: [PATCH v2] wic: look for wks files in <layer>/wic

Quoted 7 lines · Ed Bartosh

Currently wic looks for wks files in
<layer dir>/scripts/lib/wic/canned-wks/ directories. This path is too nested and doesn't look consistent with the naming scheme of layer directories.

Added <layer>/wic directory to the list of paths
to look for wks files.

Does it also affect documentation ?

Quoted 39 lines
---
 scripts/lib/wic/engine.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/lib/wic/engine.py +5 -3
index 5b10463..2adef2f 100644
@@ -52,6 +52,7 @@ def verify_build_env():
 
 CANNED_IMAGE_DIR = "lib/wic/canned-wks" # relative to scripts
 SCRIPTS_CANNED_IMAGE_DIR = "scripts/" + CANNED_IMAGE_DIR
+WIC_DIR = "wic"
 
 def build_canned_image_list(path):
     layers_path = misc.get_bitbake_var("BBLAYERS")
@@ -59,8 +60,10 @@ def build_canned_image_list(path):
 
     if layers_path is not None:
         for layer_path in layers_path.split():
-            cpath = os.path.join(layer_path, SCRIPTS_CANNED_IMAGE_DIR)
-            canned_wks_layer_dirs.append(cpath)
+            for wks_path in (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)
--

2.1.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

author
#4 lore raw

Re: [PATCH v2] wic: look for wks files in <layer>/wic

Quoted 11 lines · Khem Raj
Quoted 7 lines · Ed Bartosh

Currently wic looks for wks files in
<layer dir>/scripts/lib/wic/canned-wks/ directories. This path is too nested and doesn't look consistent with the naming scheme of layer directories.

Added <layer>/wic directory to the list of paths
to look for wks files.

Does it also affect documentation ?

Yes, in a way. There is only indirect mentioning of scripts/lib/wic/canned-wks/ in the documentation. I'm going to add new path there or even directly mention both paths in dev manual.

Quoted 39 lines
Quoted 39 lines
---
 scripts/lib/wic/engine.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/lib/wic/engine.py +5 -3
index 5b10463..2adef2f 100644
@@ -52,6 +52,7 @@ def verify_build_env():
 
 CANNED_IMAGE_DIR = "lib/wic/canned-wks" # relative to scripts
 SCRIPTS_CANNED_IMAGE_DIR = "scripts/" + CANNED_IMAGE_DIR
+WIC_DIR = "wic"
 
 def build_canned_image_list(path):
     layers_path = misc.get_bitbake_var("BBLAYERS")
@@ -59,8 +60,10 @@ def build_canned_image_list(path):
 
     if layers_path is not None:
         for layer_path in layers_path.split():
-            cpath = os.path.join(layer_path, SCRIPTS_CANNED_IMAGE_DIR)
-            canned_wks_layer_dirs.append(cpath)
+            for wks_path in (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)
--

2.1.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 3 lines
--
Regards,
Ed