summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-xscripts/runqemu40
1 files changed, 7 insertions, 33 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index c28980e616..2be7a0f286 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1007,34 +1007,12 @@ to your build configuration.
1007 if not self.bitbake_e: 1007 if not self.bitbake_e:
1008 self.load_bitbake_env() 1008 self.load_bitbake_env()
1009 1009
1010 if self.bitbake_e: 1010 native_vars = ['STAGING_DIR_NATIVE']
1011 native_vars = ['STAGING_DIR_NATIVE'] 1011 for nv in native_vars:
1012 for nv in native_vars: 1012 s = re.search('^%s="(.*)"' % nv, self.bitbake_e, re.M)
1013 s = re.search('^%s="(.*)"' % nv, self.bitbake_e, re.M) 1013 if s and s.group(1) != self.get(nv):
1014 if s and s.group(1) != self.get(nv): 1014 logger.info('Overriding conf file setting of %s to %s from Bitbake environment' % (nv, s.group(1)))
1015 logger.info('Overriding conf file setting of %s to %s from Bitbake environment' % (nv, s.group(1))) 1015 self.set(nv, s.group(1))
1016 self.set(nv, s.group(1))
1017 else:
1018 # when we're invoked from a running bitbake instance we won't
1019 # be able to call `bitbake -e`, then try:
1020 # - get OE_TMPDIR from environment and guess paths based on it
1021 # - get OECORE_NATIVE_SYSROOT from environment (for sdk)
1022 tmpdir = self.get('OE_TMPDIR')
1023 oecore_native_sysroot = self.get('OECORE_NATIVE_SYSROOT')
1024 if tmpdir:
1025 logger.info('Setting STAGING_DIR_NATIVE and STAGING_BINDIR_NATIVE relative to OE_TMPDIR (%s)' % tmpdir)
1026 hostos, _, _, _, machine = os.uname()
1027 buildsys = '%s-%s' % (machine, hostos.lower())
1028 staging_dir_native = '%s/sysroots/%s' % (tmpdir, buildsys)
1029 self.set('STAGING_DIR_NATIVE', staging_dir_native)
1030 elif oecore_native_sysroot:
1031 logger.info('Setting STAGING_DIR_NATIVE to OECORE_NATIVE_SYSROOT (%s)' % oecore_native_sysroot)
1032 self.set('STAGING_DIR_NATIVE', oecore_native_sysroot)
1033 if self.get('STAGING_DIR_NATIVE'):
1034 # we have to assume that STAGING_BINDIR_NATIVE is at usr/bin
1035 staging_bindir_native = '%s/usr/bin' % self.get('STAGING_DIR_NATIVE')
1036 logger.info('Setting STAGING_BINDIR_NATIVE to %s' % staging_bindir_native)
1037 self.set('STAGING_BINDIR_NATIVE', '%s/usr/bin' % self.get('STAGING_DIR_NATIVE'))
1038 1016
1039 def print_config(self): 1017 def print_config(self):
1040 logoutput = ['Continuing with the following parameters:'] 1018 logoutput = ['Continuing with the following parameters:']
@@ -1745,11 +1723,7 @@ to your build configuration.
1745 cmd = 'MACHINE=%s bitbake -e %s %s' % (mach, multiconfig, target) 1723 cmd = 'MACHINE=%s bitbake -e %s %s' % (mach, multiconfig, target)
1746 else: 1724 else:
1747 cmd = 'bitbake -e %s %s' % (multiconfig, target) 1725 cmd = 'bitbake -e %s %s' % (multiconfig, target)
1748 try: 1726 return subprocess.check_output(cmd, shell=True).decode('utf-8')
1749 return subprocess.check_output(cmd, shell=True).decode('utf-8')
1750 except subprocess.CalledProcessError as err:
1751 logger.warning("Couldn't run '%s' to gather environment information, giving up with 'bitbake -e':\n%s" % (cmd, err.output.decode('utf-8')))
1752 return ''
1753 1727
1754 1728
1755 def load_bitbake_env(self, mach=None, target=None): 1729 def load_bitbake_env(self, mach=None, target=None):