diff options
author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2016-11-22 11:31:53 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-16 10:23:23 +0000 |
commit | 3f6e6f4e69f644bd466774607f43b8f306376b42 (patch) | |
tree | d799a9f506458acb81c3b586be8db785aecbc109 | |
parent | 2f0eb8e1b67b2f9fa7d07060a28f25ae5cad02e2 (diff) | |
download | poky-3f6e6f4e69f644bd466774607f43b8f306376b42.tar.gz |
scripts/runqemu: Allow to use qemu from host.
This will add support to use qemu from the running host,
with this is possible to put qemu-native in ASSUME_PROVIDED
variable.
By default it will try to get qemu from the build sysroot,
and only if it fails will try to use the host's qemu.
(From OE-Core rev: fe7fd2cd3a9c4fb5b31bd3cab81c96a3b81cb540)
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | scripts/runqemu | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index af254234df..0a9cb946bf 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -906,6 +906,21 @@ class BaseConfig(object): | |||
906 | raise Exception("Failed to boot, QB_SYSTEM_NAME is NULL!") | 906 | raise Exception("Failed to boot, QB_SYSTEM_NAME is NULL!") |
907 | 907 | ||
908 | qemu_bin = '%s/%s' % (self.get('STAGING_BINDIR_NATIVE'), qemu_system) | 908 | qemu_bin = '%s/%s' % (self.get('STAGING_BINDIR_NATIVE'), qemu_system) |
909 | |||
910 | # It is possible to have qemu-native in ASSUME_PROVIDED, and it won't | ||
911 | # find QEMU in sysroot, it needs to use host's qemu. | ||
912 | if not os.path.exists(qemu_bin): | ||
913 | logger.info("QEMU binary not found in %s, trying host's QEMU" % qemu_bin) | ||
914 | for path in (os.environ['PATH'] or '').split(':'): | ||
915 | qemu_bin_tmp = os.path.join(path, qemu_system) | ||
916 | logger.info("Trying: %s" % qemu_bin_tmp) | ||
917 | if os.path.exists(qemu_bin_tmp): | ||
918 | qemu_bin = qemu_bin_tmp | ||
919 | if not os.path.isabs(qemu_bin): | ||
920 | qemu_bin = os.path.abspath(qemu_bin) | ||
921 | logger.info("Using host's QEMU: %s" % qemu_bin) | ||
922 | break | ||
923 | |||
909 | if not os.access(qemu_bin, os.X_OK): | 924 | if not os.access(qemu_bin, os.X_OK): |
910 | raise OEPathError("No QEMU binary '%s' could be found" % qemu_bin) | 925 | raise OEPathError("No QEMU binary '%s' could be found" % qemu_bin) |
911 | 926 | ||