diff options
authorRichard Purdie <>2013-08-29 13:26:53 (GMT)
committerRichard Purdie <>2013-08-30 16:42:39 (GMT)
commitc7a389729a5453bf090f05946bfa64413a5e04ed (patch)
parent156baf84e72158193d596158b53c4c5a42860bc9 (diff)
bitbake: cookerdata: Set TOPDIR when using bblayers.conf
By definition, bblayers.conf is at the top of the build tree. We'd like to support running bitbake anywhere within that build tree but TOPDIR gets set to wherever cwd is. Change the code to reset TOPDIR to the top of the build directory. This shouldn't break anything but does make the system more usable. (Bitbake rev: b266db27de0bba19a418e4d42e870649136b116b) Signed-off-by: Richard Purdie <>
1 files changed, 3 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ b/bitbake/lib/bb/
index a0379cf..8a0bc22 100644
--- a/bitbake/lib/bb/
+++ b/bitbake/lib/bb/
@@ -239,6 +239,9 @@ class CookerDataBuilder(object):
239 layerconf = self._findLayerConf() 239 layerconf = self._findLayerConf()
240 if layerconf: 240 if layerconf:
241 parselog.debug(2, "Found bblayers.conf (%s)", layerconf) 241 parselog.debug(2, "Found bblayers.conf (%s)", layerconf)
242 # By definition bblayers.conf is in conf/ of TOPDIR.
243 # We may have been called with cwd somewhere else so reset TOPDIR
244 data.setVar("TOPDIR", os.path.dirname(os.path.dirname(layerconf)))
242 data = parse_config_file(layerconf, data) 245 data = parse_config_file(layerconf, data)
243 246
244 layers = (data.getVar('BBLAYERS', True) or "").split() 247 layers = (data.getVar('BBLAYERS', True) or "").split()