diff options
Diffstat (limited to 'scripts/lib/devtool/__init__.py')
| -rw-r--r-- | scripts/lib/devtool/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index f815ef27fa..7b1ab1110d 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py | |||
| @@ -96,9 +96,12 @@ def exec_fakeroot(d, cmd, **kwargs): | |||
| 96 | newenv[splitval[0]] = splitval[1] | 96 | newenv[splitval[0]] = splitval[1] |
| 97 | return subprocess.call("%s %s" % (fakerootcmd, cmd), env=newenv, **kwargs) | 97 | return subprocess.call("%s %s" % (fakerootcmd, cmd), env=newenv, **kwargs) |
| 98 | 98 | ||
| 99 | def setup_tinfoil(config_only=False): | 99 | def setup_tinfoil(config_only=False, basepath=None): |
| 100 | """Initialize tinfoil api from bitbake""" | 100 | """Initialize tinfoil api from bitbake""" |
| 101 | import scriptpath | 101 | import scriptpath |
| 102 | orig_cwd = os.path.abspath(os.curdir) | ||
| 103 | if basepath: | ||
| 104 | os.chdir(basepath) | ||
| 102 | bitbakepath = scriptpath.add_bitbake_lib_path() | 105 | bitbakepath = scriptpath.add_bitbake_lib_path() |
| 103 | if not bitbakepath: | 106 | if not bitbakepath: |
| 104 | logger.error("Unable to find bitbake by searching parent directory of this script or PATH") | 107 | logger.error("Unable to find bitbake by searching parent directory of this script or PATH") |
| @@ -108,6 +111,7 @@ def setup_tinfoil(config_only=False): | |||
| 108 | tinfoil = bb.tinfoil.Tinfoil() | 111 | tinfoil = bb.tinfoil.Tinfoil() |
| 109 | tinfoil.prepare(config_only) | 112 | tinfoil.prepare(config_only) |
| 110 | tinfoil.logger.setLevel(logger.getEffectiveLevel()) | 113 | tinfoil.logger.setLevel(logger.getEffectiveLevel()) |
| 114 | os.chdir(orig_cwd) | ||
| 111 | return tinfoil | 115 | return tinfoil |
| 112 | 116 | ||
| 113 | def get_recipe_file(cooker, pn): | 117 | def get_recipe_file(cooker, pn): |
