From: Michael Halstead <mhalstead@linuxfoundation.org>
To: openembedded-core@lists.openembedded.org
Cc: rpurdie@linuxfoundation.org
Subject: [PATCH 1/3] scripts/runqemu: Add serialstdio mode
Date: Thu, 8 Nov 2018 12:58:38 -0800 [thread overview]
Message-ID: <20181108205840.24972-1-mhalstead@linuxfoundation.org> (raw)
From: Richard Purdie <richard.purdie@linuxfoundation.org>
Its currently not possible to have a console available whilst using qemu in graphics
mode. This is causing some issues for testing autobuilder bringup so all a "serialstdio"
mode to runqemu to accomodate this.
The existing serialstdio internal variable is renamed to allow the new user visible option.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
scripts/runqemu | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/scripts/runqemu b/scripts/runqemu
index 087220ca0a..0c61253d6a 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -75,6 +75,7 @@ of the following environment variables (in any order):
Simplified QEMU command-line options can be passed with:
nographic - disable video console
serial - enable a serial console on /dev/ttyS0
+ serialstdio - enable a serial console on the console (regardless of graphics mode)
slirp - enable user networking, no root privileges is required
kvm - enable KVM when running x86/x86_64 (VT-capable CPU required)
kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required)
@@ -211,6 +212,7 @@ class BaseConfig(object):
self.slirp_enabled = False
self.nfs_instance = 0
self.nfs_running = False
+ self.serialconsole = False
self.serialstdio = False
self.cleantap = False
self.saved_stty = ''
@@ -428,6 +430,9 @@ class BaseConfig(object):
self.qemu_opt_script += ' -nographic'
self.kernel_cmdline_script += ' console=ttyS0'
elif arg == 'serial':
+ self.kernel_cmdline_script += ' console=ttyS0'
+ self.serialconsole = True
+ elif arg == "serialstdio":
self.kernel_cmdline_script += ' console=ttyS0'
self.serialstdio = True
elif arg == 'audio':
@@ -1169,7 +1174,7 @@ class BaseConfig(object):
if self.snapshot:
self.qemu_opt += " -snapshot"
- if self.serialstdio:
+ if self.serialconsole:
if sys.stdin.isatty():
subprocess.check_call("stty intr ^]", shell=True)
logger.info("Interrupt character is '^]'")
@@ -1196,7 +1201,7 @@ class BaseConfig(object):
# INIT: Id "S1" respawning too fast: disabled for 5 minutes
serial_num = len(re.findall("-serial", self.qemu_opt))
if serial_num == 0:
- if re.search("-nographic", self.qemu_opt):
+ if re.search("-nographic", self.qemu_opt) or self.serialstdio:
self.qemu_opt += " -serial mon:stdio -serial null"
else:
self.qemu_opt += " -serial mon:vc -serial null"
--
2.17.2
next reply other threads:[~2018-11-08 20:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-08 20:58 Michael Halstead [this message]
2018-11-08 20:58 ` [PATCH 2/3] scripts/runqemu: Replace subprocess.run() for compatibilty Michael Halstead
2018-11-08 20:58 ` [PATCH 3/3] scripts/autobuilder-worker-prereq-tests: Shore up qemu testing Michael Halstead
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181108205840.24972-1-mhalstead@linuxfoundation.org \
--to=mhalstead@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
--cc=rpurdie@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox