summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorZhai Edwin <edwin.zhai@intel.com>2011-05-06 15:20:55 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-05-10 09:55:02 +0100
commite2f1638d9f1447064e56dcee84ad8f241ca2efa7 (patch)
treebb1721efce6ede07e82a4b7d96ca4d8e64233f97 /scripts
parentcd4a94d124945134cdaefb59e80cab8dcd44f4df (diff)
downloadpoky-e2f1638d9f1447064e56dcee84ad8f241ca2efa7.tar.gz
qemu-script: Fix qemu seg fault if install Nvidia proprietary driver.
This fix works on Ubuntu, and other distro can add its own path of Mesa's libGL (From OE-Core rev: a0a563d0d0febacef3f9080db24fa968e8c5f08b) Signed-off-by: Zhai Edwin <edwin.zhai@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu-internal13
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index 9a786e4290..ffac05e8e5 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -448,20 +448,29 @@ else
448fi 448fi
449 449
450# qemu got segfault if linked with nVidia's libgl 450# qemu got segfault if linked with nVidia's libgl
451GL_LD_PRELOAD=$LD_PRELOAD
452
451if ldd $QEMUBIN | grep -i nvidia &> /dev/null 453if ldd $QEMUBIN | grep -i nvidia &> /dev/null
452then 454then
453cat << EOM 455cat << EOM
454WARNING: nVidia proprietary OpenGL libraries detected. 456WARNING: nVidia proprietary OpenGL libraries detected.
455nVidia's OpenGL libraries are known to have compatibility issues with qemu, 457nVidia's OpenGL libraries are known to have compatibility issues with qemu,
456resulting in a segfault. Please uninstall these drivers or ensure the mesa libGL 458resulting in a segfault. Please uninstall these drivers or ensure the mesa libGL
457libraries precede nvidia's via LD_PRELOAD. 459libraries precede nvidia's via LD_PRELOAD(Already do it on Ubuntu).
458EOM 460EOM
461
462# Automatically use Ubuntu system's mesa libGL, other distro can add its own path
463 if grep -i ubuntu /etc/lsb-release &> /dev/null
464 then
465 echo "Skip nVidia's libGL on Ubuntu!"
466 GL_LD_PRELOAD="/usr/lib/libGL.so $LD_PRELOAD"
467 fi
459fi 468fi
460 469
461echo "Running $QEMU..." 470echo "Running $QEMU..."
462# -no-reboot is a mandatory option - see bug #100 471# -no-reboot is a mandatory option - see bug #100
463echo $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append '"'$KERNCMDLINE $SCRIPT_KERNEL_OPT'"' 472echo $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append '"'$KERNCMDLINE $SCRIPT_KERNEL_OPT'"'
464$QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT" 473LD_PRELOAD="$GL_LD_PRELOAD" $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT"
465 474
466 475
467cleanup 476cleanup