diff options
author | Mikko Ylinen <mikko.ylinen@linux.intel.com> | 2017-06-13 18:39:09 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-14 14:53:58 +0100 |
commit | 44c0e8c804146becba4a4bd207c451f610844082 (patch) | |
tree | 7c9225511d3b6b4d601e89eda111989ad654500b | |
parent | b1da7c703b159757ce13f484b634a62f2d067dde (diff) | |
download | poky-44c0e8c804146becba4a4bd207c451f610844082.tar.gz |
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.
(From OE-Core rev: 06742ed59092530aedf03f65c3c9542c24ff7ac3)
Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | scripts/runqemu | 10 |
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): | |||
955 | def setup_network(self): | 955 | def setup_network(self): |
956 | if self.get('QB_NET') == 'none': | 956 | if self.get('QB_NET') == 'none': |
957 | return | 957 | return |
958 | cmd = "stty -g" | 958 | if sys.stdin.isatty(): |
959 | self.saved_stty = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8') | 959 | self.saved_stty = subprocess.check_output("stty -g", shell=True).decode('utf-8') |
960 | self.network_device = self.get('QB_NETWORK_DEVICE') or self.network_device | 960 | self.network_device = self.get('QB_NETWORK_DEVICE') or self.network_device |
961 | if self.slirp_enabled: | 961 | if self.slirp_enabled: |
962 | self.setup_slirp() | 962 | self.setup_slirp() |
@@ -1096,9 +1096,9 @@ class BaseConfig(object): | |||
1096 | self.qemu_opt += " -snapshot" | 1096 | self.qemu_opt += " -snapshot" |
1097 | 1097 | ||
1098 | if self.serialstdio: | 1098 | if self.serialstdio: |
1099 | logger.info("Interrupt character is '^]'") | 1099 | if sys.stdin.isatty(): |
1100 | cmd = "stty intr ^]" | 1100 | subprocess.check_call("stty intr ^]", shell=True) |
1101 | subprocess.check_call(cmd, shell=True) | 1101 | logger.info("Interrupt character is '^]'") |
1102 | 1102 | ||
1103 | first_serial = "" | 1103 | first_serial = "" |
1104 | if not re.search("-nographic", self.qemu_opt): | 1104 | if not re.search("-nographic", self.qemu_opt): |