Skip to contentSkip to conversation

qemu: nVidia warnings and warning format cleanup

PATCH Applied Darren Hart 2 participants 4 messages Mar 18, 2011

lore
Share & tools
lore
#0 lore raw

cover qemu: nVidia warnings and warning format cleanup

From: Darren Hart <[email protected]>

The following patches incorporate an updated version of Edwin's patch to warn the user on the detection of nVidia's libGL and also make the warning message format used in the script consistent.

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

Thanks,
Darren Hart <[email protected]>
---

Darren Hart (2):
qemu: warn user if nVidia libGL is detected (leads to qemu segfault)
qemu: make warning messages consistent in format

 scripts/poky-qemu-internal |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)
#1 lore raw

PATCH 1/2 qemu: warn user if nVidia libGL is detected (leads to qemu segfault)

From: Darren Hart <[email protected]>

nVidia's OpenGL libraries are known to have compatibility issues with qemu, resulting in a segfault. As different workarounds are required for the different distributions, just warn the user to explain the qemu segfault to follow, and suggest a workaround using LD_PRELOAD.

[YOCTO #649]
[YOCTO #698]

(Original patch from Edwin, Darren modified warning and git commit wording)

CC Mark Hatle <[email protected]>
CC Zhai Edwin <[email protected]>
---
 scripts/poky-qemu-internal |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
scripts/poky-qemu-internal +13 -1
index 046e2b6..0f0f799 100755
@@ -442,10 +442,22 @@ else
     echo "Warning: distccd not present, no distcc support loaded."
 fi
 
+# qemu got segfault if linked with nVidia's libgl
+if ldd $QEMUBIN | grep -i nvidia &> /dev/null
+then
+    echo "************** !!!Warning!!! **************
+    nVidia's proprietary 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.
+    " 
+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" || /bin/true
+# If QEMU crashes, we need to run stty sane
+$QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT" || stty sane
+
 
 cleanup
 
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/2 qemu: make warning messages consistent in format

In reply to Darren Hart

From: Darren Hart <[email protected]>

Try to make the output of the qemu script a bit more consistent by using the same format for the various warning messages:

WARNING: description of warning.
Detailed description of warning, actions taken, and/or instructions to user.

---
 scripts/poky-qemu-internal |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)
scripts/poky-qemu-internal +9 -8
index 0f0f799..82ef265 100755
@@ -75,7 +75,7 @@ if [ "$MACHINE" = "qemuarm" ]; then
     RAM=`echo $QEMU_MEMORY | sed 's/M$//'`
     if [[ -z "$RAM" || $RAM -gt 128 ]]; then
         echo "WARNING: qemuarm does not support > 128M of RAM."
-        echo "*** Changing QEMU_MEMORY to default of 128M ***"
+        echo "Changing QEMU_MEMORY to default of 128M."
         QEMU_MEMORY="128M"
         SCRIPT_QEMU_EXTRA_OPT=`echo $SCRIPT_QEMU_EXTRA_OPT | sed -e "s/$mem_set/-m 128/" `
     fi
@@ -102,7 +102,7 @@ acquire_lock() {
         # Check that the lockfile is not stale
         ps=`ps -ewwo pid | grep $(cat $lockfile.lock)`
         if [ -z "$ps" ]; then
-            echo "Warning: Stale lock file detected, deleting $lockfile.lock"
+            echo "WARNING: Stale lock file detected, deleting $lockfile.lock."
             rm -f $lockfile.lock
             echo $$ > $lockfile.lock
         else
@@ -439,17 +439,18 @@ if [ -x "$DISTCCD" ]; then
     PIDFILE=`mktemp`
     $DISTCCD --allow 192.168.7.2 --daemon --pid-file $PIDFILE &
 else
-    echo "Warning: distccd not present, no distcc support loaded."
+    echo "WARNING: distccd not present, no distcc support loaded."
 fi
 
 # qemu got segfault if linked with nVidia's libgl
 if ldd $QEMUBIN | grep -i nvidia &> /dev/null
 then
-    echo "************** !!!Warning!!! **************
-    nVidia's proprietary 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.
-    " 
+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.
+EOM
 fi
 
 echo "Running $QEMU..."
Signature · 1 line
1.7.1
#3 lore raw
In reply to Darren Hart
Quoted 10 lines · Darren Hart

From: Darren Hart <[email protected]>

The following patches incorporate an updated version of Edwin's patch to warn the user on the detection of nVidia's libGL and also make the warning message format used in the script consistent.

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

Quoted 8 lines

Thanks,
Darren Hart <[email protected]>
---

Darren Hart (2):
qemu: warn user if nVidia libGL is detected (leads to qemu segfault)
qemu: make warning messages consistent in format

Merged to master, thanks.

Richard