Skip to contentSkip to conversation

wic: Set default set of bitbake variables

PATCH New Ed Bartosh 1 participant 1 message Jul 10, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Ed Bartosh

author
#1 lore raw

PATCH 1/1 wic: Set default set of bitbake variables

Set default set of bitbake variables to the set of variables for the first parsed image.

This allows wic to find proper bitbake varibale values if it's called with '-e <image>' even without specifying image in the call of get_bitbake_var.

---
 scripts/lib/wic/utils/oe/misc.py | 5 +++++
 1 file changed, 5 insertions(+)
scripts/lib/wic/utils/oe/misc.py +5 -0
index 2f9f515..4978745 100644
@@ -146,6 +146,11 @@ def get_bitbake_var(var, image=None):
             if key.replace('_', '').isalnum():
                 _BITBAKE_VARS[image][key] = val.strip('"')
 
+        # Make first image a default set of variables
+        images = [key for key in _BITBAKE_VARS if key]
+        if len(images) == 1:
+            _BITBAKE_VARS[None] = _BITBAKE_VARS[image]
+
     return _BITBAKE_VARS[image].get(var)
 
 def parse_sourceparams(sourceparams):
Signature · 1 line
2.1.4