[1/1] qemu-script: Fix qemu seg fault if install Nvidia proprietary driver.

Submitted by Zhai, Edwin on May 6, 2011, 8:36 a.m.


Message ID 52d0f8883f82d2cab0fad9b85298506a169acec0.1304670670.git.edwin.zhai@intel.com
State New, archived
Headers show

Commit Message

Zhai, Edwin May 6, 2011, 8:36 a.m.
From: Zhai Edwin <edwin.zhai@intel.com>

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>
 scripts/poky-qemu-internal |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/scripts/poky-qemu-internal b/scripts/poky-qemu-internal
index c88d711..acaeb1b 100755
--- a/scripts/poky-qemu-internal
+++ b/scripts/poky-qemu-internal
@@ -448,20 +448,29 @@  else
 # qemu got segfault if linked with nVidia's libgl
 if ldd $QEMUBIN | grep -i nvidia &> /dev/null
 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).
+# 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
 echo "Running $QEMU..."
 # -no-reboot is a mandatory option - see bug #100