diff options
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-x | scripts/runqemu | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 23bd440cc4..1a378925ce 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -450,30 +450,16 @@ class BaseConfig(object): | |||
450 | self.set("MACHINE", arg) | 450 | self.set("MACHINE", arg) |
451 | 451 | ||
452 | def set_dri_path(self): | 452 | def set_dri_path(self): |
453 | # As runqemu can be run within bitbake (when using testimage, for example), | 453 | drivers_path = os.path.join(self.bindir_native, '../lib/dri') |
454 | # we need to ensure that we run host pkg-config, and that it does not | 454 | if not os.path.exists(drivers_path) or not os.listdir(drivers_path): |
455 | # get mis-directed to native build paths set by bitbake. | 455 | raise RunQemuError(""" |
456 | env = os.environ.copy() | 456 | qemu has been built without opengl support and accelerated graphics support is not available. |
457 | try: | 457 | To enable it, add: |
458 | del env['PKG_CONFIG_PATH'] | 458 | DISTRO_FEATURES_NATIVE:append = " opengl" |
459 | del env['PKG_CONFIG_DIR'] | 459 | DISTRO_FEATURES_NATIVESDK:append = " opengl" |
460 | del env['PKG_CONFIG_LIBDIR'] | 460 | to your build configuration. |
461 | del env['PKG_CONFIG_SYSROOT_DIR'] | 461 | """) |
462 | except KeyError: | 462 | self.qemu_environ['LIBGL_DRIVERS_PATH'] = drivers_path |
463 | pass | ||
464 | try: | ||
465 | dripath = subprocess.check_output("PATH=/bin:/usr/bin:$PATH pkg-config --variable=dridriverdir dri", shell=True, env=env) | ||
466 | except subprocess.CalledProcessError as e: | ||
467 | raise RunQemuError("Could not determine the path to dri drivers on the host via pkg-config.\nPlease install Mesa development files (particularly, dri.pc) on the host machine.") | ||
468 | self.qemu_environ['LIBGL_DRIVERS_PATH'] = dripath.decode('utf-8').strip() | ||
469 | |||
470 | # This preloads uninative libc pieces and therefore ensures that RPATH/RUNPATH | ||
471 | # in host mesa drivers doesn't trick uninative into loading host libc. | ||
472 | preload_items = ['libdl.so.2', 'librt.so.1', 'libpthread.so.0'] | ||
473 | uninative_path = os.path.dirname(self.get("UNINATIVE_LOADER")) | ||
474 | if os.path.exists(uninative_path): | ||
475 | preload_paths = [os.path.join(uninative_path, i) for i in preload_items] | ||
476 | self.qemu_environ['LD_PRELOAD'] = " ".join(preload_paths) | ||
477 | 463 | ||
478 | def check_args(self): | 464 | def check_args(self): |
479 | for debug in ("-d", "--debug"): | 465 | for debug in ("-d", "--debug"): |