]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
runqemu: disable graphic when no DISPLAY or vnc
authorRobert Yang <liezhi.yang@windriver.com>
Wed, 24 Jun 2015 09:27:39 +0000 (02:27 -0700)
committerRobert Yang <liezhi.yang@windriver.com>
Fri, 26 Jun 2015 01:26:05 +0000 (18:26 -0700)
Disable graphic when no DISPLAY or vnc rather than print an error like:
[snip]
Could not initialize SDL(No available video device) - exiting
[snip]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
scripts/runqemu

index 09c507dc7a23123964ed5a9a367c5e7bd6337d7c..78dfd1a047e7b2bbeb222ac7210a1d27b3276707 100755 (executable)
@@ -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