summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-08 20:58:38 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-14 11:14:39 (GMT)
commite69ac0cab6828041e76504205bddb5014e20eaff (patch)
tree46318f33d9262dc54f4bb6bc768cddd2f6af3d20 /scripts
parent3f959b5dbd185e5985ce083b72e64a7201bd7e99 (diff)
downloadpoky-e69ac0cab6828041e76504205bddb5014e20eaff.tar.gz
scripts/runqemu: Add serialstdio mode
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. (From OE-Core rev: 101b70d3c6a0a5a022d96dfdd21500b757c8fada) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 087220c..0c61253 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -75,6 +75,7 @@ of the following environment variables (in any order):
75 Simplified QEMU command-line options can be passed with: 75 Simplified QEMU command-line options can be passed with:
76 nographic - disable video console 76 nographic - disable video console
77 serial - enable a serial console on /dev/ttyS0 77 serial - enable a serial console on /dev/ttyS0
78 serialstdio - enable a serial console on the console (regardless of graphics mode)
78 slirp - enable user networking, no root privileges is required 79 slirp - enable user networking, no root privileges is required
79 kvm - enable KVM when running x86/x86_64 (VT-capable CPU required) 80 kvm - enable KVM when running x86/x86_64 (VT-capable CPU required)
80 kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required) 81 kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required)
@@ -211,6 +212,7 @@ class BaseConfig(object):
211 self.slirp_enabled = False 212 self.slirp_enabled = False
212 self.nfs_instance = 0 213 self.nfs_instance = 0
213 self.nfs_running = False 214 self.nfs_running = False
215 self.serialconsole = False
214 self.serialstdio = False 216 self.serialstdio = False
215 self.cleantap = False 217 self.cleantap = False
216 self.saved_stty = '' 218 self.saved_stty = ''
@@ -429,6 +431,9 @@ class BaseConfig(object):
429 self.kernel_cmdline_script += ' console=ttyS0' 431 self.kernel_cmdline_script += ' console=ttyS0'
430 elif arg == 'serial': 432 elif arg == 'serial':
431 self.kernel_cmdline_script += ' console=ttyS0' 433 self.kernel_cmdline_script += ' console=ttyS0'
434 self.serialconsole = True
435 elif arg == "serialstdio":
436 self.kernel_cmdline_script += ' console=ttyS0'
432 self.serialstdio = True 437 self.serialstdio = True
433 elif arg == 'audio': 438 elif arg == 'audio':
434 logger.info("Enabling audio in qemu") 439 logger.info("Enabling audio in qemu")
@@ -1169,7 +1174,7 @@ class BaseConfig(object):
1169 if self.snapshot: 1174 if self.snapshot:
1170 self.qemu_opt += " -snapshot" 1175 self.qemu_opt += " -snapshot"
1171 1176
1172 if self.serialstdio: 1177 if self.serialconsole:
1173 if sys.stdin.isatty(): 1178 if sys.stdin.isatty():
1174 subprocess.check_call("stty intr ^]", shell=True) 1179 subprocess.check_call("stty intr ^]", shell=True)
1175 logger.info("Interrupt character is '^]'") 1180 logger.info("Interrupt character is '^]'")
@@ -1196,7 +1201,7 @@ class BaseConfig(object):
1196 # INIT: Id "S1" respawning too fast: disabled for 5 minutes 1201 # INIT: Id "S1" respawning too fast: disabled for 5 minutes
1197 serial_num = len(re.findall("-serial", self.qemu_opt)) 1202 serial_num = len(re.findall("-serial", self.qemu_opt))
1198 if serial_num == 0: 1203 if serial_num == 0:
1199 if re.search("-nographic", self.qemu_opt): 1204 if re.search("-nographic", self.qemu_opt) or self.serialstdio:
1200 self.qemu_opt += " -serial mon:stdio -serial null" 1205 self.qemu_opt += " -serial mon:stdio -serial null"
1201 else: 1206 else:
1202 self.qemu_opt += " -serial mon:vc -serial null" 1207 self.qemu_opt += " -serial mon:vc -serial null"