diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 2adf4d297d..f163d3a2a3 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1827,7 +1827,7 @@ class CookerCollectFiles(object):
             for ignored in ('SCCS', 'CVS', '.svn'):
                 if ignored in dirs:
                     dirs.remove(ignored)
-            found += [os.path.join(dir, f) for f in files if (f.endswith(['.bb', '.bbappend']))]
+            found += [os.path.join(dir, f) for f in files if (f.endswith(('.bb', '.bbappend')))]
 
         return found
 
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index ec3741cc1d..fd1e0cf06f 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -18,6 +18,7 @@ from functools import wraps
 import bb
 from bb import data
 import bb.parse
+from bblayers.action import ActionPlugin
 
 logger      = logging.getLogger("BitBake")
 parselog    = logging.getLogger("BitBake.Parsing")
@@ -377,7 +378,11 @@ class CookerDataBuilder(object):
                     layer = layer.rstrip('/')
                 data.setVar('LAYERDIR', layer)
                 data.setVar('LAYERDIR_RE', re.escape(layer))
-                data = parse_config_file(os.path.join(layer, "conf", "layer.conf"), data)
+                layer_conf = os.path.join(layer, "conf", "layer.conf")
+                res, msg = ActionPlugin.do_check_layer(layer_conf)
+                if not res:
+                    bb.fatal(msg)
+                data = parse_config_file(layer_conf, data)
                 data.expandVarref('LAYERDIR')
                 data.expandVarref('LAYERDIR_RE')
 
diff --git a/bitbake/lib/bblayers/action.py b/bitbake/lib/bblayers/action.py
index 454c251410..5a2fcf7f8f 100644
--- a/bitbake/lib/bblayers/action.py
+++ b/bitbake/lib/bblayers/action.py
@@ -23,6 +23,27 @@ def plugin_init(plugins):
 
 
 class ActionPlugin(LayerPlugin):
+
+    def do_check_layer(path):
+        """
+        make sure that BBFILE_COLLECTIONS and BBPATH are found in layer.conf
+        they should exist in non-commented lines
+        """
+        def _is_found(var, line):
+                return var in line and not line.startswith('#')
+
+        with open(path) as layer_conf_fd:
+            lines = layer_conf_fd.readlines()
+            find_result = {}
+            for to_find in ['BBFILE_COLLECTIONS', 'BBPATH']:
+                for line in lines:
+                    find_result[to_find] = True if _is_found(to_find, line) else False
+                    if find_result[to_find]:
+                        break
+                if not find_result[to_find]:
+                    return False, "Specified layer configuration %s doesn't contain %s\n" % (path, to_find)
+        return True, ""
+
     def do_add_layer(self, args):
         """Add one or more layers to bblayers.conf."""
         layerdirs = [os.path.abspath(ldir) for ldir in args.layerdir]
@@ -37,6 +58,11 @@ class ActionPlugin(LayerPlugin):
                 sys.stderr.write("Specified layer directory %s doesn't contain a conf/layer.conf file\n" % layerdir)
                 return 1
 
+            res, msg = ActionPlugin.do_check_layer(layer_conf)
+            if not res:
+                sys.stderr.write(msg)
+                return 1
+
         bblayers_conf = os.path.join('conf', 'bblayers.conf')
         if not os.path.exists(bblayers_conf):
             sys.stderr.write("Unable to find bblayers.conf\n")
