summaryrefslogtreecommitdiff
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:51:40 +0100
commita0a563d0d0febacef3f9080db24fa968e8c5f08b (patch)
treea102c8b740219dee7d47790673f0ffcfa65ef48b
parent3670f110aacebdde118b79d31aa15156330418c6 (diff)
downloadopenembedded-core-a0a563d0d0febacef3f9080db24fa968e8c5f08b.tar.gz
openembedded-core-a0a563d0d0febacef3f9080db24fa968e8c5f08b.tar.bz2
openembedded-core-a0a563d0d0febacef3f9080db24fa968e8c5f08b.tar.xz
openembedded-core-a0a563d0d0febacef3f9080db24fa968e8c5f08b.zip
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 Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
-rwxr-xr-xscripts/runqemu-internal13
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index 9a786e429..ffac05e8e 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -448,20 +448,29 @@ else
fi
# qemu got segfault if linked with nVidia's libgl
+GL_LD_PRELOAD=$LD_PRELOAD
+
if ldd $QEMUBIN | grep -i nvidia &> /dev/null
then
cat << EOM
WARNING: nVidia proprietary OpenGL libraries detected.
nVidia's OpenGL libraries are known to have compatibility issues with qemu,
resulting in a segfault. Please uninstall these drivers or ensure the mesa libGL
-libraries precede nvidia's via LD_PRELOAD.
+libraries precede nvidia's via LD_PRELOAD(Already do it on Ubuntu).
EOM
+
+# Automatically use Ubuntu system's mesa libGL, other distro can add its own path
+ if grep -i ubuntu /etc/lsb-release &> /dev/null
+ then
+ echo "Skip nVidia's libGL on Ubuntu!"
+ GL_LD_PRELOAD="/usr/lib/libGL.so $LD_PRELOAD"
+ fi
fi
echo "Running $QEMU..."
# -no-reboot is a mandatory option - see bug #100
echo $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append '"'$KERNCMDLINE $SCRIPT_KERNEL_OPT'"'
-$QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT"
+LD_PRELOAD="$GL_LD_PRELOAD" $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT"
cleanup