diff options
-rwxr-xr-x | scripts/runqemu-internal | 13 |
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 | |||
448 | fi | 448 | fi |
449 | 449 | ||
450 | # qemu got segfault if linked with nVidia's libgl | 450 | # qemu got segfault if linked with nVidia's libgl |
451 | GL_LD_PRELOAD=$LD_PRELOAD | ||
452 | |||
451 | if ldd $QEMUBIN | grep -i nvidia &> /dev/null | 453 | if ldd $QEMUBIN | grep -i nvidia &> /dev/null |
452 | then | 454 | then |
453 | cat << EOM | 455 | cat << EOM |
454 | WARNING: nVidia proprietary OpenGL libraries detected. | 456 | WARNING: nVidia proprietary OpenGL libraries detected. |
455 | nVidia's OpenGL libraries are known to have compatibility issues with qemu, | 457 | nVidia's OpenGL libraries are known to have compatibility issues with qemu, |
456 | resulting in a segfault. Please uninstall these drivers or ensure the mesa libGL | 458 | resulting in a segfault. Please uninstall these drivers or ensure the mesa libGL |
457 | libraries precede nvidia's via LD_PRELOAD. | 459 | libraries precede nvidia's via LD_PRELOAD(Already do it on Ubuntu). |
458 | EOM | 460 | EOM |
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 | ||
459 | fi | 468 | fi |
460 | 469 | ||
461 | echo "Running $QEMU..." | 470 | echo "Running $QEMU..." |
462 | # -no-reboot is a mandatory option - see bug #100 | 471 | # -no-reboot is a mandatory option - see bug #100 |
463 | echo $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append '"'$KERNCMDLINE $SCRIPT_KERNEL_OPT'"' | 472 | echo $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" | 473 | LD_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 | ||
467 | cleanup | 476 | cleanup |