diff options
author | Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> | 2018-01-11 22:55:20 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-13 10:15:20 +0000 |
commit | 7006ff99b0c28bde7ae056d54feac9bb649cfd46 (patch) | |
tree | 633c33e8d67ee500ae082f09062bbf6a5b6e70fc | |
parent | be5616a27c77d390132f38b1b27af99769aa1155 (diff) | |
download | poky-7006ff99b0c28bde7ae056d54feac9bb649cfd46.tar.gz |
scripts/wic: append bitbake executable file path in eSDK environment
wic needs a set of tools to be available from sysroots.
wic will find bitbake executable within the environment,
and wic was unable to locate bitbake executable within eSDK
because it wasn't setup with the OE build environment script.
Hence, we need to add bitbake file path into the environment
PATH for wic to be able to discover it and import bb modules.
(From OE-Core rev: 89df0d31c9dd22ceba4c95a2a56ca78e58d871a8)
Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | scripts/wic | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/wic b/scripts/wic index 0d98875715..293a216d71 100755 --- a/scripts/wic +++ b/scripts/wic | |||
@@ -46,6 +46,18 @@ sys.path.insert(0, lib_path) | |||
46 | import scriptpath | 46 | import scriptpath |
47 | scriptpath.add_oe_lib_path() | 47 | scriptpath.add_oe_lib_path() |
48 | 48 | ||
49 | # Check whether wic is running within eSDK environment | ||
50 | sdkroot = scripts_path | ||
51 | if os.environ.get('SDKTARGETSYSROOT'): | ||
52 | while sdkroot != '' and sdkroot != os.sep: | ||
53 | if os.path.exists(os.path.join(sdkroot, '.devtoolbase')): | ||
54 | # .devtoolbase only exists within eSDK | ||
55 | # If found, initialize bitbake path for eSDK environment and append to PATH | ||
56 | sdkroot = os.path.join(os.path.dirname(scripts_path), 'bitbake', 'bin') | ||
57 | os.environ['PATH'] += ":" + sdkroot | ||
58 | break | ||
59 | sdkroot = os.path.dirname(sdkroot) | ||
60 | |||
49 | bitbake_exe = spawn.find_executable('bitbake') | 61 | bitbake_exe = spawn.find_executable('bitbake') |
50 | if bitbake_exe: | 62 | if bitbake_exe: |
51 | bitbake_path = scriptpath.add_bitbake_lib_path() | 63 | bitbake_path = scriptpath.add_bitbake_lib_path() |