summaryrefslogtreecommitdiffstats
path: root/scripts/wic
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/wic')
-rwxr-xr-xscripts/wic12
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)
import scriptpath
scriptpath.add_oe_lib_path()
+# Check whether wic is running within eSDK environment
+sdkroot = scripts_path
+if os.environ.get('SDKTARGETSYSROOT'):
+ while sdkroot != '' and sdkroot != os.sep:
+ if os.path.exists(os.path.join(sdkroot, '.devtoolbase')):
+ # .devtoolbase only exists within eSDK
+ # If found, initialize bitbake path for eSDK environment and append to PATH
+ sdkroot = os.path.join(os.path.dirname(scripts_path), 'bitbake', 'bin')
+ os.environ['PATH'] += ":" + sdkroot
+ break
+ sdkroot = os.path.dirname(sdkroot)
+
bitbake_exe = spawn.find_executable('bitbake')
if bitbake_exe:
bitbake_path = scriptpath.add_bitbake_lib_path()