summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
46import scriptpath 46import scriptpath
47scriptpath.add_oe_lib_path() 47scriptpath.add_oe_lib_path()
48 48
49# Check whether wic is running within eSDK environment
50sdkroot = scripts_path
51if 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
49bitbake_exe = spawn.find_executable('bitbake') 61bitbake_exe = spawn.find_executable('bitbake')
50if bitbake_exe: 62if bitbake_exe:
51 bitbake_path = scriptpath.add_bitbake_lib_path() 63 bitbake_path = scriptpath.add_bitbake_lib_path()