summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/runqemu28
1 files changed, 22 insertions, 6 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 2830c15d52..e8d14f5142 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -567,12 +567,28 @@ class BaseConfig(object):
567 if not havenative: 567 if not havenative:
568 if not self.bitbake_e: 568 if not self.bitbake_e:
569 self.load_bitbake_env() 569 self.load_bitbake_env()
570 native_vars = ['STAGING_DIR_NATIVE', 'STAGING_BINDIR_NATIVE'] 570
571 for nv in native_vars: 571 if self.bitbake_e:
572 s = re.search('^%s="(.*)"' % nv, self.bitbake_e, re.M) 572 native_vars = ['STAGING_DIR_NATIVE', 'STAGING_BINDIR_NATIVE']
573 if s and s.group(1) != self.get(nv): 573 for nv in native_vars:
574 logger.info('Overriding conf file setting of %s to %s from Bitbake environment' % (nv, s.group(1))) 574 s = re.search('^%s="(.*)"' % nv, self.bitbake_e, re.M)
575 self.set(nv, s.group(1)) 575 if s and s.group(1) != self.get(nv):
576 logger.info('Overriding conf file setting of %s to %s from Bitbake environment' % (nv, s.group(1)))
577 self.set(nv, s.group(1))
578 else:
579 # when we're invoked from a running bitbake instance we won't
580 # be able to call `bitbake -e` but should have OE_TMPDIR set in
581 # the environment and can guess paths based on it
582 tmpdir = os.environ.get('OE_TMPDIR', None)
583 if tmpdir:
584 logger.info('Setting STAGING_DIR_NATIVE and STAGING_BINDIR_NATIVE relative to OE_TMPDIR (%s)' % tmpdir)
585 hostos, _, _, _, machine = os.uname()
586 buildsys = '%s-%s' % (machine, hostos.lower())
587 staging_dir_native = '%s/sysroots/%s' % (tmpdir, buildsys)
588 self.set('STAGING_DIR_NATIVE', staging_dir_native)
589 # we have to assume that STAGING_BINDIR_NATIVE is at usr/bin
590 staging_bindir_native = '%s/usr/bin' % staging_dir_native
591 self.set('STAGING_BINDIR_NATIVE', staging_bindir_native)
576 592
577 def print_config(self): 593 def print_config(self):
578 logger.info('Continuing with the following parameters:\n') 594 logger.info('Continuing with the following parameters:\n')