summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikko Ylinen <mikko.ylinen@linux.intel.com>2017-06-13 18:39:09 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-14 14:45:00 +0100
commit06742ed59092530aedf03f65c3c9542c24ff7ac3 (patch)
tree27bcaa7cb96c3b691be5334008d0f287a122d8a0
parent3a603a805ff3495ac9b8431acbf698757a28d32d (diff)
downloadopenembedded-core-contrib-06742ed59092530aedf03f65c3c9542c24ff7ac3.tar.gz
openembedded-core-contrib-06742ed59092530aedf03f65c3c9542c24ff7ac3.tar.bz2
openembedded-core-contrib-06742ed59092530aedf03f65c3c9542c24ff7ac3.zip
runqemu: change terminal settings for valid tty's
runqemu uses stty to change terminal settings to give users better control to qemu. However, stty does not work when runqemu is run directly or indirectly via oe-selftest in a Docker container (presumably some problems with Docker's pseudo-tty implementation). The error reported is: stty: 'standard input': Inappropriate ioctl for device As runqemu recently moved to subprocess.check_call() for stty calls we now get thrown an error and all runqemu runs fail. sys.stdin.isatty() does proper job in detecting if the stty calls can work so we use that check before running the stty subprocess operations. Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/runqemu10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 311fbebdf4..26328e5b51 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -955,8 +955,8 @@ class BaseConfig(object):
def setup_network(self):
if self.get('QB_NET') == 'none':
return
- cmd = "stty -g"
- self.saved_stty = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8')
+ if sys.stdin.isatty():
+ self.saved_stty = subprocess.check_output("stty -g", shell=True).decode('utf-8')
self.network_device = self.get('QB_NETWORK_DEVICE') or self.network_device
if self.slirp_enabled:
self.setup_slirp()
@@ -1096,9 +1096,9 @@ class BaseConfig(object):
self.qemu_opt += " -snapshot"
if self.serialstdio:
- logger.info("Interrupt character is '^]'")
- cmd = "stty intr ^]"
- subprocess.check_call(cmd, shell=True)
+ if sys.stdin.isatty():
+ subprocess.check_call("stty intr ^]", shell=True)
+ logger.info("Interrupt character is '^]'")
first_serial = ""
if not re.search("-nographic", self.qemu_opt):