summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJon Mason <jdmason@kudzu.us>2021-03-10 18:05:33 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-11 13:59:35 +0000
commit9f8d049dbbe0b1760979d9f3b745124abfc54c90 (patch)
treeefa7df05dba37917a12157b10521496b12f7b594 /scripts
parent9dea4cd2f9f46ab3a75562639a22d8f56b4d26af (diff)
downloadopenembedded-core-contrib-9f8d049dbbe0b1760979d9f3b745124abfc54c90.tar.gz
runqemu: modify novga to conform to documentation
Passing 'novga' only adds '-vga none' to the qemu commandline and does not prevent other vga devices from being added, contrary to the documentation/help. Clean-up the vga logic and add the ability to prevent other vga devices from being added. Signed-off-by: Jon Mason <jon.mason@arm.com> Change-Id: I7ff8f9f3e419ce8bae3f3847d75f9275ca30406a Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu86
1 files changed, 55 insertions, 31 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 842509eb14..df4ee21d53 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -174,6 +174,13 @@ class BaseConfig(object):
self.nfs_running = False
self.serialconsole = False
self.serialstdio = False
+ self.nographic = False
+ self.sdl = False
+ self.gtk = False
+ self.gl = False
+ self.gl_es = False
+ self.egl_headless = False
+ self.novga = False
self.cleantap = False
self.saved_stty = ''
self.audio_enabled = False
@@ -460,38 +467,19 @@ class BaseConfig(object):
if arg in self.fstypes + self.vmtypes + self.wictypes:
self.check_arg_fstype(arg)
elif arg == 'nographic':
- if ('sdl' in sys.argv):
- raise RunQemuError('Option nographic makes no sense alongside the sdl option.' % (arg))
- if ('gtk' in sys.argv):
- raise RunQemuError('Option nographic makes no sense alongside the gtk option.' % (arg))
- self.qemu_opt_script += ' -nographic'
+ self.nographic = True
elif arg == 'sdl':
- if 'gl' in sys.argv[1:]:
- self.set_dri_path()
- self.qemu_opt_script += ' -vga virtio -display sdl,gl=on,show-cursor=on'
- elif 'gl-es' in sys.argv[1:]:
- self.set_dri_path()
- self.qemu_opt_script += ' -vga virtio -display sdl,gl=es,show-cursor=on'
- else:
- self.qemu_opt_script += ' -display sdl,show-cursor=on'
+ self.sdl = True
elif arg == 'gtk':
- if 'gl' in sys.argv[1:]:
- self.set_dri_path()
- self.qemu_opt_script += ' -vga virtio -display gtk,gl=on,show-cursor=on'
- elif 'gl-es' in sys.argv[1:]:
- self.set_dri_path()
- self.qemu_opt_script += ' -vga virtio -display gtk,gl=es,show-cursor=on'
- else:
- self.qemu_opt_script += ' -display gtk,show-cursor=on'
- elif arg == 'gl' or arg == 'gl-es':
- # These args are handled inside sdl or gtk blocks above
- if ('gtk' not in sys.argv) and ('sdl' not in sys.argv):
- raise RunQemuError('Option %s also needs gtk or sdl option.' % (arg))
+ self.gtk = True
+ elif arg == 'gl':
+ self.gl = True
+ elif 'gl-es' in sys.argv[1:]:
+ self.gl_es = True
elif arg == 'egl-headless':
- self.set_dri_path()
- self.qemu_opt_script += ' -vga virtio -display egl-headless,show-cursor=on'
+ self.egl_headless = True
elif arg == 'novga':
- self.qemu_opt_script += ' -vga none'
+ self.novga = True
elif arg == 'serial':
self.serialconsole = True
elif arg == "serialstdio":
@@ -1319,13 +1307,48 @@ class BaseConfig(object):
raise RunQemuError("Failed to boot, QB_SYSTEM_NAME is NULL!")
self.qemu_system = qemu_system
+ def setup_vga(self):
+ if self.nographic == True:
+ if self.sdl == True:
+ raise RunQemuError('Option nographic makes no sense alongside the sdl option.')
+ if self.gtk == True:
+ raise RunQemuError('Option nographic makes no sense alongside the gtk option.')
+ self.qemu_opt += ' -nographic'
+ return
+
+ if self.novga == True:
+ self.qemu_opt += ' -vga none'
+ return
+
+ if (self.gl_es == True or self.gl == True) and (self.sdl == False and self.gtk == False):
+ raise RunQemuError('Option gl/gl-es needs gtk or sdl option.')
+
+ if self.sdl == True or self.gtk == True or self.egl_headless == True:
+ self.set_dri_path()
+ self.qemu_opt += ' -vga virtio -display '
+ if self.egl_headless == True:
+ self.qemu_opt += 'egl-headless,'
+ else:
+ if self.sdl == True:
+ self.qemu_opt += 'sdl,'
+ elif self.gtk == True:
+ self.qemu_opt += 'gtk,'
+
+ if self.gl == True:
+ self.qemu_opt += 'gl=on,'
+ elif self.gl_es == True:
+ self.qemu_opt += 'gl=es,'
+ self.qemu_opt += 'show-cursor=on'
+
+ self.qemu_opt += ' %s' %self.get('QB_GRAPHICS')
+
def setup_serial(self):
# Setup correct kernel command line for serial
- if self.serialstdio == True or self.serialconsole == True or re.search("-nographic", self.qemu_opt) or self.tcpserial_portnum:
+ if self.serialstdio == True or self.serialconsole == True or self.nographic == True or self.tcpserial_portnum:
for entry in self.get('SERIAL_CONSOLES').split(' '):
self.kernel_cmdline_script += ' console=%s' %entry.split(';')[1]
- if self.serialstdio == True or re.search("-nographic", self.qemu_opt):
+ if self.serialstdio == True or self.nographic == True:
self.qemu_opt += " -serial mon:stdio"
else:
self.qemu_opt += " -serial mon:vc"
@@ -1364,7 +1387,7 @@ class BaseConfig(object):
if not os.access(qemu_bin, os.X_OK):
raise OEPathError("No QEMU binary '%s' could be found" % qemu_bin)
- self.qemu_opt = "%s %s %s %s %s %s" % (qemu_bin, self.get('NETWORK_CMD'), self.get('QB_RNG'), self.get('QB_GRAPHICS'), self.get('ROOTFS_OPTIONS'), self.get('QB_OPT_APPEND'))
+ self.qemu_opt = "%s %s %s %s %s" % (qemu_bin, self.get('NETWORK_CMD'), self.get('QB_RNG'), self.get('ROOTFS_OPTIONS'), self.get('QB_OPT_APPEND'))
for ovmf in self.ovmf_bios:
format = ovmf.rsplit('.', 1)[-1]
@@ -1389,6 +1412,7 @@ class BaseConfig(object):
self.qemu_opt += " -snapshot"
self.setup_serial()
+ self.setup_vga()
def start_qemu(self):
import shlex