diff options
Diffstat (limited to 'scripts/yocto-check-layer')
-rwxr-xr-x | scripts/yocto-check-layer | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/scripts/yocto-check-layer b/scripts/yocto-check-layer index 2445ad5e43..67cc71950f 100755 --- a/scripts/yocto-check-layer +++ b/scripts/yocto-check-layer | |||
@@ -24,7 +24,7 @@ import scriptpath | |||
24 | scriptpath.add_oe_lib_path() | 24 | scriptpath.add_oe_lib_path() |
25 | scriptpath.add_bitbake_lib_path() | 25 | scriptpath.add_bitbake_lib_path() |
26 | 26 | ||
27 | from checklayer import LayerType, detect_layers, add_layers, add_layer_dependencies, get_layer_dependencies, get_signatures, check_bblayers | 27 | from checklayer import LayerType, detect_layers, add_layers, add_layer_dependencies, get_layer_dependencies, get_signatures, check_bblayers, sanity_check_layers |
28 | from oeqa.utils.commands import get_bb_vars | 28 | from oeqa.utils.commands import get_bb_vars |
29 | 29 | ||
30 | PROGNAME = 'yocto-check-layer' | 30 | PROGNAME = 'yocto-check-layer' |
@@ -41,6 +41,12 @@ def test_layer(td, layer, test_software_layer_signatures): | |||
41 | tc.loadTests(CASES_PATHS) | 41 | tc.loadTests(CASES_PATHS) |
42 | return tc.runTests() | 42 | return tc.runTests() |
43 | 43 | ||
44 | def dump_layer_debug(layer): | ||
45 | logger.debug("Found layer %s (%s)" % (layer["name"], layer["path"])) | ||
46 | collections = layer.get("collections", {}) | ||
47 | if collections: | ||
48 | logger.debug("%s collections: %s" % (layer["name"], ", ".join(collections))) | ||
49 | |||
44 | def main(): | 50 | def main(): |
45 | parser = argparse.ArgumentParser( | 51 | parser = argparse.ArgumentParser( |
46 | description="Yocto Project layer checking tool", | 52 | description="Yocto Project layer checking tool", |
@@ -106,6 +112,17 @@ def main(): | |||
106 | else: | 112 | else: |
107 | dep_layers = layers | 113 | dep_layers = layers |
108 | 114 | ||
115 | logger.debug("Found additional layers:") | ||
116 | for l in additional_layers: | ||
117 | dump_layer_debug(l) | ||
118 | logger.debug("Found dependency layers:") | ||
119 | for l in dep_layers: | ||
120 | dump_layer_debug(l) | ||
121 | |||
122 | if not sanity_check_layers(additional_layers + dep_layers, logger): | ||
123 | logger.error("Failed layer validation") | ||
124 | return 1 | ||
125 | |||
109 | logger.info("Detected layers:") | 126 | logger.info("Detected layers:") |
110 | for layer in layers: | 127 | for layer in layers: |
111 | if layer['type'] == LayerType.ERROR_BSP_DISTRO: | 128 | if layer['type'] == LayerType.ERROR_BSP_DISTRO: |
@@ -151,14 +168,13 @@ def main(): | |||
151 | 168 | ||
152 | layers_tested = 0 | 169 | layers_tested = 0 |
153 | for layer in layers: | 170 | for layer in layers: |
154 | if layer['type'] == LayerType.ERROR_NO_LAYER_CONF or \ | 171 | if layer['type'] in (LayerType.ERROR_NO_LAYER_CONF, LayerType.ERROR_BSP_DISTRO): |
155 | layer['type'] == LayerType.ERROR_BSP_DISTRO: | ||
156 | continue | 172 | continue |
157 | 173 | ||
158 | # Reset to a clean backup copy for each run | 174 | # Reset to a clean backup copy for each run |
159 | shutil.copyfile(bblayersconf + '.backup', bblayersconf) | 175 | shutil.copyfile(bblayersconf + '.backup', bblayersconf) |
160 | 176 | ||
161 | if check_bblayers(bblayersconf, layer['path'], logger): | 177 | if layer['type'] not in (LayerType.CORE, ) and check_bblayers(bblayersconf, layer['path'], logger): |
162 | logger.info("%s already in %s. To capture initial signatures, layer under test should not present " | 178 | logger.info("%s already in %s. To capture initial signatures, layer under test should not present " |
163 | "in BBLAYERS. Please remove %s from BBLAYERS." % (layer['name'], bblayersconf, layer['name'])) | 179 | "in BBLAYERS. Please remove %s from BBLAYERS." % (layer['name'], bblayersconf, layer['name'])) |
164 | results[layer['name']] = None | 180 | results[layer['name']] = None |