devtool: fix running from a different directory

Fixes the following error when running devtool from a directory other
than the build directory (or the SDK base path when using within the
extensible SDK):

  The BBPATH variable is not set and bitbake did not find a
  conf/bblayers.conf file in the expected location.
  Maybe you accidentally invoked bitbake from the wrong directory?

(From OE-Core rev: 1687ec04bfee327fe24fdfecb67db689835769f2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2015-09-08 11:39:15 +01:00 committed by Richard Purdie
parent 7b1f670ca3
commit 69b7a613fc
1 changed files with 3 additions and 0 deletions

View File

@ -221,6 +221,9 @@ def main():
if not config.read():
return -1
# We need to be in this directory or we won't be able to initialise tinfoil
os.chdir(basepath)
bitbake_subdir = config.get('General', 'bitbake_subdir', '')
if bitbake_subdir:
# Normally set for use within the SDK