]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
runqemu: don't try and invoke bitbake when running in a toolchain env
authorJoshua Lock <joshua.g.lock@intel.com>
Wed, 21 Sep 2016 19:35:38 +0000 (20:35 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 21 Sep 2016 20:59:14 +0000 (21:59 +0100)
If a MACHINE value is passed we can't validate it by running bitbake
as the toolchain environment doesn't include the build system, we
must assume that the passed value for MACHINE is correct.

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/runqemu

index 591746f65705140959c265146b1dbc93da275a67..e8360c2af1ca9317651f7e07e4fa2693eb2331b9 100755 (executable)
@@ -306,11 +306,16 @@ class BaseConfig(object):
         # FIXME: testimage.bbclass exports these two variables into env,
         # are there other scenarios in which we need to support being
         # invoked by bitbake?
-        deploy = os.environ.get('DEPLOY_DIR_IMAGE', None)
-        bbchild = deploy and os.environ.get('OE_TMPDIR', None)
+        deploy = os.environ.get('DEPLOY_DIR_IMAGE')
+        bbchild = deploy and os.environ.get('OE_TMPDIR')
         if bbchild:
             self.set_machine_deploy_dir(arg, deploy)
             return
+        # also check whether we're running under a sourced toolchain
+        # environment file
+        if os.environ.get('OECORE_NATIVE_SYSROOT'):
+            self.set("MACHINE", arg)
+            return
 
         cmd = 'MACHINE=%s bitbake -e' % arg
         logger.info('Running %s...' % cmd)