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