summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-04-12 23:40:57 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-12 23:55:54 +0100
commitd42c02caaa4d6fb47681aa7ffe8b27fa38141e6a (patch)
treeb54e33a707143840ec41a7f792d64d870893703d
parent2e7a155774952705d21109720985f6833fba2669 (diff)
downloadopenembedded-core-contrib-d42c02caaa4d6fb47681aa7ffe8b27fa38141e6a.tar.gz
openembedded-core-contrib-d42c02caaa4d6fb47681aa7ffe8b27fa38141e6a.tar.bz2
openembedded-core-contrib-d42c02caaa4d6fb47681aa7ffe8b27fa38141e6a.zip
runqemu: get qemu from qemu-helper-native sysroot
If rm_work is enabled image native sysroot can be removed. This makes runqemu to fail trying to find qemu binary. Used native sysroot of qemu-helper-native to find system qemu binary. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/runqemu13
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 5b5d56b9ef..a8bb9ebbda 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1056,7 +1056,18 @@ class BaseConfig(object):
if not qemu_system:
raise Exception("Failed to boot, QB_SYSTEM_NAME is NULL!")
- qemu_bin = '%s/%s' % (self.get('STAGING_BINDIR_NATIVE'), qemu_system)
+ cmd = 'bitbake qemu-helper-native -e'
+ logger.info('Running %s...' % cmd)
+ out = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
+ out = out.stdout.read().decode('utf-8')
+
+ match = re.search('^STAGING_BINDIR_NATIVE="(.*)"', out, re.M)
+ if match:
+ bindir_native = match.group(1)
+ else:
+ raise Exception("Can't find STAGING_BINDIR_NATIVE in '%s' output" % cmd)
+
+ qemu_bin = '%s/%s' % (bindir_native, qemu_system)
# It is possible to have qemu-native in ASSUME_PROVIDED, and it won't
# find QEMU in sysroot, it needs to use host's qemu.