From 3943a27225a79ad5f038a484377dd51ad4ffa249 Mon Sep 17 00:00:00 2001 From: Joshua Lock Date: Wed, 21 Sep 2016 14:46:46 +0100 Subject: [PATCH] runqemu: don't try and invoke bitbake when running in a toolchain env 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 --- scripts/runqemu | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/runqemu b/scripts/runqemu index 591746f6570..e8360c2af1c 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -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) -- 2.47.2