diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2017-01-13 15:12:45 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-19 22:47:22 +0000 |
commit | 56a7f41711c0606cc3abd718462f9008d374a6d7 (patch) | |
tree | 2115a246e00b8e8b102f33b4e94ae9e0d2ee0295 /meta | |
parent | c74af56d4b8555a4430de1be21581a93d0876b39 (diff) | |
download | poky-56a7f41711c0606cc3abd718462f9008d374a6d7.tar.gz |
oeqa.utils.metadata: allow storing any bitbake config variables
Make it possible to store any bitbake config variables in the metadata.
Config values will be stored under a new config element in the xml report:
<config>
<variable name="MACHINE">qemux86</variable>
</config>
The value of MACHINE is moved there instead of having a dedicated
<machine> element.
[YOCTO #10590]
(From OE-Core rev: 6e7e6e37664b0a86111272f5f6f4a4e1d0f23302)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/utils/metadata.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/meta/lib/oeqa/utils/metadata.py b/meta/lib/oeqa/utils/metadata.py index a3c1b2b46c..08d8198935 100644 --- a/meta/lib/oeqa/utils/metadata.py +++ b/meta/lib/oeqa/utils/metadata.py | |||
@@ -29,14 +29,13 @@ def metadata_from_bb(): | |||
29 | 29 | ||
30 | Data will be gathered using bitbake -e thanks to get_bb_vars. | 30 | Data will be gathered using bitbake -e thanks to get_bb_vars. |
31 | """ | 31 | """ |
32 | metadata_config_vars = ('MACHINE') | ||
32 | 33 | ||
33 | info_dict = OrderedDict() | 34 | info_dict = OrderedDict() |
34 | hostname = runCmd('hostname') | 35 | hostname = runCmd('hostname') |
35 | info_dict['hostname'] = hostname.output | 36 | info_dict['hostname'] = hostname.output |
36 | data_dict = get_bb_vars() | 37 | data_dict = get_bb_vars() |
37 | 38 | ||
38 | info_dict['machine'] = data_dict['MACHINE'] | ||
39 | |||
40 | # Distro information | 39 | # Distro information |
41 | info_dict['distro'] = {'id': data_dict['DISTRO'], | 40 | info_dict['distro'] = {'id': data_dict['DISTRO'], |
42 | 'version_id': data_dict['DISTRO_VERSION'], | 41 | 'version_id': data_dict['DISTRO_VERSION'], |
@@ -52,6 +51,10 @@ def metadata_from_bb(): | |||
52 | 51 | ||
53 | info_dict['layers'] = get_layers(data_dict['BBLAYERS']) | 52 | info_dict['layers'] = get_layers(data_dict['BBLAYERS']) |
54 | info_dict['bitbake'] = git_rev_info(os.path.dirname(bb.__file__)) | 53 | info_dict['bitbake'] = git_rev_info(os.path.dirname(bb.__file__)) |
54 | |||
55 | info_dict['config'] = OrderedDict() | ||
56 | for var in sorted(metadata_config_vars): | ||
57 | info_dict['config'][var] = data_dict[var] | ||
55 | return info_dict | 58 | return info_dict |
56 | 59 | ||
57 | def metadata_from_data_store(d): | 60 | def metadata_from_data_store(d): |
@@ -106,7 +109,10 @@ def dict_to_XML(tag, dictionary, **kwargs): | |||
106 | elif isinstance(val, MutableMapping): | 109 | elif isinstance(val, MutableMapping): |
107 | child = (dict_to_XML(key, val)) | 110 | child = (dict_to_XML(key, val)) |
108 | else: | 111 | else: |
109 | child = Element(key) | 112 | if tag == 'config': |
113 | child = Element('variable', name=key) | ||
114 | else: | ||
115 | child = Element(key) | ||
110 | child.text = str(val) | 116 | child.text = str(val) |
111 | elem.append(child) | 117 | elem.append(child) |
112 | return elem | 118 | return elem |