Skip to contentSkip to conversation

qemu-script: Fix qemu segfault with Nvidia's proprietary driver

PATCH In review Zhai Edwin 2 participants 5 messages May 6, 2011 – May 10, 2011

lore
Share & tools
lore

Zhai Edwin

author
#0 lore raw

cover qemu-script: Fix qemu segfault with Nvidia's proprietary driver

From: Zhai Edwin <[email protected]>

Previsous solution is only giving warnings as different distro has different path of mesa libGL. This patch try to use different path for different distro after looking at /etc/lsb-release per Raj's suggestion. Ubuntu is there, and other distro handling can be easily added.

Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: gzhai/fix3
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=gzhai/fix3

Thanks,
Zhai Edwin <[email protected]>
---

Zhai Edwin (1):
qemu-script: Fix qemu seg fault if install Nvidia proprietary driver.

 scripts/poky-qemu-internal |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
author
#1 lore raw

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

From: Zhai Edwin <[email protected]>

This fix works on Ubuntu, and other distro can add its own path of Mesa's libGL

---
 scripts/poky-qemu-internal |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
scripts/poky-qemu-internal +11 -2
index c88d711..acaeb1b 100755
@@ -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
Signature · 1 line
1.7.1
#2 lore raw
In reply to Zhai Edwin
Quoted 16 lines · Zhai Edwin

From: Zhai Edwin<[email protected]>

Previsous solution is only giving warnings as different distro has different path of mesa libGL. This patch try to use different path for different distro after looking at /etc/lsb-release per Raj's suggestion. Ubuntu is there, and other distro handling can be easily added.

Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: gzhai/fix3
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=gzhai/fix3

Thanks,
Zhai Edwin<[email protected]>
---

Quoted 4 lines

Zhai Edwin (1):
qemu-script: Fix qemu seg fault if install Nvidia proprietary driver.

  scripts/poky-qemu-internal |   13 +++++++++++--

I think that you are using the old script name, I think that you should be changing runqemu-internal, not poky-qemu-internal

Please correct this.

Sau!

Quoted 7 lines
  1 files changed, 11 insertions(+), 2 deletions(-)

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 9 lines · Saul Wold
Quoted 5 lines · Zhai Edwin

Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: gzhai/fix3
Browse:

http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=gzhai/fix3

Quoted 1 line
Quoted 9 lines
Quoted 2 lines

Zhai Edwin (1):
qemu-script: Fix qemu seg fault if install Nvidia proprietary

driver.

Quoted 2 lines
  scripts/poky-qemu-internal |   13 +++++++++++--

I think that you are using the old script name, I think that you should be changing runqemu-internal, not poky-qemu-internal

Done. Pls. pull @ the same branch
Thanks,
edwin

Quoted 12 lines

Please correct this.

Sau!

Quoted 7 lines
  1 files changed, 11 insertions(+), 2 deletions(-)

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#4 lore raw
In reply to Zhai Edwin
Quoted 19 lines · Zhai Edwin

From: Zhai Edwin<[email protected]>

Previsous solution is only giving warnings as different distro has different path of mesa libGL. This patch try to use different path for different distro after looking at /etc/lsb-release per Raj's suggestion. Ubuntu is there, and other distro handling can be easily added.

Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: gzhai/fix3
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=gzhai/fix3

Thanks,
Zhai Edwin<[email protected]>
---

Zhai Edwin (1):
qemu-script: Fix qemu seg fault if install Nvidia proprietary driver.

Quoted 8 lines
  scripts/poky-qemu-internal |   13 +++++++++++--
  1 files changed, 11 insertions(+), 2 deletions(-)

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Merged in oe-core and poky master

Thanks
Sau!