summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorKevin Hao <kexin.hao@windriver.com>2019-06-06 15:11:46 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-07 09:11:48 +0100
commite5f2684d60025fbe205d1974ba89341d1d5408be (patch)
tree98240634f2dd64c1592f8ec4a655058af942f0b9 /scripts
parentf5dd71ec5289f37661c71db170c0b2d151badd35 (diff)
downloadpoky-e5f2684d60025fbe205d1974ba89341d1d5408be.tar.gz
runqemu: Add the support to pass multi ports to tcpserial parameter
In some cases(such as the oeqa's qemurunner), we need to setup multi serial devices via the '-serial 127.0.0.1:xx" and the order of them is significant. The mixing use of "tcpserial" and "-serial 127.0.0.1:xx" cause ambiguous issues and we can't fix it by only adjusting the order of them. So add the support to pass multi ports to the tcpserial parameter, this will make sure that the order of setting up the serial is really what we want. [YOCTO Bug 13309] (From OE-Core rev: 766c3b56e5071b5a5a64e88df6d3abe5232dd958) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu12
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 5752ecda73..af90c010da 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -438,7 +438,7 @@ class BaseConfig(object):
438 elif arg == 'publicvnc': 438 elif arg == 'publicvnc':
439 self.qemu_opt_script += ' -vnc :0' 439 self.qemu_opt_script += ' -vnc :0'
440 elif arg.startswith('tcpserial='): 440 elif arg.startswith('tcpserial='):
441 self.tcpserial_portnum = arg[len('tcpserial='):] 441 self.tcpserial_portnum = '%s' % arg[len('tcpserial='):]
442 elif arg.startswith('biosdir='): 442 elif arg.startswith('biosdir='):
443 self.custombiosdir = arg[len('biosdir='):] 443 self.custombiosdir = arg[len('biosdir='):]
444 elif arg.startswith('biosfilename='): 444 elif arg.startswith('biosfilename='):
@@ -682,10 +682,16 @@ class BaseConfig(object):
682 682
683 def check_tcpserial(self): 683 def check_tcpserial(self):
684 if self.tcpserial_portnum: 684 if self.tcpserial_portnum:
685 ports = self.tcpserial_portnum.split(':')
686 port = ports[0]
685 if self.get('QB_TCPSERIAL_OPT'): 687 if self.get('QB_TCPSERIAL_OPT'):
686 self.qemu_opt_script += ' ' + self.get('QB_TCPSERIAL_OPT').replace('@PORT@', self.tcpserial_portnum) 688 self.qemu_opt_script += ' ' + self.get('QB_TCPSERIAL_OPT').replace('@PORT@', port)
687 else: 689 else:
688 self.qemu_opt_script += ' -serial tcp:127.0.0.1:%s' % self.tcpserial_portnum 690 self.qemu_opt_script += ' -serial tcp:127.0.0.1:%s' % port
691
692 if len(ports) > 1:
693 for port in ports[1:]:
694 self.qemu_opt_script += ' -serial tcp:127.0.0.1:%s' % port
689 695
690 def check_and_set(self): 696 def check_and_set(self):
691 """Check configs sanity and set when needed""" 697 """Check configs sanity and set when needed"""