aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2015-06-24 02:27:39 -0700
committerRobert Yang <liezhi.yang@windriver.com>2015-06-25 18:26:05 -0700
commitdd6a444cfc1ef527520a0e3490b6a243f0e7679c (patch)
tree1c2121a32e10fb423023eba58318e3feb6e8b33a /scripts
parent2587b83faabdc8858e8746201805369ed8d53ba8 (diff)
downloadopenembedded-core-contrib-dd6a444cfc1ef527520a0e3490b6a243f0e7679c.tar.gz
runqemu: disable graphic when no DISPLAY or vnc
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>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu13
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 09c507dc7a..78dfd1a047 100755
--- 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