[OE-core] [PATCH 1/2] runqemu: disable graphic when no DISPLAY

Robert Yang liezhi.yang at windriver.com
Fri Jun 26 01:27:41 UTC 2015



On 06/25/2015 08:13 PM, Burton, Ross wrote:
>
> On 25 June 2015 at 10:24, Robert Yang <liezhi.yang at windriver.com
> <mailto:liezhi.yang at windriver.com>> wrote:
>
>     +if [ -z "$DISPLAY" -o "$GRAPHIC" = "no" ]; then
>
>
> Does this break people using QEMU without SDL that connect to it using VNC?

It doesn't break it, but there is a little different, now both the text
console and graphic vnc server will start, the text console didn't start
before this patch. I'm not sure which is better, I've made another patch
to make it work as before, and put the patches here, you can decide which
one to use.

   git://git.openembedded.org/openembedded-core-contrib rbt/qemu_v2

diff --git a/scripts/runqemu b/scripts/runqemu
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -70,6 +70,8 @@ SCRIPT_KERNEL_OPT=""
  SERIALSTDIO=""
  KVM_ENABLED="no"
  KVM_ACTIVE="no"
+GRAPHIC="yes"
+PUBLICVNC="no"

  # Determine whether the file is a kernel or QEMU image, and set the
  # appropriate variables
@@ -142,8 +144,7 @@ while true; do
         ISOFS=true
         ;;
          "nographic")
-            SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -nographic"
-            SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0"
+            GRAPHIC="no"
              ;;
          "serial")
              SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -serial stdio"
@@ -187,6 +188,7 @@ while true; do
              ;;
          "publicvnc")
              SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -vnc 0.0.0.0:0"
+            PUBLICVNC="yes"
              ;;
          "") break ;;
          *)
@@ -291,6 +293,13 @@ if [ "x$KVM_ENABLED" = "xyes" ]; then
      fi
  fi

+# Disable graphic when no DISPLAY or -nographic is specified.
+if [ "$GRAPHIC" = "no" ] || [ -z "$DISPLAY" -a "$PUBLICVNC" = "no" ] ; then
+    echo "Disabling graphic."
+    SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -nographic"
+    SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0"
+fi
+
  machine2=`echo $MACHINE | tr 'a-z' 'A-Z' | sed 's/-/_/'`
  # MACHINE is now set for all cases


// Robert

>
> Ross



More information about the Openembedded-core mailing list